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


PHP ArrayObject::offsetExists方法代碼示例

本文整理匯總了PHP中ArrayObject::offsetExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayObject::offsetExists方法的具體用法?PHP ArrayObject::offsetExists怎麽用?PHP ArrayObject::offsetExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArrayObject的用法示例。


在下文中一共展示了ArrayObject::offsetExists方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getOption

 /**
  * Returns required option value
  *
  * @param string $optionName
  * @return mixed
  */
 public function getOption($optionName)
 {
     if ($this->_options instanceof ArrayObject && $this->_options->offsetExists($optionName)) {
         return $this->_options->offsetGet($optionName);
     }
     return NULL;
 }
開發者ID:ivan-novakov,項目名稱:ac-client-lib,代碼行數:13,代碼來源:Base.php

示例2: has

 /**
  * Test if has datas with $uid key
  * @param mixed $uid
  * @return boolean
  */
 public function has($uid)
 {
     if (null === $this->session) {
         return false;
     }
     return $this->session->offsetExists($uid);
 }
開發者ID:cityware,項目名稱:city-shared-memory,代碼行數:12,代碼來源:Session.php

示例3: getArgument

 /**
  * @return mixed
  * @param string $name
  * @param mixed $defaultValue
  */
 public function getArgument($name, $defaultValue = null)
 {
     if ($this->arguments->offsetExists($name)) {
         return $this->arguments->offsetGet($name);
     }
     return $defaultValue;
 }
開發者ID:visor,項目名稱:nano,代碼行數:12,代碼來源:Event.php

示例4: load

 public function load($name, $throw_exception = true)
 {
     if ($throw_exception && !$this->arrayObject->offsetExists($name)) {
         throw new PluginManagerException(sprintf("Plugin %s not found failure", $name));
     }
     return $this;
 }
開發者ID:lava83,項目名稱:lavaproto,代碼行數:7,代碼來源:PluginCollection.php

示例5: getParam

 public function getParam($name)
 {
     if (!$this->storage->offsetExists($name)) {
         return null;
     }
     return $this->storage->offsetGet($name);
 }
開發者ID:renatosalvatori,項目名稱:visio-crud-zf2,代碼行數:7,代碼來源:Params.php

示例6: getDirectory

 /**
  * Obtem o caminho de um diretorio
  * @param string $index
  * @return boolean
  */
 public function getDirectory($index)
 {
     if ($this->paths->offsetExists($index)) {
         return $this->paths->offsetGet($index);
     }
     return false;
 }
開發者ID:harleysad,項目名稱:harley-framework,代碼行數:12,代碼來源:View.php

示例7: getParam

 /**
  * Obtem um param enviado via Request Http
  * @param int|string $index
  * @return mixed|boolean
  */
 public function getParam($index)
 {
     if ($this->params->offsetExists($index)) {
         return $this->params->offsetGet($index);
     }
     return false;
 }
開發者ID:avandrevitor,項目名稱:S9,代碼行數:12,代碼來源:Request.php

示例8: getComponentData

 /**
  * Get component data
  *
  * @param string $name
  * @return array
  * @throws LocalizedException
  */
 public function getComponentData($name)
 {
     if (!$this->componentData->offsetExists($name)) {
         throw new LocalizedException(new Phrase('The requested component ("' . $name . '") is not found. ' . 'Before using, you must add the implementation.'));
     }
     return (array) $this->componentData->offsetGet($name);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:14,代碼來源:Definition.php

示例9: testArrayObject

 function testArrayObject()
 {
     $obj = new ArrayObject();
     $obj[2] = "something";
     $this->assertTrue($obj->offsetExists(2));
     $this->assertFalse($obj->offsetExists('2'));
     $this->assertFalse($obj->offsetExists(1));
 }
開發者ID:nyeholt,項目名稱:relapse,代碼行數:8,代碼來源:TestModel.php

示例10: getFieldDescriptor

 /**
  * returns field descriptor
  *
  * @throws \VisioCrudModeler\Exception\FieldNotFound
  * @return DbFieldDescriptor
  */
 public function getFieldDescriptor($fieldName)
 {
     if (!array_key_exists($fieldName, $this->definition['fields'])) {
         throw new FieldNotFound("field '" . $fieldName . "' not found in '" . $this->getName() . "'");
     }
     if (!$this->fieldDescriptors->offsetExists($fieldName)) {
         $this->fieldDescriptors->offsetSet($fieldName, new WebFieldDescriptor($this, $this->definition['fields'][$fieldName]));
     }
     return $this->fieldDescriptors->offsetGet($fieldName);
 }
開發者ID:renatosalvatori,項目名稱:visio-crud-zf2,代碼行數:16,代碼來源:WebDataSetDescriptor.php

示例11: _beforeRepositoryFetch

 /**
  * Check the object cache see if the data has already been retrieved
  * 
  * This cache is only persisted throughout a request 
  *
  * @param KCommandContext $context
  *
  * @return void
  */
 protected function _beforeRepositoryFetch(KCommandContext $context)
 {
     if ($this->_enable) {
         $key = $this->_getCacheKey($context->query);
         if (self::$_cache->offsetExists($key)) {
             $context->data = self::$_cache->offsetGet($key);
             return false;
         }
     }
 }
開發者ID:walteraries,項目名稱:anahita,代碼行數:19,代碼來源:cachable.php

示例12: get

 /**
  * @param string $index
  * @param null|string $defaultValue
  * @param bool   $filtered If you trust foreign input introduced to your PHP code - set to FALSE!
  *
  * @return string
  */
 public function get($index, $defaultValue = null, $filtered = true)
 {
     if ($this->data->offsetExists($index)) {
         if ($filtered === true) {
             // pretty high-level filtering here...
             return self::filter($this->data->offsetGet($index));
         }
         return $this->data->offsetGet($index);
     }
     return $defaultValue;
 }
開發者ID:PermeAgility,項目名稱:FrameworkBenchmarks,代碼行數:18,代碼來源:Param.php

示例13: getMapTo

 /**
  * Get Map to business or dao
  * @param string $index
  * @param array $map
  */
 public function getMapTo($index, $to)
 {
     if ($this->maps->offsetExists($index)) {
         $map = $this->maps->offsetGet($index);
         if (in_array($to, array('db', 'object'))) {
             return $map[$to];
         }
         return FALSE;
     } else {
         return FALSE;
     }
 }
開發者ID:avandrevitor,項目名稱:S9,代碼行數:17,代碼來源:MapperEngine.php

示例14: registerService

 /**
  * Process the registration of one service.
  *
  * @param string $className The class name of the service
  *
  * @throws \Subbly\Api\Exception If class name does not exists
  * @throws \Subbly\Api\Exception If the class does not implement \Subbly\Api\Service\Service
  * @throws \Subbly\Api\Exception If service name is already register
  */
 public function registerService($className)
 {
     if (!class_exists($className)) {
         throw new Exception(sprintf(Exception::SERVICE_CLASS_NOT_EXISTS, $className));
     }
     $service = new $className($this);
     if (!$service instanceof Service) {
         throw new Exception(sprintf(Exception::NOT_A_SERVICE, $className));
     }
     if ($this->services->offsetExists($service->name())) {
         throw new Exception(sprintf(Exception::SERVICE_ALREADY_EXISTS, $service->name()));
     }
     $this->services->offsetSet($service->name(), $service);
 }
開發者ID:subbly,項目名稱:framework,代碼行數:23,代碼來源:Api.php

示例15: get

 /**
  * Get an item from an array using "dot" notation.
  *
  * @param string|integer $index The index or identifier.
  * @param mixed          $default
  *
  * @return mixed|null
  */
 public static function get($index, $default = null)
 {
     if (self::$battery->offsetExists($index)) {
         return self::$battery->offsetGet($index);
     }
     $array = self::$battery->getArrayCopy();
     foreach ((array) explode('.', $index) as $segment) {
         if (!is_array($array) || !array_key_exists($segment, $array)) {
             return $default;
         }
         $array = $array[$segment];
     }
     return $array;
 }
開發者ID:gjerokrsteski,項目名稱:pimf-framework,代碼行數:22,代碼來源:Config.php


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