protected function setEntityData($entity, $property)
    {
        if (is_array($entity) && count($entity) == 2) {
            TypeChecker::isString($entity[0]);
            TypeChecker::isNumeric($entity[1]);

            $type = $entity[0];
            $id = $entity[1];
        } elseif ($entity[0] instanceof Model) {
            $type = $entity[0]->getMorphClass();
            $id = $entity[0]->getKey();
        } else {
            TypeChecker::isNumeric($entity[0]);

            $type = notifynder_config()->getNotifiedModel();
            $id = $entity[0];
        }

        $this->setNotificationData("{$property}_type", $type);
        $this->setNotificationData("{$property}_id", $id);
    }
protected function setEntityData($entity, $property)
    {
        if (is_array($entity) && count($entity) == 2) {
            TypeChecker::isString($entity[0]);
            TypeChecker::isNumeric($entity[1]);

            $type = $entity[0];
            $id = $entity[1];
        } elseif ($entity[0] instanceof Model) {
            $type = $entity[0]->getMorphClass();
            $id = $entity[0]->getKey();
        } else {
            TypeChecker::isNumeric($entity[0]);

            $type = notifynder_config()->getNotifiedModel();
            $id = $entity[0];
        }

        $this->setNotificationData("{$property}_type", $type);
        $this->setNotificationData("{$property}_id", $id);
    }
protected function setEntityData ( $ entity , $ property ) { if ( is_array ( $ entity ) && count ( $ entity ) == 2 ) { TypeChecker :: isString ( $ entity [ 0 ] ) ; TypeChecker :: isNumeric ( $ entity [ 1 ] ) ; $ type = $ entity [ 0 ] ; $ id = $ entity [ 1 ] ; } elseif ( $ entity [ 0 ] instanceof Model ) { $ type = $ entity [ 0 ] -> getMorphClass ( ) ; $ id = $ entity [ 0 ] -> getKey ( ) ; } else { TypeChecker :: isNumeric ( $ entity [ 0 ] ) ; $ type = notifynder_config ( ) -> getNotifiedModel ( ) ; $ id = $ entity [ 0 ] ; } $ this -> setNotificationData ( "{$property}_type" , $ type ) ; $ this -> setNotificationData ( "{$property}_id" , $ id ) ; }
Set polymorphic model values.

@param array $entity
@param string $property
Set polymorphic model values .