本文整理汇总了PHP中Filter::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::create方法的具体用法?PHP Filter::create怎么用?PHP Filter::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
DB::table('filters')->delete();
$success = File::cleanDirectory($this->getImagesPath());
File::put($this->getImagesPath() . '.gitignore', File::get(public_path() . '/../app/storage/cache/.gitignore'));
Filter::create(['name' => 'Fitness', 'poi_url' => 'http://happyfist.co/pois/pois/POI/gyms.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
Filter::create(['name' => 'Lodging', 'poi_url' => 'http://happyfist.co/pois/pois/POI/hotels.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
Filter::create(['name' => 'Culture', 'poi_url' => 'http://happyfist.co/pois/pois/POI/artMuseums.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
Filter::create(['name' => 'Entertainment', 'poi_url' => 'http://happyfist.co/pois/pois/POI/nightlife.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
Filter::create(['name' => 'Dinning', 'poi_url' => 'http://happyfist.co/pois/pois/POI/restaurants.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
Filter::create(['name' => 'Education', 'poi_url' => 'http://happyfist.co/pois/pois/POI/schools.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
Filter::create(['name' => 'Retail', 'poi_url' => 'http://happyfist.co/pois/pois/POI/shop-and-specialities.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
Filter::create(['name' => 'Transportation', 'poi_url' => 'http://happyfist.co/pois/pois/POI/transit.kml', 'text' => 'lorem', 'paragraph_title' => 'ipsum']);
}
示例2: header
if ($filter && $filter->isSystemBanlist()) {
header('Location: banlist.php');
}
if ($_POST) {
switch (strtolower($_POST['do'])) {
case 'update':
if (!$filter) {
$errors['err'] = 'Unknown or invalid filter.';
} elseif ($filter->update($_POST, $errors)) {
$msg = 'Filter updated successfully';
} elseif (!$errors['err']) {
$errors['err'] = 'Error updating filter. Try again!';
}
break;
case 'add':
if (Filter::create($_POST, $errors)) {
$msg = 'Filter added successfully';
$_REQUEST['a'] = null;
} elseif (!$errors['err']) {
$errors['err'] = 'Unable to add filter. Correct error(s) below and try again.';
}
break;
case 'mass_process':
if (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) {
$errors['err'] = 'You must select at least one filter to process.';
} else {
$count = count($_POST['ids']);
if ($_POST['enable']) {
$sql = 'UPDATE ' . EMAIL_FILTER_TABLE . ' SET isactive=1 WHERE id IN (' . implode(',', $_POST['ids']) . ')';
if (db_query($sql) && ($num = db_affected_rows())) {
if ($num == $count) {
示例3: createSystemBanList
function createSystemBanList()
{
# XXX: Filter::create should return the ID!!!
$errors = array();
return Filter::create(array('execorder' => 99, 'name' => 'SYSTEM BAN LIST', 'isactive' => 1, 'match_all_rules' => false, 'reject_ticket' => true, 'rules' => array(), 'notes' => __('Internal list for email banning. Do not remove')), $errors);
}
示例4: run
public function run()
{
Filter::create(['name' => 'Employee MS Filter', 'active' => true]);
Filter::create(['name' => 'Property MS Filter', 'active' => true]);
Filter::create(['name' => 'Performance MS Filter', 'active' => true]);
}