/** * @depends testCreate */ public function testIdMethods() { $model = new \Rapid\Model(); $this->assertEquals(null, $model->id(), 'id() of new model is not null'); $model->setId(1); $this->assertEquals(1, $model->id(), 'id don\\t match'); }
public function delete(\Rapid\Model $model) { if (!($id = $model->id())) { return false; } return $this->db()->delete($this->tablename, array('id' => $id)); }