本文整理汇总了PHP中Conversation::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Conversation::delete方法的具体用法?PHP Conversation::delete怎么用?PHP Conversation::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conversation
的用法示例。
在下文中一共展示了Conversation::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeSchemaUpdate
public static function beforeSchemaUpdate()
{
$table = strtolower(get_called_class());
$schema = Schema::get();
$schemadef = $schema->getTableDef($table);
// 2016-01-06 We have to make sure there is no conversation with id==0 since it will screw up auto increment resequencing
if ($schemadef['fields']['id']['auto_increment']) {
// since we already have auto incrementing ('serial') we can continue
return;
}
// The conversation will be recreated in upgrade.php, which will
// generate a new URI, but that's collateral damage for you.
$conv = new Conversation();
$conv->id = 0;
if ($conv->find()) {
while ($conv->fetch()) {
// Since we have filtered on 0 this only deletes such entries
// which I have been afraid wouldn't work, but apparently does!
// (I thought it would act as null or something and find _all_ conversation entries)
$conv->delete();
}
}
}