當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Filter::create方法代碼示例

本文整理匯總了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']);
 }
開發者ID:rilence,項目名稱:pacificSite,代碼行數:14,代碼來源:FiltersTableSeeder.php

示例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) {
開發者ID:nicolap,項目名稱:osTicket-1.7,代碼行數:31,代碼來源:filters.php

示例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);
 }
開發者ID:tirix,項目名稱:osTicket-1.8,代碼行數:6,代碼來源:class.banlist.php

示例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]);
 }
開發者ID:codeblues1516,項目名稱:godaddy,代碼行數:6,代碼來源:FiltersTableSeeder.php


注:本文中的Filter::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。