protected function _afterEntityInstantiate(AnConfig $config)
    {
        $data = $config->data;

        $data->append(array(
            'subscribers' => array()
        ));

        if ($data->object) {

            if (is($data->object, 'ComBaseDomainEntityComment')) {

                $data->comment = $data->object;
                $data->object = $data->comment->parent;

                $data->append(array(
                     'subscribers' => array($data->comment->author->id),
                ));

            } elseif ($data->object->isModifiable() && !is($data->object, 'ComActorsDomainEntityActor')) {

                $data->append(array(
                    'subscribers' => array($data->object->author->id),
                ));

            } elseif (is_person($data->object)) {

                $data->append(array(
                    'subscribers' => array($data->object->id),
                ));
            }

            if ($data->object->isOwnable()) {
                $data->target = $data->object->owner;
            }
        }

        if ($data->target && $data->target->isNotifiable()) {
            $data->append(array(
                'subscribers' => array($data->target->id),
            ));
        }

        parent::_afterEntityInstantiate($config);

        if ($config->data->subscribers) {
            $this->setSubscribers($config->data->subscribers);
        }
    }
protected function _afterEntityInstantiate(AnConfig $config)
    {
        $data = $config->data;

        $data->append(array(
            'subscribers' => array()
        ));

        if ($data->object) {

            if (is($data->object, 'ComBaseDomainEntityComment')) {

                $data->comment = $data->object;
                $data->object = $data->comment->parent;

                $data->append(array(
                     'subscribers' => array($data->comment->author->id),
                ));

            } elseif ($data->object->isModifiable() && !is($data->object, 'ComActorsDomainEntityActor')) {

                $data->append(array(
                    'subscribers' => array($data->object->author->id),
                ));

            } elseif (is_person($data->object)) {

                $data->append(array(
                    'subscribers' => array($data->object->id),
                ));
            }

            if ($data->object->isOwnable()) {
                $data->target = $data->object->owner;
            }
        }

        if ($data->target && $data->target->isNotifiable()) {
            $data->append(array(
                'subscribers' => array($data->target->id),
            ));
        }

        parent::_afterEntityInstantiate($config);

        if ($config->data->subscribers) {
            $this->setSubscribers($config->data->subscribers);
        }
    }
protected function _afterEntityInstantiate ( AnConfig $ config ) { $ data = $ config -> data ; $ data -> append ( array ( 'subscribers' => array ( ) ) ) ; if ( $ data -> object ) { if ( is ( $ data -> object , 'ComBaseDomainEntityComment' ) ) { $ data -> comment = $ data -> object ; $ data -> object = $ data -> comment -> parent ; $ data -> append ( array ( 'subscribers' => array ( $ data -> comment -> author -> id ) , ) ) ; } elseif ( $ data -> object -> isModifiable ( ) && ! is ( $ data -> object , 'ComActorsDomainEntityActor' ) ) { $ data -> append ( array ( 'subscribers' => array ( $ data -> object -> author -> id ) , ) ) ; } elseif ( is_person ( $ data -> object ) ) { $ data -> append ( array ( 'subscribers' => array ( $ data -> object -> id ) , ) ) ; } if ( $ data -> object -> isOwnable ( ) ) { $ data -> target = $ data -> object -> owner ; } } if ( $ data -> target && $ data -> target -> isNotifiable ( ) ) { $ data -> append ( array ( 'subscribers' => array ( $ data -> target -> id ) , ) ) ; } parent :: _afterEntityInstantiate ( $ config ) ; if ( $ config -> data -> subscribers ) { $ this -> setSubscribers ( $ config -> data -> subscribers ) ; } }
Initializes the options for an entity after being created.

@param 	object 	An optional AnConfig object with configuration options.
Initializes the options for an entity after being created .