public function setSubscribers($subscribers)
    {
        //flatten the array
        $subscribers = AnHelperArray::getValues(AnConfig::unbox($subscribers));
        $ids = array();

        foreach ($subscribers as $subscriber) {
            if (is($subscriber, 'AnDomainEntityAbstract')) {
                $ids[] = $subscriber->id;
            } else {
                $ids[] = $subscriber;
            }
        }

        $ids = array_unique($ids);

        if (!empty($ids)) {
            $this->set('subscriberIds', AnDomainAttribute::getInstance('set')->setData($ids));
        } else {
            $this->delete();
        }

        return $this;
    }
public function setSubscribers($subscribers)
    {
        //flatten the array
        $subscribers = AnHelperArray::getValues(AnConfig::unbox($subscribers));
        $ids = array();

        foreach ($subscribers as $subscriber) {
            if (is($subscriber, 'AnDomainEntityAbstract')) {
                $ids[] = $subscriber->id;
            } else {
                $ids[] = $subscriber;
            }
        }

        $ids = array_unique($ids);

        if (!empty($ids)) {
            $this->set('subscriberIds', AnDomainAttribute::getInstance('set')->setData($ids));
        } else {
            $this->delete();
        }

        return $this;
    }
public function setSubscribers ( $ subscribers ) { //flatten the array $ subscribers = AnHelperArray :: getValues ( AnConfig :: unbox ( $ subscribers ) ) ; $ ids = array ( ) ; foreach ( $ subscribers as $ subscriber ) { if ( is ( $ subscriber , 'AnDomainEntityAbstract' ) ) { $ ids [ ] = $ subscriber -> id ; } else { $ ids [ ] = $ subscriber ; } } $ ids = array_unique ( $ ids ) ; if ( ! empty ( $ ids ) ) { $ this -> set ( 'subscriberIds' , AnDomainAttribute :: getInstance ( 'set' ) -> setData ( $ ids ) ) ; } else { $ this -> delete ( ) ; } return $ this ; }
Set a list of notifications subscribers.

@param array $subscribers An array of Ids or person objects
Set a list of notifications subscribers .