本文整理汇总了PHP中Record::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Record::delete方法的具体用法?PHP Record::delete怎么用?PHP Record::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteId
public static function deleteId($id)
{
self::deleteAttchment($id);
return Record::delete('ContentPart', (int) $id);
}
示例2: executeEdit
/**
* Edit
*/
public function executeEdit()
{
if ($this->isGET()) {
return $this->renderJson(array("success" => false, "info" => "POST only."));
} else {
$ids = array();
foreach ($this->getRequestParameter('record') as $data) {
if (!($record = RecordPeer::retrieveByPK($data['id']))) {
$record = new Record();
$record->setDomainId($this->domain->getId());
}
$record->setName($data['name']);
$record->setType($data['type']);
$record->setContent($data['content']);
$record->setTtl($data['ttl']);
if ($data['type'] == 'MX' || $data['type'] == 'SRV') {
$record->setPrio($data['prio']);
}
$record->save();
$ids[] = $record->getId();
}
$c = new Criteria();
$c->add(RecordPeer::DOMAIN_ID, $this->domain->getId());
$c->add(RecordPeer::ID, $ids, Criteria::NOT_IN);
foreach (RecordPeer::doSelect($c) as $record) {
$record->delete();
}
return $this->renderJson(array("success" => true, "info" => "Domain updated."));
}
}
示例3: deleteId
public static function deleteId($id)
{
return Record::delete('Article', (int) $id);
}
示例4: delete
public function delete()
{
global $g_pdo;
$request = <<<EOF
DELETE FROM
event_guest
WHERE
id_guest = :id
EOF;
debug($request);
debug("array=" . sprint_r(array(":id" => $this->id)));
$pst = $g_pdo->prepare($request);
$pst->execute(array(":id" => $this->id));
parent::delete();
}