/** * Update an entity. * * @param object $entity The entity to insert * * @return void */ public function update($entity) { $identifier = $this->getIdentifier($entity); $data = $this->builder->reduce($entity); $this->connection->update($this->tableName, $data, $identifier); $this->builder->resolve($entity); }
/** * @param $article * * @depends testResolve * @testdox reduce() extracts the database structure from an entity */ public function testReduce($article) { $row = $this->builder->reduce($article); $this->assertEquals($this->articles[1], $row); }
/** * Delete an entity. * * @param object $entity The entity to sanitise * * @return void */ public function delete($entity) { $this->gateway->delete($this->tableName, $this->builder->reduce($entity), $this->getIdentifier($entity)); }