/** * get list count * * @param array $wheres make where query list * @param ConfigEntity $config config entity * @return int */ public function count(array $wheres, ConfigEntity $config = null) { $table = $this->divisionTable($config); $options = $this->proxyOption($config); $query = $this->connection->dynamic($table, $options); $query = $this->wheres($query, $wheres); $count = $query->count(); return $count; }
/** * insert new document revision * * @param DocumentEntity $doc inserted document entity * @param ConfigEntity $config document config entity * @return DocumentEntity */ public function insert(DocumentEntity $doc, ConfigEntity $config) { $doc->revisionId = $this->keygen->generate(); $doc->revisionNo = $this->nextNo($doc->id); $this->connection->dynamic($this->table)->insert($doc->getAttributes()); $configs = $this->revisionManager->getHandler()->getConfigHandler()->gets($config->get('group')); $this->revisionManager->add($configs, $doc->getAttributes()); return $doc; }
/** * comment 삭제 * * @param CommentEntity $comment comment object * @return int affecting statement */ public function delete(CommentEntity $comment) { return $this->conn->dynamic($this->table, ['id' => $comment->instanceId])->where('id', $comment->id)->delete(); }
/** * comment 삭제 * * @param CommentEntity $comment comment object * @return int */ public function delete(CommentEntity $comment) { return $this->conn->dynamic($this->table, [], false)->where('id', $comment->id)->delete(); }