本文整理汇总了PHP中People::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP People::delete方法的具体用法?PHP People::delete怎么用?PHP People::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDelete
public function testDelete()
{
$this->_mock = new Mock_Database($this, array(array('many', "SELECT *\nFROM people\nWHERE `id` IN (?, ?)", array(1, 2), null, array('return' => array(array('id' => '1', 'passport_id' => 3), array('id' => '2', 'passport_id' => 4)))), array('execute', "DELETE FROM people\nWHERE `id` IN (?, ?)", array(1, 2)), array('many', "SELECT *\nFROM passports\nWHERE `id` IN (?, ?)", array(3, 4), null, array('return' => array(array('id' => '3'), array('id' => '4')))), array('execute', "DELETE FROM passports\nWHERE `id` IN (?, ?)", array(3, 4))), array('debug' => false));
\Snowfire\Database\Model::database($this->_mock);
$people_model = new People();
$passports_model = new Passports();
$people_model->delete(array('id' => array(1, 2)), array('passports' => $passports_model));
}
示例2: People
<?php
/**
* Suppression d'un contact
*
* PHP version 5
*
* @category Ajax
* @package LeQG
* @author Damien Senger <hi@hiwelo.co>
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License 3.0
* @link http://leqg.info
*/
if (isset($_POST['fiche'])) {
// On ouvre la fiche concernée
$contact = new People($_POST['fiche']);
// On détruit ce contact
$contact->delete();
// On redirige vers les dossiers
Core::goPage('contacts', true);
}
示例3: array
$id = $people->getId();
/**
* Alterando um registro no banco de dados
*/
$people = new \People($id);
$people->setName("Rafael Pereira")->save();
/*
* FORMA RESUZIADA:
* Alterando um registro no banco de dados
*/
\People::newInstance($id)->setName("Rafael Pereira")->save();
/**
* Deletando um registro do banco de dados
*/
$people = new \People($id);
$people->delete();
/*
* FORMA RESUZIADA:
* Alterando um registro no banco de dados
*/
\People::newInstance($id)->delete();
/*
* Obdendo vários registros do banco de dados
*/
$people = new \People();
$where = "name LIKE '%Rafael%' OR email LIKE '%gmail%'";
$order = array('id DESC', 'name ASC');
$limit = array(1000, 0);
//$group = array('birthDate');
$group = null;
//Resultado: array(Class People), Uma array com várias instâncias da classe People.