private function checkEntity( $obj )
    {
        if( $class = $this->classGet() and !( $obj instanceof $class ) ) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Obj %s is not compatible with Container of class %s',
                    get_class( $obj ),
                    $class
                )
            );
        }
        return true;
    }
private function checkEntity( $obj )
    {
        if( $class = $this->classGet() and !( $obj instanceof $class ) ) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Obj %s is not compatible with Container of class %s',
                    get_class( $obj ),
                    $class
                )
            );
        }
        return true;
    }
private function checkEntity ( $ obj ) { if ( $ class = $ this -> classGet ( ) and ! ( $ obj instanceof $ class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Obj %s is not compatible with Container of class %s' , get_class ( $ obj ) , $ class ) ) ; } return true ; }
Check an entity implments ContainerInterface.
It should be the same type of entities already in collection.

@param mixed $obj
@return bool
Check an entity implments ContainerInterface . It should be the same type of entities already in collection .