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


PHP object::getClass方法代码示例

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


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

示例1: __construct

 /**
  * CONSTRUCTOR
  *
  * @return      @e void
  */
 public function __construct()
 {
     $this->registry = ipsRegistry::instance();
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_lang'), 'syncApp');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     $sqlPassed = FALSE;
     $classname = "db_driver_Mysql";
     $sync_DB = new $classname();
     $sync_DB->obj['sql_database'] = $this->settings['syncapp_realm_database'];
     $sync_DB->obj['sql_user'] = $this->settings['syncapp_mysql_user'];
     $sync_DB->obj['sql_pass'] = $this->settings['syncapp_mysql_password'];
     $sync_DB->obj['sql_host'] = $this->settings['syncapp_mysql_ip'];
     $sync_DB->return_die = true;
     if (!$sync_DB->connect()) {
         $fail = 1;
         return $fail;
         /* At this point we dont have a connection so ABORT! else database driver error */
     }
     if ($this->settings['syncapp_mysql_user'] || $this->settings['syncapp_mysql_password'] || $fail != 1) {
         $this->sqlPassed = TRUE;
         $this->registry->dbFunctions()->setDB('mysql', 'auth_DB', array('sql_database' => $this->settings['syncapp_realm_database'], 'sql_user' => $this->settings['syncapp_mysql_user'], 'sql_pass' => $this->settings['syncapp_mysql_password'], 'sql_host' => $this->settings['syncapp_mysql_ip']));
     } else {
         return;
     }
 }
开发者ID:Orfeous,项目名称:syncApp,代码行数:37,代码来源:memberSync.php

示例2: typehint

 /**
  * Returns the type hint of a `ReflectionParameter` instance.
  *
  * @param  object $parameter A instance of `ReflectionParameter`.
  * @return string            The parameter type hint.
  */
 public static function typehint($parameter)
 {
     $typehint = '';
     if ($parameter->getClass()) {
         $typehint = '\\' . $parameter->getClass()->getName();
     } elseif (preg_match('/.*?\\[ \\<[^\\>]+\\> (\\w+)(.*?)\\$/', (string) $parameter, $match)) {
         $typehint = $match[1];
     }
     return $typehint;
 }
开发者ID:nurka1109,项目名称:kahlan,代码行数:16,代码来源:Inspector.php

示例3: onSetAsSpammer

 /**
  * This method is run when a member is flagged as a spammer
  *
  * @param	array 	$member	Array of member data
  * @return	@e void
  */
 public function onSetAsSpammer($member)
 {
     /* Load status class */
     if (!$this->registry->isClassLoaded('memberStatus')) {
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus');
         $this->registry->setClass('memberStatus', new $classToLoad(ipsRegistry::instance()));
     }
     /* Delete the stuff */
     $this->registry->getClass('memberStatus')->setAuthor($member);
     $this->registry->getClass('memberStatus')->deleteAllReplies();
     $this->registry->getClass('memberStatus')->deleteAllMemberStatus();
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:18,代码来源:memberSync.php

示例4: __construct

 public function __construct(ipsRegistry $registry)
 {
     /* Make object */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:13,代码来源:core.php

示例5: __construct

 /**
  * Constructor
  *
  * @param	object		$registry		Registry object
  * @return	@e void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Make object */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     //-----------------------------------------
     // Need to reset?
     //-----------------------------------------
     if ($this->memberData['msg_count_reset']) {
         $this->memberData['pconversation_filters'] = $this->resetMembersFolderCounts($this->memberData['member_id']);
         $this->resetMembersTotalTopicCount($this->memberData['member_id']);
         $this->resetMembersNewTopicCount($this->memberData['member_id']);
     }
     /* Load parser */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser');
     $this->Parser = new $classToLoad();
     /* Set up parser */
     $this->Parser->set(array('memberData' => $this->memberData, 'parseBBCode' => 1, 'parseArea' => 'pms', 'parseHtml' => 0, 'parseEmoticons' => 1));
     //-----------------------------------------
     // INIT Folder contents
     //-----------------------------------------
     $folderContents = array();
     //-----------------------------------------
     // Do a little set up, do a litle dance, get
     // down tonight! *boogie*
     //-----------------------------------------
     $this->_dirData = $this->explodeFolderData($this->memberData['pconversation_filters']);
     //-----------------------------------------
     // Do we have VID?
     // No, it's just the way we walk! Haha, etc.
     //-----------------------------------------
     if ($this->request['folderID'] and $this->request['folderID']) {
         $this->_currentFolderID = $this->request['folderID'];
     } else {
         /* Got any new messages? If so, show that. If not, show myconvo
            I'm sure you could have figured that out without this silly comment...*/
         $this->_currentFolderID = $this->_dirData['new']['count'] ? 'new' : 'myconvo';
     }
     //-----------------------------------------
     // Print folder links
     //-----------------------------------------
     foreach ($this->_dirData as $id => $data) {
         if ($data['protected'] and $id != 'myconvo') {
             continue;
         }
         $folderContents[] = "<option value='move_{$id}'>{$data['real']}</option>";
     }
     if (count($folderContents) > 1) {
         $this->_jumpMenu = implode("\n", $folderContents);
     } else {
         $this->_jumpMenu = '';
     }
 }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:66,代码来源:messengerFunctions.php

示例6: validate

 /**
  * Attempt to validate feed
  *
  * @access	public
  * @param	string		Feed URL (uses $this->_url if one is not passed )
  * @return	bool
  * EXCEPTION CODES:
  * HTTP_STATUS_CODE				Incorrect http status code (code returned is added to $this->errors)
  * RSS_CLASS_ERROR				Error returned from RSS class (errors added to $this->errors)
  * NO_CHANNELS					RSS feed doesn't have any channels
  * NO_ITEMS						RSS feed doesn't have any items
  */
 public function validate($url = '')
 {
     $url = $url ? $url : $this->_url;
     /* Reset the class */
     $this->_reset();
     /* Parse URL */
     $this->_rssClass->parseFeedFromUrl($url);
     /* Validate Data - HTTP Status Code/Text */
     if ($this->_rssClass->classFileManagement->http_status_code != "200") {
         $this->errors[0] = $this->registry->getClass('class_localization')->words['_rssimportcode'] . $this->_rssClass->classFileManagement->http_status_code;
         //print_r( $this->errors );
         throw new Exception('HTTP_STATUS_CODE');
     }
     /* Any errors found? */
     if (is_array($this->_rssClass->errors) and count($this->_rssClass->errors)) {
         foreach ($this->_rssClass->errors as $error) {
             $this->errors[] = $error;
         }
         throw new Exception('RSS_CLASS_ERROR');
     }
     /* Got any channels? */
     if (!is_array($this->_rssClass->rss_channels) or !count($this->_rssClass->rss_channels)) {
         throw new Exception('NO_CHANNELS');
     }
     /* Any Items */
     if (!is_array($this->_rssClass->rss_items) or !count($this->_rssClass->rss_items)) {
         throw new Exception('NO_ITEMS');
     }
     /* Last validated URL */
     $this->_validatedUrl = $url;
     return TRUE;
 }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:44,代码来源:import.php

示例7: __construct

 /**
  * Constructor
  *
  * @access	public
  * @param	object	ipsRegistry
  * @return	void
  */
 public function __construct(ipsRegistry $registry)
 {
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $plugin = $this->settings['bot_antispam_type'];
     if (!file_exists(IPS_KERNEL_PATH . 'classCaptchaPlugin/' . $plugin . '.php')) {
         $plugin = 'default';
     }
     require_once IPS_KERNEL_PATH . 'classCaptchaPlugin/' . $plugin . '.php';
     $this->_plugInClass = new captchaPlugIn($registry);
 }
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:23,代码来源:classCaptcha.php

示例8: fetchForums

 /**
  * Returns the board's forums.
  * WARNING: Last option is deprecated and no longer supported.  User is automatically treated like a guest.
  * 
  * @param	string  $api_key		Authentication Key
  * @param	string  $api_module		Module
  * @param	string	$forum_ids		Comma separated list of forum ids
  * @param	bool	$view_as_guest	Treat user as a guest
  * @return	string	xml
  */
 public function fetchForums($api_key, $api_module, $forum_ids, $view_as_guest)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $api_key = IPSText::md5Clean($api_key);
     $api_module = IPSText::parseCleanValue($api_module);
     $forum_ids = $forum_ids ? explode(',', IPSText::parseCleanValue($forum_ids)) : null;
     $view_as_guest = intval($view_as_guest);
     //-----------------------------------------
     // Authenticate
     //-----------------------------------------
     if ($this->__authenticate($api_key, $api_module, 'fetchForums') !== FALSE) {
         //-----------------------------------------
         // Add log
         //-----------------------------------------
         $this->addLogging($api_key);
         //-----------------------------------------
         // Get some classes
         //-----------------------------------------
         ipsRegistry::getAppClass('forums');
         //-----------------------------------------
         // Fetch forum list
         //-----------------------------------------
         $return = array();
         foreach ($forum_ids as $id) {
             $return[] = $this->registry->getClass('class_forums')->forumsFetchData($id);
         }
         //-----------------------------------------
         // Return the data
         //-----------------------------------------
         $this->classApiServer->apiSendReply($return);
         exit;
     }
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:45,代码来源:api.php

示例9: delete

 /**
  * Cria uma instrução SQL de deleção no banco
  * @param	Model	$model		model a ser deletado
  * @throws	DatabaseException	disparada caso o model seja uma nova instância, ou não tenha a anotação Entity
  * @return	void
  */
 public function delete(Model $model)
 {
     $conditions = array();
     if (get_class($model) != $this->clazz) {
         throw new DatabaseException("O objeto deve ser do tipo '" . $this->clazz . "'");
     }
     $class = $this->annotation->getClass();
     if (!$class->Entity) {
         throw new DatabaseException('A classe ' . get_class($model) . ' não é uma entidade');
     }
     if ($model->_isNew()) {
         throw new DatabaseException('O método delete não pode ser utilizado com uma nova instância de ' . $this->clazz);
     }
     foreach ($model as $field => $value) {
         $property = $this->annotation->getProperty($field);
         if ($this->isField($property) && $this->isKey($property)) {
             $conditions['fields'][] = '`' . $field . '` = ?';
             $conditions['values'][] = $value;
         }
     }
     $entity = $class->Entity ? $class->Entity : get_class($model);
     $sql = 'DELETE FROM `' . $entity . '` WHERE ' . implode(' AND ', $conditions['fields']) . ';';
     Debug::addSql($sql, $conditions['values']);
     $this->operations[] = array('sql' => $sql, 'values' => $conditions['values']);
 }
开发者ID:nylmarcos,项目名称:estagio,代码行数:31,代码来源:MysqlDatasource.php

示例10: typehint

 /**
  * Returns the type hint of a `ReflectionParameter` instance.
  *
  * @param  object $parameter A instance of `ReflectionParameter`.
  * @return string            The parameter type hint.
  */
 public static function typehint($parameter)
 {
     $typehint = '';
     if ($parameter->getClass()) {
         $typehint = '\\' . $parameter->getClass()->getName();
     } elseif (preg_match('/.*?\\[ \\<[^\\>]+\\> (?:HH\\\\)?(\\w+)(.*?)\\$/', (string) $parameter, $match)) {
         $typehint = $match[1];
         if ($typehint === 'integer') {
             $typehint = 'int';
         } elseif ($typehint === 'boolean') {
             $typehint = 'bool';
         } elseif ($typehint === 'mixed') {
             $typehint = '';
         }
     }
     return $typehint;
 }
开发者ID:crysalead,项目名称:kahlan,代码行数:23,代码来源:Inspector.php

示例11: getRepositoryFromAdmin

 /**
  * [getRepositoryFromAdmin description]
  * @param  object $admin 
  * @return string        [description]
  */
 private function getRepositoryFromAdmin($admin)
 {
     $class = $admin->getClass();
     $bundle = $this->getBundleNameFromClass($class);
     $chunks = explode('\\', $class);
     $name = sprintf('%s:%s', $bundle, ucfirst(array_pop($chunks)));
     return $name;
 }
开发者ID:rccc,项目名称:sonata-admin-tests-generator,代码行数:13,代码来源:GenerateCommand.php

示例12: __construct

 /**
  * Method constructor
  *
  * @access	public
  * @param	string		Application
  * @return	@e void
  * 
  */
 public function __construct($app = 'core')
 {
     /* Make object */
     $this->registry = ipsRegistry::instance();
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     /* Set local data */
     $this->setApp($app);
     /* Load application file */
     $this->_loadExtension();
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:25,代码来源:build.php

示例13: setInstance

 /**
  * Create and deploy an instance of the referred class
  * @param string $instance  Namespace
  * @param string $property  (Child's) property to be written
  * @param array  $arguments Optional arguments parsed to the object constructor
  */
 protected function setInstance($instance, $property, $arguments = array())
 {
     $property = (string) $property;
     $this->ah->validateType($property, 'string');
     if (!is_object($instance)) {
         $instance = $this->getInstance($instance, $arguments);
     }
     $property = $property ?: strtolower($this->ah->getClass(get_class($instance)));
     $this->setProperty($property, $instance);
 }
开发者ID:dehare,项目名称:silex-basics,代码行数:16,代码来源:AbstractObjectManipulation.php

示例14: getResource

 /**
  * Instantiate the resource object
  *
  * @return object $this
  */
 protected function getResource()
 {
     $a = $this->Registry->Mongo->getCollection($this->resType)->findOne(array('_id' => $this->resID));
     if (empty($a) || empty($a['_id'])) {
         throw new \Lampcms\Exception('Invalid question or answer id ' . $this->resID);
     }
     $class = 'QUESTIONS' === $this->resType ? '\\Lampcms\\Question' : '\\Lampcms\\Answer';
     $this->Resource = new $class($this->Registry, $a);
     d('$this->Resource: ' . $this->Resource->getClass());
     return $this;
 }
开发者ID:narodev,项目名称:LampCMS-for-Open-org.com,代码行数:16,代码来源:Vote.php

示例15: _generateElement

 /**
  * Create one element
  *
  * @param object $node
  * @access private
  * @return null
  */
 private function _generateElement($node)
 {
     $cssClasses = [];
     $classLink = [];
     $dropDownShow = '';
     if ($node->isActive()) {
         // set active parent wrapper
         $cssClasses[] = $this->_activeClass;
         // set active link
         $classLink[] = $this->_activeClass;
         // set active dropdown list
         $dropDownShow = $this->_dropChildShowClass;
     }
     if ($node->getClassLink()) {
         $classLink[] = $node->getClassLink();
     }
     if ($node->getClass()) {
         $cssClasses[] = $node->getClass();
     }
     $class = count($cssClasses) > 0 ? " class='" . implode(' ', $cssClasses) . "'" : '';
     $classLink = $node->getClassLink() ? " class='" . implode(' ', $classLink) . "'" : '';
     $id = !is_null($node->getId()) ? " id='" . $node->getId() . "'" : '';
     $target = !is_null($node->getTarget()) ? " target='" . $node->getTarget() . "'" : '';
     $click = !is_null($node->getClick()) ? " onclick='" . $node->getClick() . "'" : '';
     // generate link and wrapper <li>
     $this->_string .= "\t\t<li{$class} {$id}>" . PHP_EOL;
     $this->_string .= "\t\t\t<a " . $classLink . " title='" . $node->getName() . "' " . $click . " href='" . $node->getUrl() . "' {$target}>";
     $this->_string .= $node->getIcon() ? '<i class="' . $node->getIcon() . '"></i>' : '';
     $this->_string .= '<span class="hidden-xs"> ' . $node->getName() . '</span>';
     $this->_string .= "</a>" . PHP_EOL;
     //generate childs
     if ($node->hasChilds()) {
         $ulClass = !empty($this->_dropChildClass) ? 'class="' . $this->_dropChildClass . ' ' . $dropDownShow . '"' : '';
         $this->_string .= "\t\t<ul {$ulClass}>" . PHP_EOL;
         $this->_generateChilds($node->getChilds());
         $this->_string .= "\t\t</ul>" . PHP_EOL;
     }
     $this->_string .= "\t\t</li>" . PHP_EOL;
 }
开发者ID:stanislav-web,项目名称:phalcon-development,代码行数:46,代码来源:Render.php


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