当前位置: 首页>>代码示例>>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;未经允许,请勿转载。