public function notifyMentioned(AnCommandContext $context)
    {
        $entity = $this->getItem();
        $subscribers = array();

        foreach ($this->_newly_mentioned as $username) {
            $person = $this->getService('repos:people.person')->find(array('username' => $username));

            if ($person && $person->authorize('mention')) {
                $subscribers[] = $person->id;
            }
        }

        if (count($subscribers) == 0) {
            return;
        }

        if ($entity instanceof ComBaseDomainEntityComment) {
            $parentIdentifier = $entity->parent->getIdentifier()->name;
            $parentController = $this->getService('com:'.AnInflector::pluralize($parentIdentifier).'.controller.'.$parentIdentifier);

            if ($parentController->isNotifier() && $entity->parent->isSubscribable()) {
                $data = array(
                    'name' => 'actor_mention_comment',
                    'object' => $entity,
                    'comment' => $entity,
                    'component' => $entity->parent->component,
                    'subscribers' => $subscribers,
                );

                $parentController->createNotification($data);
            }
        } else {
            $data = array(
                'name' => 'actor_mention',
                'object' => $entity,
                'component' => $entity->component,
                'subscribers' => $subscribers,
            );

            $notification = $this->_mixer->createNotification($data);
        }
    }
public function notifyMentioned(AnCommandContext $context)
    {
        $entity = $this->getItem();
        $subscribers = array();

        foreach ($this->_newly_mentioned as $username) {
            $person = $this->getService('repos:people.person')->find(array('username' => $username));

            if ($person && $person->authorize('mention')) {
                $subscribers[] = $person->id;
            }
        }

        if (count($subscribers) == 0) {
            return;
        }

        if ($entity instanceof ComBaseDomainEntityComment) {
            $parentIdentifier = $entity->parent->getIdentifier()->name;
            $parentController = $this->getService('com:'.AnInflector::pluralize($parentIdentifier).'.controller.'.$parentIdentifier);

            if ($parentController->isNotifier() && $entity->parent->isSubscribable()) {
                $data = array(
                    'name' => 'actor_mention_comment',
                    'object' => $entity,
                    'comment' => $entity,
                    'component' => $entity->parent->component,
                    'subscribers' => $subscribers,
                );

                $parentController->createNotification($data);
            }
        } else {
            $data = array(
                'name' => 'actor_mention',
                'object' => $entity,
                'component' => $entity->component,
                'subscribers' => $subscribers,
            );

            $notification = $this->_mixer->createNotification($data);
        }
    }
public function notifyMentioned ( AnCommandContext $ context ) { $ entity = $ this -> getItem ( ) ; $ subscribers = array ( ) ; foreach ( $ this -> _newly_mentioned as $ username ) { $ person = $ this -> getService ( 'repos:people.person' ) -> find ( array ( 'username' => $ username ) ) ; if ( $ person && $ person -> authorize ( 'mention' ) ) { $ subscribers [ ] = $ person -> id ; } } if ( count ( $ subscribers ) == 0 ) { return ; } if ( $ entity instanceof ComBaseDomainEntityComment ) { $ parentIdentifier = $ entity -> parent -> getIdentifier ( ) -> name ; $ parentController = $ this -> getService ( 'com:' . AnInflector :: pluralize ( $ parentIdentifier ) . '.controller.' . $ parentIdentifier ) ; if ( $ parentController -> isNotifier ( ) && $ entity -> parent -> isSubscribable ( ) ) { $ data = array ( 'name' => 'actor_mention_comment' , 'object' => $ entity , 'comment' => $ entity , 'component' => $ entity -> parent -> component , 'subscribers' => $ subscribers , ) ; $ parentController -> createNotification ( $ data ) ; } } else { $ data = array ( 'name' => 'actor_mention' , 'object' => $ entity , 'component' => $ entity -> component , 'subscribers' => $ subscribers , ) ; $ notification = $ this -> _mixer -> createNotification ( $ data ) ; } }
Notify the people who have been mentioned.

@param AnCommandContext $context
Notify the people who have been mentioned .