Пример #1
0
 public function _actionEdit($context)
 {
     parent::_actionEdit($context);
 }
Пример #2
0
 /**
  * Edit's an actor data.
  *
  * @param KCommandContext $context Context parameter
  *
  * @return AnDomainEntityAbstract
  */
 protected function _actionEdit(KCommandContext $context)
 {
     $entity = parent::_actionEdit($context);
     if ($entity->isPortraitable() && KRequest::has('files.portrait')) {
         $file = KRequest::get('files.portrait', 'raw');
         if ($this->bellowSizeLimit($file) && $file['error'] == 0) {
             $this->getItem()->setPortrait(array('url' => $file['tmp_name'], 'mimetype' => $file['type']));
             $story = $this->createStory(array('name' => 'avatar_edit', 'owner' => $entity, 'target' => $entity));
         } else {
             $this->getItem()->removePortraitImage();
         }
     }
     if ($entity->save($context)) {
         dispatch_plugin('profile.onSave', array('actor' => $entity, 'data' => $context->data));
     }
     return $entity;
 }