コード例 #1
0
ファイル: Destination.php プロジェクト: ThunderID/capcus.v2
 static function boot()
 {
     parent::boot();
     Static::observe(new DestinationObserver());
     Static::observe(new HasNameObserver());
     Static::observe(new TreeObserver());
 }
コード例 #2
0
ファイル: Headline.php プロジェクト: ThunderID/capcus.v2
 static function boot()
 {
     parent::boot();
     Static::observe(new HeadlineObserver());
     Static::observe(new HasManyImagesObserver());
     Static::observe(new BelongsToTravelAgentObserver());
 }
コード例 #3
0
ファイル: Admin.php プロジェクト: ThunderID/capcus.v2
 static function boot()
 {
     parent::boot();
     Static::saving(function ($model) {
         $model->is_admin = 1;
     });
 }
コード例 #4
0
ファイル: TravelAgent.php プロジェクト: erickmo/CapcusAPI
 function setNameAttribute($v)
 {
     $this->attributes[Static::$name_field] = $v;
     if ($this->attributes['slug']) {
         $this->attributes['slug'] = Static::generateSlug($v, $this->_id);
     }
 }
コード例 #5
0
ファイル: Package.php プロジェクト: ThunderID/capcus.v2
 static function boot()
 {
     parent::boot();
     Static::observe(new PackageObserver());
     Static::observe(new HasNameObserver());
     Static::observe(new HasSlugObserver());
 }
コード例 #6
0
ファイル: Facade.php プロジェクト: szyhf/DIServer
 /**
  * @return Facade
  */
 protected static function getFacadeRoot()
 {
     static $instance = null;
     if (!$instance) {
         $instance = Container::GetInstance(Static::getFacadeAccessor());
     }
     return $instance;
 }
コード例 #7
0
ファイル: Tour.php プロジェクト: ThunderID/capcus.v2
 public static function ByPriorityTravelAgent($limit = 10)
 {
     return Static::join('travel_agencies', 'travel_agencies.id', '=', 'tours.travel_agent_id')->join('package_travel_agent', 'package_travel_agent.travel_agent_id', '=', 'travel_agencies.id')->join('packages', function ($join) {
         $join->on('packages.id', '=', 'package_travel_agent.package_id')->where('active_since', '<=', \Carbon\Carbon::now())->where('active_until', '>=', \Carbon\Carbon::now());
     })->whereHas('schedules', function ($q) {
         $q->where('departure', '>=', \Carbon\Carbon::now());
     })->select('tours.*')->orderBy('packages.priority', 'desc')->limit($limit)->get();
 }
コード例 #8
0
ファイル: Place.php プロジェクト: ThunderID/capcus.v2
 static function boot()
 {
     parent::boot();
     Static::observe(new PlaceObserver());
     Static::observe(new HasNameObserver());
     Static::observe(new HasSlugObserver());
     Static::observe(new HasPublishedAtObserver());
 }
コード例 #9
0
ファイル: HasSlugTrait.php プロジェクト: ThunderID/capcus.v2
 function scopeSlugIs($q, $v)
 {
     if (!$v) {
         return $q;
     } else {
         return $q->where(Static::getSlugField(), 'like', $v);
     }
 }
コード例 #10
0
 public static function get($key = NULL, $default = NULL, $xss = true)
 {
     if ($xss) {
         return Static::get($key, $default);
     } else {
         return Static::get($key, $default);
     }
 }
コード例 #11
0
ファイル: HasNameTrait.php プロジェクト: ThunderID/capcus.v2
 public function scopeNameLike($q, $v = null)
 {
     if (!$v) {
         return $q;
     } else {
         $v = str_replace('*', '%', $v);
         return $q->where(Static::getNameField(), 'like', $v);
     }
 }
コード例 #12
0
ファイル: Product.php プロジェクト: sliekasirdis79/POS
 public function isBarcodeAmongAllProducts()
 {
     //if( strtolower($this->barcodeid) === 'empty'){	return true; }
     if (strtolower($this->barcodeid) === 'empty') {
         $this->barcodeid = '';
         return true;
     }
     $prd = Static::where('barcodeid', $this->barcodeid)->first();
     //dd($prd);
     return $prd === null ? true : false;
 }
コード例 #13
0
ファイル: PublishableTrait.php プロジェクト: ThunderID/gogogo
 static function bootPublishableTrait()
 {
     if (!isset(Static::$slug_field)) {
         throw new Exception("\$slug_field has not been set", 1);
     }
     if (!isset(Static::$slug_source_field)) {
         throw new Exception("\$slug_source_field has not been set", 1);
     }
     Static::saving(function ($model) {
         if (!$model->{$model->slug_field}) {
             $model->{$model->slug_field} = str_slug($model->{$model->slug_source_field});
         }
     });
 }
コード例 #14
0
ファイル: TextColorPicker.php プロジェクト: wbconnor/button
 public static function textColorFor($color_string)
 {
     $color = Static::colorHexToDec($color_string);
     $black = [0, 0, 0];
     $white = [256, 256, 256];
     $blackTextPoints = 0;
     $whiteTextPoints = 0;
     Static::colorDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints;
     Static::colorDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints;
     Static::brightDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints;
     Static::brightDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints;
     Static::lumDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints;
     Static::lumDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints;
     Static::pythDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints;
     Static::pythDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints;
     return $blackTextPoints > $whiteTextPoints ? "black" : "white";
 }
コード例 #15
0
ファイル: IssuedVoucher.php プロジェクト: erickmo/CapcusAPI
 static function boot()
 {
     parent::boot();
     Static::observe(new IssuedVoucherObserver());
 }
コード例 #16
0
ファイル: TreeTrait.php プロジェクト: ThunderID/ThunderWorld
 function getPathSlugAttribute()
 {
     return str_replace(Static::getDelimiter(), ',', $this->path);
 }
コード例 #17
0
ファイル: FacadeService.php プロジェクト: szyhf/DIServer
 /**
  * @return FacadeService
  */
 protected static function getFacadeRoot()
 {
     return Container::Instance()->GetInstance(Static::getFacadeAccessor());
 }
コード例 #18
0
ファイル: Content.php プロジェクト: ThunderID/Halo
 static function boot()
 {
     parent::boot();
     Static::observe(new ContentObserver());
 }
コード例 #19
0
ファイル: TravelAgent.php プロジェクト: ThunderID/capcus.v2
 static function boot()
 {
     parent::boot();
     Static::observe(new TravelAgentObserver());
     Static::observe(new HasNameObserver());
 }
コード例 #20
0
ファイル: API.php プロジェクト: erickmo/capcusv3
 static function GetDestinationTags()
 {
     Static::init();
     $query_data['type'] = 'destination';
     $query_data['group'] = true;
     $api_response = Cache::remember('destination_tag_' . http_build_query($query_data), 20, function () use($query_data) {
         return json_decode(self::$api->get(self::$api_url . '/tags?' . http_build_query(array_merge($query_data, ['access_token' => Session::get('access_token')])))->getBody(), false);
     });
     if ($api_response->status != 'success') {
         return null;
     }
     return $api_response->data->data;
 }
コード例 #21
0
ファイル: AdminNavigation.php プロジェクト: hramose/myadmtest
 private static function setMenu()
 {
     Static::$arrMainMenu = [['url' => 'dashboard', 'label' => 'Dashboard', 'rawContent' => '<i class="fa fa-dashboard"></i> <span>Dashboard</span>'], ['url' => 'contacts', 'label' => 'Contact', 'rawContent' => '<i class="fa fa-dashboard"></i> <span>Contact</span> <small class="badge pull-right bg-yellow">12</small>'], ['url' => '#', 'label' => 'Parent', 'rawContent' => '<i class="fa fa-calendar"></i> <span>Parent</span> <i class="fa fa-angle-left pull-right"></i>', 'childrens' => [['url' => '#', 'label' => 'Menu 1', 'rawContent' => '<i class="fa fa-angle-double-right"></i>Menu 1'], ['url' => '#', 'label' => 'Menu 2', 'rawContent' => '<i class="fa fa-angle-double-right"></i>Menu 2'], ['url' => '#', 'label' => 'Menu 3', 'rawContent' => '<i class="fa fa-angle-double-right"></i>Menu 3']]], ['url' => 'inbox', 'label' => 'Inbox', 'rawContent' => '<i class="fa fa-envelope"></i> <span>Inbox</span>']];
 }
コード例 #22
0
ファイル: Subscriber.php プロジェクト: ThunderID/capcus.v2
 static function boot()
 {
     parent::boot();
     Static::observe(new SubscriberObserver());
 }
コード例 #23
0
ファイル: Plan.php プロジェクト: 760524mkfa00/plans
 public function download()
 {
     $plan = new Static();
     return $plan->fill(['path' => storage_path() . '/' . $this->path, 'name' => $this->filename]);
 }
コード例 #24
0
 function bootBelongsToDestinationTrait()
 {
     Static::observe(new BelongsToDestinationObserver());
 }
コード例 #25
0
ファイル: HasImages.php プロジェクト: ThunderID/Halo
 static function bootHasImages()
 {
     Static::observe(new HasImagesObserver());
 }
コード例 #26
0
ファイル: Address.php プロジェクト: erickmo/CapcusAPI
 static function boot()
 {
     parent::boot();
     Static::observe(new AddressObserver());
 }
コード例 #27
0
ファイル: Article.php プロジェクト: erickmo/CapcusAPI
 function setTitleAttribute($v)
 {
     $this->attributes[Static::$name_field] = $v;
     $this->attributes['slug'] = Static::generateSlug($v, $this->id);
 }
コード例 #28
0
ファイル: Image.php プロジェクト: ThunderID/Halo
 static function boot()
 {
     parent::boot();
     Static::observe(new ImageObserver());
 }
コード例 #29
0
 function bootBelongsToManyPlacesTrait()
 {
     Static::observe(new BelongsToManyPlacesObserver());
 }
コード例 #30
0
 function bootBelongsToTourTrait()
 {
     Static::observe(new BelongsToTourObserver());
 }