示例#1
0
 public function _actionAdd($context)
 {
     $context->data->access = $context->data->parent->access;
     $context->data->author = get_viewer();
     $this->parent->resetRead();
     $post = parent::_actionAdd($context);
 }
示例#2
0
 /**
  * Add an actor.
  *
  * @param KCommandContext $context Context parameter
  *
  * @return AnDomainEntityAbstract
  */
 protected function _actionAdd(KCommandContext $context)
 {
     $entity = parent::_actionAdd($context);
     if ($entity->isPortraitable() && KRequest::has('files.portrait')) {
         $file = KRequest::get('files.portrait', 'raw');
         if ($this->bellowSizeLimit($file) && $file['error'] == 0) {
             $entity->setPortrait(array('url' => $file['tmp_name'], 'mimetype' => $file['type']));
         }
     }
     return $entity;
 }