Fenos\Notifynder\Builder\NotifynderBuilder::setEntityAction PHP Method

setEntityAction() protected method

It set the entity who will do the action of receive or send.
protected setEntityAction ( $from, $property ) : array
$from
$property
return array
    protected function setEntityAction($from, $property)
    {
        // Check if has the entity as parameter
        // it should be the firstOne
        if ($this->hasEntity($from)) {
            $this->isString($from[0]);
            $this->isNumeric($from[1]);
            $this->setBuilderData("{$property}_type", $from[0]);
            $this->setBuilderData("{$property}_id", $from[1]);
        } elseif ($from[0] instanceof Model) {
            $this->setBuilderData("{$property}_type", $from[0]->getMorphClass());
            $this->setBuilderData("{$property}_id", $from[0]->getKey());
        } else {
            $this->isNumeric($from[0]);
            $this->setBuilderData("{$property}_id", $from[0]);
        }
    }