Cartalyst\Sentinel\Persistences\PersistableInterface::getPersistableRelationship PHP Method

getPersistableRelationship() public method

Returns the persistable relationship name.
    public function getPersistableRelationship();

Usage Example

 /**
  * {@inheritDoc}
  */
 public function flush(PersistableInterface $persistable, $forget = true)
 {
     if ($forget) {
         $this->forget();
     }
     foreach ($persistable->{$persistable->getPersistableRelationship()}()->get() as $persistence) {
         if ($persistence->code !== $this->check()) {
             $persistence->delete();
         }
     }
 }