public function delete()
 {
     $update = new DatabaseLayer\Update($this->_table);
     $update->setData(['deleted' => 'Yes']);
     $update->condition($this->getIDField(), $this->getId());
     $update->condition('sequence', $this->sequence);
     $update->execute();
     #echo "Deleting {$this->_table} with id = {$this->getId()}, sequence = {$this->sequence}\n";
     $this->reload();
     return $this;
 }
 /**
  * @expectedException \Thru\ActiveRecord\DatabaseLayer\Exception
  * @expectedExceptionMessage Active Record Cannot update into more than one table at a time!
  */
 public function testUpdateIntoTwoTablesFails()
 {
     $update = new DatabaseLayer\Update("test_models");
     $update->setTables(array("tm" => new DatabaseLayer\Table("test_models"), "tmb" => new DatabaseLayer\Table("test_model_bad")));
     $update->execute();
 }