public function add($identifiable)
    {
        if ($identifiable instanceof Named) {
            return $this->set($identifiable->getId(), $identifiable);
        }

        $id = $identifiable instanceof Identifiable ? $identifiable->getId() : $identifiable;
        $title = $this->getTitleFromProvider($id);
        $resourceName = $identifiable instanceof AppliesToResource ? $identifiable->resourceName : $this->resourceName;

        return $this->set($id, $this->createItem($id, $title, $resourceName));
    }
public function add($identifiable)
    {
        if ($identifiable instanceof Named) {
            return $this->set($identifiable->getId(), $identifiable);
        }

        $id = $identifiable instanceof Identifiable ? $identifiable->getId() : $identifiable;
        $title = $this->getTitleFromProvider($id);
        $resourceName = $identifiable instanceof AppliesToResource ? $identifiable->resourceName : $this->resourceName;

        return $this->set($id, $this->createItem($id, $title, $resourceName));
    }
public function add ( $ identifiable ) { if ( $ identifiable instanceof Named ) { return $ this -> set ( $ identifiable -> getId ( ) , $ identifiable ) ; } $ id = $ identifiable instanceof Identifiable ? $ identifiable -> getId ( ) : $ identifiable ; $ title = $ this -> getTitleFromProvider ( $ id ) ; $ resourceName = $ identifiable instanceof AppliesToResource ? $ identifiable -> resourceName : $ this -> resourceName ; return $ this -> set ( $ id , $ this -> createItem ( $ id , $ title , $ resourceName ) ) ; }
Add a identifiable object or just an id.

@param mixed $identifiable

@return $this
Add a identifiable object or just an id .