src/behaviors/PolymorphicRelation.php
private function validateUnderlyingObjectType($object)
    {
        if (count($this->mustBeInstanceOf) == 0) {
            return true;
        }
        foreach ($this->mustBeInstanceOf as $instance) {
            if ($object instanceof $instance) { //|| $object->asa($instance) !== null
                return true;
            }
        }
        Yii::error('Got invalid underlying object type! (' . $object->className() . ')');
        return false;
    }
private function validateUnderlyingObjectType($object)
    {
        if (count($this->mustBeInstanceOf) == 0) {
            return true;
        }
        foreach ($this->mustBeInstanceOf as $instance) {
            if ($object instanceof $instance) { //|| $object->asa($instance) !== null
                return true;
            }
        }
        Yii::error('Got invalid underlying object type! (' . $object->className() . ')');
        return false;
    }
private function validateUnderlyingObjectType ( $ object ) { if ( count ( $ this -> mustBeInstanceOf ) == 0 ) { return true ; } foreach ( $ this -> mustBeInstanceOf as $ instance ) { if ( $ object instanceof $ instance ) { //|| $object->asa($instance) !== null return true ; } } Yii :: error ( 'Got invalid underlying object type! (' . $ object -> className ( ) . ')' ) ; return false ; }
Validates if given object is of allowed type

@param mixed $object
@return boolean
Validates if given object is of allowed type