Пример #1
0
 /**
  * Deletes the existing/current model
  *
  * @return  bool
  * @since   2.0.0
  **/
 public function destroy()
 {
     // If it has an associated Joomla asset entry, try deleting that first
     if ($this->hasAttribute('asset_id')) {
         if (!Asset::destroy($this)) {
             return false;
         }
     }
     return $this->query->remove($this->getTableName(), $this->getPrimaryKey(), $this->getPkValue());
 }
Пример #2
0
 /**
  * Test to make sure we can run a basic delete statement
  *
  * @return  void
  **/
 public function testBasicRemove()
 {
     $dbo = $this->getMockDriver();
     $query = new Query($dbo);
     // Try to update an existing row
     $query->remove('users', 'id', 1);
     $this->assertEquals(3, $this->getConnection()->getRowCount('users'), 'Remove did not return the expected row count of 3');
 }