protected function _actionAdd($context)
    {
        $entity = parent::_actionAdd($context);

        if ($entity->owner->isSubscribable()) {
            $notification = $this->createNotification(array(
                'name' => 'topic_add',
                'object' => $entity,
                'subscribers' => $entity->owner->subscriberIds->toArray(),
            ))->setType('post', array('new_post' => true));
        }

        return $entity;
    }
protected function _actionAdd($context)
    {
        $entity = parent::_actionAdd($context);

        if ($entity->owner->isSubscribable()) {
            $notification = $this->createNotification(array(
                'name' => 'topic_add',
                'object' => $entity,
                'subscribers' => $entity->owner->subscriberIds->toArray(),
            ))->setType('post', array('new_post' => true));
        }

        return $entity;
    }
protected function _actionAdd ( $ context ) { $ entity = parent :: _actionAdd ( $ context ) ; if ( $ entity -> owner -> isSubscribable ( ) ) { $ notification = $ this -> createNotification ( array ( 'name' => 'topic_add' , 'object' => $ entity , 'subscribers' => $ entity -> owner -> subscriberIds -> toArray ( ) , ) ) -> setType ( 'post' , array ( 'new_post' => true ) ) ; } return $ entity ; }
When a topic is added, then create a notification.

@param AnCommandContext $context Context parameter
When a topic is added then create a notification .