protected function setName($entity)
    {
        if (method_exists($entity, 'getName')) {
            $this->name = $entity->getName();

            return;
        }

        if ($entity->offsetExists('name')) {
            $this->name = $entity->name;

            return;
        }

        throw ItemNameMissing::for($this->modelType);
    }
protected function setName($entity)
    {
        if (method_exists($entity, 'getName')) {
            $this->name = $entity->getName();

            return;
        }

        if ($entity->offsetExists('name')) {
            $this->name = $entity->name;

            return;
        }

        throw ItemNameMissing::for($this->modelType);
    }
protected function setName ( $ entity ) { if ( method_exists ( $ entity , 'getName' ) ) { $ this -> name = $ entity -> getName ( ) ; return ; } if ( $ entity -> offsetExists ( 'name' ) ) { $ this -> name = $ entity -> name ; return ; } throw ItemNameMissing :: for ( $ this -> modelType ) ; }
Sets the name of the item.

@param Illuminate\Database\Eloquent\Model
@return void
@throws ItemNameMissing
Sets the name of the item .