當前位置: 首頁>>代碼示例>>PHP>>正文


PHP People::delete方法代碼示例

本文整理匯總了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));
 }
開發者ID:snowfire,項目名稱:database,代碼行數:8,代碼來源:ForeignOneToOneTest.php

示例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);
}
開發者ID:leqg,項目名稱:leqg,代碼行數:21,代碼來源:contact-suppression.ajax.php

示例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.
開發者ID:rafaelscbr,項目名稱:ORM,代碼行數:31,代碼來源:usingCRUD.php


注:本文中的People::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。