/** * Updates an entity in the given table. * @param string $table Name of the table. * @param BaseEntity $entity The entity to be updated. * @return bool True on success or false on failure. */ public function updateEntity($table, $entity) { $entity->preUpdate(); $where = "`id` = " . $entity->getId(); return $this->update($table, $entity->toArray(), $where); }