src/Charcoal/Model/Collection.php
protected function modelKey($obj)
    {
        if (!$this->isAcceptable($obj)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Must be a model, received %s',
                    (is_object($obj) ? get_class($obj) : gettype($obj))
                )
            );
        }

        return $obj->id();
    }
protected function modelKey($obj)
    {
        if (!$this->isAcceptable($obj)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Must be a model, received %s',
                    (is_object($obj) ? get_class($obj) : gettype($obj))
                )
            );
        }

        return $obj->id();
    }
protected function modelKey ( $ obj ) { if ( ! $ this -> isAcceptable ( $ obj ) ) { throw new InvalidArgumentException ( sprintf ( 'Must be a model, received %s' , ( is_object ( $ obj ) ? get_class ( $ obj ) : gettype ( $ obj ) ) ) ) ; } return $ obj -> id ( ) ; }
Convert a given object into a model identifier.

Note: Practical for specialized collections extending the base collection.

@param  object $obj An acceptable object.
@throws InvalidArgumentException If the given object is not acceptable.
@return boolean
Convert a given object into a model identifier .