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


PHP object函数代码示例

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


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

示例1: importArticles

 public function importArticles($filename, $dry_run = false)
 {
     // Open the file
     $open_ok = $self->open($filename);
     if ($open_ok !== true) {
         return JError::raiseError(500, $open_ok);
     }
     // Read the data and import the articles
     $num_records = 0;
     while ($self->readNextRecord()) {
         // Create the raw record
         $record = object();
         // Copy in the fields from the CSV data
         $this->bind($record);
         // Verify the category
         $cat_ok = $this->_verifyCategory((int) $record->catid, $record->category_title);
         if ($cat_ok !== true) {
             return JError::raiseError(500, $cat_ok);
         }
         // Verify the creator
         $creator_ok = $this->_verifyUser((int) $record->created_by, $record->created_by_name);
         if ($creator_ok !== true) {
             return JError::raiseError(500, $creator_ok);
         }
         // Save the record
         if (!$dry_run) {
             // ???
         }
         $num_records += 1;
     }
     $this->close();
 }
开发者ID:appukonrad,项目名称:attachments,代码行数:32,代码来源:importArticles.php

示例2: __init

 function __init()
 {
     access_policy('auth');
     $this->menu = $this->makeMenu('index,auth,url' . (object('user')->isAdmin() ? ',#admin,login,server' : ''));
     $this->invokeModel();
     include_once 'lib/cq-forms.php';
 }
开发者ID:hcopr,项目名称:Hubbub,代码行数:7,代码来源:settings.controller.php

示例3: friend_accept

  function friend_accept($entityKey, $groupId)
  {
    $connection = new HubbubConnection(object('user')->ds['u_entity'], $entityKey);
    $connection->group($groupId);
	  $friendEntity = new HubbubEntity($entityKey);
    return($this->friend_request($friendEntity));
  }
开发者ID:hcopr,项目名称:Hubbub,代码行数:7,代码来源:friends.model.php

示例4: check

 private function check($route)
 {
     if ($this->api->controller->method) {
         return;
     }
     $route_callback = call_user_func_array(array($this->api->controller, 'route'), func_get_args());
     $api_callback = null;
     if ($route_callback->status) {
         $this->api->controller->method = $this->api_method;
         $args_object = object(array('method' => $this->api_method, 'match' => $route_callback->match));
         if ($this->model_api_name) {
             $model_api_name = "api_" . $this->model_api_name;
             // $api_callback = $this->api->controller->model()->$model_api_name($args_object);
             $this->api->controller->model_api_processor = $object = object(array("method" => $model_api_name, "args" => $args_object));
             // $this->api->controller->api_callback = $api_callback;
         }
         if ($this->view_api_name && !\lib\router::get_storage('api')) {
             $view_api_name = "view_" . $this->view_api_name;
             if ($this->model_api_name) {
                 $args_object->api_callback = $api_callback;
             }
             // $api_callback = $this->api->controller->view()->$view_api_name($args_object);
             $this->api->controller->view_api_processor = $object = object(array("method" => $view_api_name, "args" => $args_object));
         }
     }
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:26,代码来源:config.php

示例5: check_route

 public function check_route()
 {
     $this->match = object();
     $args = func_get_args();
     if (count($args) == 0) {
         return;
     }
     $route = $args[0];
     $fn = isset($args[1]) ? $args[1] : false;
     if (is_string($route)) {
         $this->url($route);
     } else {
         if (!isset($route['max']) && isset($route['url']) && is_array($route['url'])) {
             $route['max'] = count($route['url']);
         } elseif (!isset($route['max']) && !(isset($route['url']) && is_string($route['url']) && preg_match("/^(\\/.*\\/|#.*#|[.*])[gui]{0,3}\$/i", $route['url']))) {
             $route['max'] = 0;
         }
         foreach ($route as $key => $value) {
             if (method_exists($this, $key)) {
                 $this->{$key}($value);
             }
         }
     }
     if ($this->status === true && is_object($fn)) {
         $arg = array_splice($args, 2);
         array_push($arg, $this->match);
         call_user_func_array($fn, $arg);
     }
     return $this->status;
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:30,代码来源:route.php

示例6: __construct

 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->controller = $object->controller;
     $this->data = new view\data();
     $this->data->url = object();
     $this->data->include = object();
     $this->data->global = object();
     $this->url = $this->data->url;
     $this->global = $this->data->global;
     $this->include = $this->data->include;
     // default data property
     $this->data->macro['forms'] = 'includes/macro/forms.html';
     // default display value
     $this->data->display['mvc'] = "includes/mvc/display.html";
     $myurl = router::get_protocol() . '://' . router::get_domain() . $_SERVER['REQUEST_URI'];
     if (isset($_SERVER['HTTP_REFERER']) && isset($_SESSION['debug'][md5($_SERVER['HTTP_REFERER'])])) {
         $myurl = $_SERVER['HTTP_REFERER'];
     }
     if (isset($_SESSION['debug'][md5($myurl)])) {
         $this->data->debug = $_SESSION['debug'][md5($myurl)];
         // if(isset($_SESSION['debug'][md5($myurl)]['show']))
         unset($_SESSION['debug'][md5($myurl)]);
         // else
         // $_SESSION['debug'][md5($myurl)]['show'] = true;
     }
     array_push($this->twig_include_path, root);
     if (method_exists($this, 'mvc_construct')) {
         $this->mvc_construct();
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:33,代码来源:view.php

示例7: createform

 function createform($_name, $_type = null)
 {
     $this->data->extendForm = true;
     if (!$this->form) {
         $this->twig_macro('form');
         $this->form = new \lib\form();
         $this->data->form = object();
     }
     $args = func_get_args();
     if (count($args) === 2) {
         $submit_value = T_('submit');
         if ($_type == 'add') {
             $submit_value = T_('submit');
         } elseif ($_type == 'edit') {
             $submit_value = T_('save');
         } elseif ($_type == 'login') {
             $submit_value = T_('sing in');
         } elseif ($_type == 'register') {
             $submit_value = T_('create an account');
         } elseif (!empty($_type)) {
             $submit_value = $_type;
         }
         array_push($args, $submit_value);
     }
     $form = call_user_func_array(array($this->form, 'make'), $args);
     if (get_class($form) == 'lib\\form' || preg_match("/cls\\\\form/", get_class($form))) {
         preg_match("/^(@[^\\.]+)*\\.(.+)\$/", $_name, $sName);
         $this->data->form->{$sName[2]} = $form;
     }
     // if type of form is edit then fill it with related data
     if ($_type == 'edit') {
         $this->form_fill($form, $sName[2]);
     }
     return $form;
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:35,代码来源:optimize.php

示例8: getAll

 /**
  * @desc - obtiene todos los registros de events
  * @access public
  * @author Iparra
  * @return object
  */
 public function getAll()
 {
     $query = $this->db->get('events');
     if ($query->num_rows() > 0) {
         return $query->result();
     }
     return object();
 }
开发者ID:CDPS,项目名称:SGTVA,代码行数:14,代码来源:Event.php

示例9: __construct

 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->querys = object();
     $this->controller = $object->controller;
     if (method_exists($this, '_construct')) {
         $this->_construct();
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:11,代码来源:model.php

示例10: object

 /**
  * @param array $array
  *
  * @return object
  */
 function object($array = [])
 {
     $obj = (object) NULL;
     foreach ($array as $key => $value) {
         if (is_array($value)) {
             $value = object($value);
         }
         $obj->{$key} = $value;
     }
     return $obj;
 }
开发者ID:tapiau,项目名称:muyo,代码行数:16,代码来源:object.php

示例11: manifest_include_file

 /**
  * require an execommand manifest file
  * @param  string $_file_name manifest file name
  */
 public function manifest_include_file($_file_name)
 {
     if (!array_key_exists($_file_name, manifest::$manifest_file_return)) {
         $manifest = object();
         $req = (require_once $_file_name);
         $manifest = (array) $manifest;
         $manifest = is_array($req) ? $req : $manifest;
         manifest::$manifest_file_return[$_file_name] = $manifest;
     } else {
         $manifest = manifest::$manifest_file_return[$_file_name];
     }
     if (is_array($manifest)) {
         $this->manifest_analyzer($manifest);
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:19,代码来源:manifest.php

示例12: objectize

 public function objectize($data)
 {
     if (is_array($data)) {
         $ret = object($data);
     }
     if (is_string($data)) {
         //see if it's a json struct?
         $tmp = json_decode($data);
         if (is_object($tmp)) {
             $ret = $tmp;
         } else {
             throw new NinjaException("Couldn't convert {$data}", 50);
         }
     }
     return $ret;
 }
开发者ID:sherdog,项目名称:wnd,代码行数:16,代码来源:Util.php

示例13: locale

 /**
  * @param string $lang
  */
 function locale($lang)
 {
     global $config;
     $lang = str_replace('..', '', $lang);
     $lang = str_replace('/', '', $lang);
     if (file_exists($file = '../locale/' . $lang . '.php')) {
         require_once $file;
     } elseif (file_exists($file = '../locale/en_US.php')) {
         require_once $file;
     } else {
         $locale = array();
     }
     if (debug_assert(isset($locale), "locale {$lang} isn't defined")) {
         $config->lang = $lang;
         $config->locale = object($locale);
     }
 }
开发者ID:tapiau,项目名称:muyo,代码行数:20,代码来源:locale.php

示例14: use_powerup

 public function use_powerup($playerID)
 {
     Validate::player($playerID);
     $playerModel = new PlayerModel();
     if ($_POST['payload'] == 'true') {
         Log::add("Payload pre hash: " . print_r($_POST, true));
         $_POST['payload'] = Util::hashPost($_POST);
     }
     $remaining = $playerModel->removePowerup($playerID, $_POST['payload']);
     if ($remaining) {
         $response['status'] = 'ok';
         $response['player'] = object(array("powerups" => $remaining));
     } else {
         $response['status'] = 'error';
     }
     $this->printJson($response);
 }
开发者ID:sherdog,项目名称:wnd,代码行数:17,代码来源:player.php

示例15: setUsername

  function setUsername($username)
	{
	  $userObj = object('user');
	  
	  $userObj->isNewUser = $this->ds['u_entity'] == 0;
	  $userObj->server = new HubbubServer(cfg('service/server'), true);
		$userObj->loadEntity();
		
		$userObj->entityDS['user'] = safename($username);
		$userObj->entityDS['url'] = getDefault($userObj->entityDS['url'], cfg('service/server').'/'.(cfg('service/url_rewrite') ? '' : '?').$username);
		$userObj->entityDS['_local'] = 'Y';
		$userObj->entityDS['_serverkey'] = $userObj->server->ds['s_key'];
		$userObj->entityDS['server'] = cfg('service/server');
		
		if(trim($userObj->entityDS['user']) != '') $ekey = DB_UpdateDataset('entities', $userObj->entityDS);
		$userObj->ds['u_entity'] = $ekey;
		
		if(trim($userObj->ds['u_name']) != '') DB_UpdateDataset('users', $userObj->ds);
    if($userObj->isNewUser) h2_execute_event('user_new', $userObj->entityDS, $userObj->ds);
	}
开发者ID:hcopr,项目名称:Hubbub,代码行数:20,代码来源:profile.model.php


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