/** * Deletes the current model. * * @return bool True on success, false otherwise. */ public function delete() { $model = new DynamicFluentModel(); $model->withModel($this); $primaryKeyValue = $this->columns[$this->getPrimaryKeyName()]; $rowCount = $model->where($this->getPrimaryKeyName(), $primaryKeyValue)->deleteAll(); return $rowCount > 0; }
public function testColumns() { $user = DynamicFluentModel::create('user', 'identifier', ['name' => 'Sweet Dee']); $user->save(); $this->assertEquals('1', $user->identifier); }