当前位置: 首页>>代码示例>>PHP>>正文


PHP Self类代码示例

本文整理汇总了PHP中Self的典型用法代码示例。如果您正苦于以下问题:PHP Self类的具体用法?PHP Self怎么用?PHP Self使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Self类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sort

 /**
  * @return mixed
  */
 public static function sort($array = null)
 {
     $instance = new Self($array);
     if (true === is_array($array)) {
         $instance->set($array);
     }
     return $instance->doSort()->toArray();
 }
开发者ID:yejune,项目名称:bootapp,代码行数:11,代码来源:Dependency.php

示例2: buscarPorId

 /**
  * Busca uma doula existente no banco de dados
  * @param int $id
  * @return Doula
  */
 public static function buscarPorId($id)
 {
     $doula = new Self();
     $obj = $doula->ver(tbl_doulas, $id);
     if ($id !== $obj->id) {
         return false;
     }
     $this->hydrate((array) $doula);
     return $doula;
 }
开发者ID:umbernardo,项目名称:banco_projetos,代码行数:15,代码来源:Doula.php

示例3: mediaObject

 /**
  * Models a collection media object for media feeds
  *
  * @param type $mediaObject
  * @param type $mediaObjectType
  * @param type $mediaObjectId
  *
  * return void;
  */
 public static function mediaObject(&$mediaObject, $collection)
 {
     //If the media object is not a collection! skip it
     //1.Load the collection!
     if (!is_object($collection) && is_a($collection, Entity::class)) {
         $thisModel = new Self();
         $attachment = $thisModel->loadObjectByURI($collection);
     }
     //If the media object is not a collection! skip it
     $objectTypeshaystack = array("collection");
     if (!in_array($collection->getObjectType(), $objectTypeshaystack)) {
         return;
     }
     //Nothing to do here if we can't deal with it!
     $collectionObject = new Media\Collection();
     //2.Get all the elements in the collection, limit 5 if more than 5
     //3.Trigger their timeline display
     $collectionObject->set("objectType", "collection");
     $collectionObject->set("uri", $collection->getObjectURI());
     //Now lets populate our collection with Items
     $collectionItems = $collection->getPropertyValue("collection_items");
     $collectionItemize = explode(",", $collectionItems);
     $collectionObject->set("totalItems", count($collectionItemize));
     if (is_array($collectionItemize) && !empty($collectionItemize)) {
         $items = array();
         foreach ($collectionItemize as $item) {
             $itemObject = Media\MediaLink::getNew();
             //@TODO Will probably need to query for objectType of items in collection?
             //@TODO Also this will help in removing objects from collections that have previously been deleted
             $itemObjectEntity = $thisModel->load->model("attachment", "system")->loadObjectByURI($item);
             //Load the item with the attachment to get all its properties
             //Now check object_id exists;
             //If not delete the object all together;
             //Also check if attachments_src is defined and exsits;
             //If attachments id does not exists, delete the item from this collection;
             $itemObjectURL = !empty($item) ? "/system/object/{$item}/" : "http://placeskull.com/100/100/999999";
             $itemObject->set("url", $itemObjectURL);
             $itemObject->set("uri", $item);
             $itemObject->set("height", null);
             $itemObject->set("width", null);
             $itemObject->set("type", $itemObjectEntity->getPropertyValue("attachment_type"));
             $itemObject->set("name", $itemObjectEntity->getPropertyValue("attachment_name"));
             $items[] = $itemObject::getArray();
             unset($itemObject);
         }
         $collectionObject->set("items", $items);
     }
     //Now set the collection Object as the media Object
     $mediaObject = $collectionObject;
     unset($collection);
     unset($collectionObject);
     //All done
     return true;
 }
开发者ID:budkit,项目名称:budkit-cms,代码行数:63,代码来源:collection.php

示例4: store

 /**
  * @param  $string
  * @param  [$string]
  * @return @response
  */
 public static function store($module, $action)
 {
     $audit = new Self();
     $audit->module = $module;
     $audit->action = $action;
     $audit->ip = Request::getClientIp();
     $audit->user = self::getUser();
     $audit->created_at = Carbon::now();
     $audit->updated_at = Carbon::now();
     $audit->save();
 }
开发者ID:fagray,项目名称:fposs,代码行数:16,代码来源:Audit.php

示例5: view_data

 public static function view_data(Request $request, Post $post)
 {
     $instance = new Self();
     $per_page = session('per_page') ? session('per_page') : config('constants.per_page');
     $post = Post::with('user.votes')->with('subreddit.moderators')->with('comments')->where('id', $post->id)->first();
     $comment = $post->comments;
     $user = User::where('id', '=', Auth::id())->get();
     $check = $post->subreddit->moderators->where('user_id', Auth::id())->first();
     $isModerator = $check ? true : false;
     $result['per_page'] = $per_page;
     $result['comments'] = $instance->comment_list($per_page, $request, $post, $comment, $user, $isModerator);
     $result['total_comments'] = $instance->total_comments($post);
     return $result;
 }
开发者ID:ReyRodriguez,项目名称:laravel-reddit,代码行数:14,代码来源:CommentController.php

示例6: login

 /**
  * 登录日志
  * @param  [type] $type [description]
  * @param  [type] $user [description]
  * @return [type]       [description]
  */
 public static function login($type, $user)
 {
     $related_id = $user->id;
     switch ($type) {
         case 'employee':
             $action_type_id = 1;
             $ins_type_id = 6;
             $memo = '员工登录';
             break;
         case 'agency':
             $action_type_id = 2;
             $ins_type_id = 5;
             $memo = '代理商登录';
             break;
         case 'department':
             $action_type_id = 3;
             $ins_type_id = 4;
             $memo = '科室登录';
             break;
         default:
             break;
     }
     $memo = $memo . '-' . username();
     Self::add_log($action_type_id, $ins_type_id, $related_id, $memo);
 }
开发者ID:newset,项目名称:robot,代码行数:31,代码来源:ILog.php

示例7: details

 public static function details(Request $request)
 {
     //Note this is piggybacking on regular event controller functions, beware of changing them!!
     $eid = $request->eid;
     $event = Event::getEvent($eid);
     $invites = Self::getInvitesFromEid($eid);
     $all_poll_options = Self::getPollOptionsFromEid($eid);
     $itemslist = Event::getEventItems($eid);
     $userRSVP = Invite::getUserRSVP($eid);
     $items = [];
     $item_users = [];
     $ticketcost = (string) $event['ticketprice'];
     if (!strpos($ticketcost, '.')) {
         $ticketcost = $ticketcost . ".00";
     }
     foreach ($itemslist as $item) {
         array_push($items, $item);
         if ($item->uid != 0) {
             $tmpUser = User::getById($item->uid);
             array_push($item_users, $tmpUser);
         }
     }
     $chat_messages = MessageController::getMessagesFromEid($eid);
     return response()->json(compact('event', 'all_poll_options', 'items', 'invites', 'chat_messages', 'item_users', 'userRSVP', 'ticketcost'));
 }
开发者ID:umSoftEng2GrpE,项目名称:partEZ,代码行数:25,代码来源:ApiEventDetailsController.php

示例8: process

 public static function process($numWords, $numNums, $numChars)
 {
     //read in the words from the file on a single line
     $word = file("wordList.txt");
     //convert it to a 2 dimensional array. Index [0][n] is line 1
     $result = array_map(function ($v) {
         return explode("  ", $v);
     }, file("wordList.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
     //create password with selected number of words.
     $pWord = "";
     for ($g = 0; $g < $numWords; $g++) {
         $temp = $result[0][rand(0, count($result[0]))];
         $pWord = $pWord . $temp;
     }
     //clean out any special characters that may be in the file
     $pWord = Self::clean($pWord);
     //add characters
     for ($f = 0; $f < $numChars; $f++) {
         $pWord = $pWord . chr(rand(33, 45));
     }
     //add numbers
     for ($e = 0; $e < $numNums; $e++) {
         $pWord = $pWord . rand(0, 9);
     }
     return $pWord;
 }
开发者ID:acbrunso,项目名称:foobooks,代码行数:26,代码来源:Logic.php

示例9: getOrder

 public function getOrder($user_id)
 {
     $query = Self::find()->select('*')->from('fin_order as order')->leftjoin('fin_student as student', 'order.user_id = student.user_id')->where(['order.merchant_id' => $user_id]);
     $pages = new Pagination(['defaultPageSize' => 5, 'totalCount' => $query->count()]);
     $order = $query->offset($pages->offset)->limit($pages->limit)->Asarray()->all();
     return ['order' => $order, 'pages' => $pages];
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:7,代码来源:Order.php

示例10: getCountry

    public static function getCountry(array $country) {
      
        foreach ($country as $key => $value) {
	# code...
        switch($value) {

            case 'India':       Self::$con="in";
                                return Self::$con;
                                break;

            case 'US':          Self::$con="us";
                                return Self::$con;
                                break;

            case 'UK':          Self::$con="uk";
                                return Self::$con;
                                break;

            case 'Hong Kong':   Self::$con="hk";
                                return Self::$con;
                                break;

            case 'Turkey':      Self::$con="tr";
                                return Self::$con;
                                break;
                                                  
            }
         }

    }
开发者ID:jinguanio,项目名称:RClubAPI_NEW,代码行数:30,代码来源:Country.php

示例11: searchResult

 public static function searchResult()
 {
     require_once 'Search.model.php';
     require_once 'Upload.model.php';
     require_once 'User.model.php';
     $data = array();
     if (isset($_POST['searchProduct'])) {
         $searchProduct = $_POST['searchField'];
         $category = $_POST['category'];
         $state = $_POST['state'];
         $sort = $_POST['sort'];
         $query = SearchModel::searchQuery($searchProduct, $category, $state, $sort);
         try {
             $searchresult = SearchModel::getSearchResult($searchProduct, $category, $state, $sort);
             $data['template'] = 'searchResult.html';
             $data['products'] = $searchresult;
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
         } catch (Exception $e) {
             $data['error'] = $e->getMessage();
             $data['template'] = 'error.html';
             $data['states'] = UserModel::getStates();
             $data['categories'] = UploadModel::getCategories();
         }
     } else {
         $searchCheck = Self::searchCheck();
         $data['redirect'] = 'error.html';
     }
     return $data;
 }
开发者ID:miahellqvist,项目名称:webbloppis,代码行数:30,代码来源:Search.controller.php

示例12: picked_stocks

 function picked_stocks($code)
 {
     //grab informatino from database.
     $movements = $this->movement->selected($code);
     $stocks = $this->stocks->selected($code);
     //set table layout and view
     foreach ($stocks as $stock) {
         $stockarr[] = $this->parser->parse('Stocks/stock_table', (array) $stock, true);
     }
     $parms = array('table_open' => '<table class="stocks">');
     $this->table->set_template($parms);
     //generate html elements
     $rows = $this->table->make_columns($stockarr, 1);
     $this->data['stocktable'] = $this->table->generate($rows);
     foreach ($movements as $moves) {
         $movementarr[] = $this->parser->parse('Stocks/movement_table', (array) $moves, true);
     }
     $parm = array('table_open' => '<table class ="movements">');
     $this->table->set_template($parm);
     $rows_movement = $this->table->make_columns($movementarr, 1);
     $this->data['movementtable'] = $this->table->generate($rows_movement);
     //generate drop down menu and tables
     $this->data['pageselect'] = Self::populate_options();
     $this->data['pagebody'] = 'Stocks/stockview';
     $this->render();
 }
开发者ID:rupindersandhu,项目名称:Assignment-1-PHP,代码行数:26,代码来源:Stock.php

示例13: postprocess

 public static function postprocess($sessions, $groupparams, $user, $yachs, $sport, $period)
 {
     $olmapdetails->startpoints = $sessions;
     $olmapdetails->extent = Self::fullextent($period);
     $olmapdetails->sessions_sport = Self::getsports($period);
     return $olmapdetails;
 }
开发者ID:hogeh,项目名称:htraininglogs2,代码行数:7,代码来源:startpoint_olmapposthelper.php

示例14: sel_detail

 public function sel_detail($user_id)
 {
     $query = Self::find()->select('*')->from('fin_detail')->where(['user_id' => $user_id]);
     $pages = new Pagination(['defaultPageSize' => 5, 'totalCount' => $query->count()]);
     $detail = $query->offset($pages->offset)->limit($pages->limit)->Asarray()->all();
     return ['detail' => $detail, 'pages' => $pages];
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:7,代码来源:Detail.php

示例15: getSelectors

 public static function getSelectors()
 {
     foreach (Self::All() as $item) {
         $returnArray[$item->id] = $item->getName();
     }
     return $returnArray;
 }
开发者ID:reportingsjr,项目名称:makerspace-manager,代码行数:7,代码来源:EasySelect.php


注:本文中的Self类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。