コード例 #1
0
 /**
  * comment 수정
  *
  * @param CommentEntity $comment comment object
  * @return CommentEntity
  */
 public function update(CommentEntity $comment)
 {
     $diff = $comment->diff();
     $data = $comment->getAttributes();
     if (count($diff) > 0) {
         $data = array_merge($data, ['updatedAt' => date('Y-m-d H:i:s')]);
         $this->conn->dynamic($this->table, ['id' => $comment->instanceId])->where('id', $comment->id)->update($data);
     }
     return $this->createEntity($data);
 }
コード例 #2
0
 /**
  * comment 수정
  *
  * @param CommentEntity $comment comment object
  * @return CommentEntity
  */
 public function update(CommentEntity $comment)
 {
     $this->conn->dynamic($this->table, [], false)->where('id', $comment->id)->update($comment->getAttributes());
     return $comment;
 }