protected function _afterEntityInsert(AnCommandContext $context)
    {
        $this->set->setValue('photo_count', $this->set->photos->reset()->getTotal());
    }
protected function _afterEntityInsert(AnCommandContext $context)
    {
        $this->set->setValue('photo_count', $this->set->photos->reset()->getTotal());
    }
protected function _afterEntityInsert ( AnCommandContext $ context ) { $ this -> set -> setValue ( 'photo_count' , $ this -> set -> photos -> reset ( ) -> getTotal ( ) ) ; }
After adding a relationship, set the photo count for the set;.

AnCommandContext $context Context
After adding a relationship set the photo count for the set ; .