本文整理汇总了PHP中Datasource::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Datasource::delete方法的具体用法?PHP Datasource::delete怎么用?PHP Datasource::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Datasource
的用法示例。
在下文中一共展示了Datasource::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __actionDelete
protected function __actionDelete(array $datasources, $redirect = NULL)
{
$success = true;
foreach ($datasources as $handle) {
try {
Datasource::delete($handle);
} catch (DatasourceException $e) {
$success = false;
$this->alerts()->append($e->getMessage(), AlertStack::ERROR, $e);
} catch (Exception $e) {
$success = false;
$this->alerts()->append(__('An unknown error has occurred. <a class="more">Show trace information.</a>'), AlertStack::ERROR, $e);
}
// TODO: Delete reference from View XML
/*$sql = "SELECT * FROM `tbl_pages` WHERE `data_sources` REGEXP '[[:<:]]".$ds."[[:>:]]' ";
$pages = Symphony::Database()->fetch($sql);
if(is_array($pages) && !empty($pages)){
foreach($pages as $page){
$page['data_sources'] = preg_replace('/\b'.$ds.'\b/i', '', $page['data_sources']);
Symphony::Database()->update($page, 'tbl_pages', "`id` = '".$page['id']."'");
}
}*/
}
if ($success) {
redirect($redirect);
}
}