Exemplo n.º 1
0
 protected function main()
 {
     $this->Registry->registerObservers('INPUT_FILTERS');
     $oParser = new CommentParser($this->Registry);
     $oParser->addLike(new SubmittedCommentWWW($this->Registry));
     $this->returnResult();
 }
Exemplo n.º 2
0
 /**
  * (non-PHPdoc)
  *
  * @see Lampcms\Interfaces.CommentedResource::addComment()
  *
  * @param \Lampcms\CommentParser $Comment
  *
  * @return \Lampcms\Answer (this object)
  */
 public function addComment(CommentParser $Comment)
 {
     $aKeys = array('_id', 'i_uid', 'i_prnt', 'username', 'avtr', 'b_owner', 'inreplyto', 's_inreply', 'b', 't', 'i_ts', 'cc', 'cn', 'reg', 'city', 'zip', 'lat', 'lon');
     $aComments = $this->getComments();
     d('aComments: ' . \json_encode($aComments, 1));
     /**
      * Only keep the keys that we need
      * get rid of keys like hash, i_res
      * because we don't need them here
      */
     $aComment = $Comment->getArrayCopy();
     $aComment = \array_intersect_key($aComment, \array_flip($aKeys));
     $aComments[] = $aComment;
     $this->setComments($aComments);
     return $this;
 }