当前位置: 首页>>代码示例>>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;未经允许,请勿转载。