本文整理汇总了PHP中CMap::itemAt方法的典型用法代码示例。如果您正苦于以下问题:PHP CMap::itemAt方法的具体用法?PHP CMap::itemAt怎么用?PHP CMap::itemAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMap
的用法示例。
在下文中一共展示了CMap::itemAt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAPIKeyByDomain
/**
*
* Returns Google API key if found in collection
* @param string $domain
* @return string Google API key
*/
public function getAPIKeyByDomain($domain)
{
if (!$this->_keys->contains($domain)) {
return false;
}
return $this->_keys->itemAt($domain);
}
示例2: makeNode
/**
*
* Creates a single node as xml format
*
* @access private
* @param string name of the tag
* @param mixed tag value as string or array of nested tags in 'tagName' => 'tagValue' format
* @param array Attributes(if any) in 'attrName' => 'attrValue' format
* @return string formatted xml tag
*/
private function makeNode($tagName, $tagContent, $attributes = array())
{
$node = '';
if (is_array($tagContent) && $this->type == self::RSS1) {
$attributes['rdf:parseType'] = "Resource";
}
if (in_array($tagName, $this->feedElements->itemAt('CDATAEncoded'))) {
if ($this->type == self::ATOM) {
$attributes['type'] = "html";
}
$node .= CHtml::openTag($tagName, $attributes) . '<![CDATA[';
} else {
$node .= CHtml::openTag($tagName, $attributes);
}
if (is_array($tagContent)) {
foreach ($tagContent as $tag => $content) {
$node .= $this->makeNode($tag, $content);
}
} else {
$node .= in_array($tagName, $this->feedElements->itemAt('CDATAEncoded')) ? $tagContent : CHtml::encode($tagContent);
}
$node .= in_array($tagName, $this->feedElements->itemAt('CDATAEncoded')) ? PHP_EOL . ']]>' : '';
$node .= CHtml::closeTag($tagName);
return $node . PHP_EOL;
}
示例3: __set
/**
* @since v1.0.8
*/
public function __set($name, $value)
{
if ($this->hasEmbeddedDocuments() && isset(self::$_embeddedConfig[get_class($this)][$name])) {
if (is_array($value)) {
// Late creation of embedded documents on first access
if (is_null($this->_embedded->itemAt($name))) {
$docClassName = self::$_embeddedConfig[get_class($this)][$name];
$doc = new $docClassName($this->getScenario());
$doc->setOwner($this);
$this->_embedded->add($name, $doc);
}
return $this->_embedded->itemAt($name)->attributes = $value;
} else {
if ($value instanceof EMongoEmbeddedDocument) {
return $this->_embedded->add($name, $value);
}
}
} else {
parent::__set($name, $value);
}
}
示例4: itemAt
/**
* Returns the item with the specified key.
* This overrides the parent implementation by converting the key to lower case first if {@link caseSensitive} is false.
* @param mixed $key the key
* @return mixed the element at the offset, null if no element is found at the offset
*/
public function itemAt($key)
{
if ($this->caseSensitive) {
return parent::itemAt($key);
} else {
return parent::itemAt(strtolower($key));
}
}
示例5: getCurrencyConverter
/**
*
* Returns located currency converter
*/
public function getCurrencyConverter()
{
return $this->_data->itemAt('geoplugin_currencyConverter');
}