本文整理汇总了PHP中Map::containsKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::containsKey方法的具体用法?PHP Map::containsKey怎么用?PHP Map::containsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::containsKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
/**
*
* @param <type> $table
* @param ArrayIterator $params
* @return ArrayObject
*/
public function search($table, ArrayIterator $params)
{
$this->searchParams = $params;
$this->join();
if ($table == "analysis") {
$this->statements->remove("type_event");
}
$statement = "SELECT this_.* " . $this->selectAttributes() . " FROM {$table} this_ ";
$statement .= $this->join();
$i = 0;
$this->searchParams->rewind();
if ($this->searchParams->count() > 0 && !$this->searchParams->offsetExists('true')) {
$statement .= " WHERE ";
}
while ($this->searchParams->valid()) {
if ($this->statements->containsKey($this->searchParams->key())) {
if ($i++ > 0) {
$statement .= " AND ";
}
$clause = $this->statements->get($this->searchParams->key());
$statement .= str_replace(":" . $this->searchParams->key(), "'" . $this->searchParams->current() . "'", $clause['where']);
}
$this->searchParams->next();
}
return $this->getObject($statement . " ORDER BY this_.date DESC, this_.id DESC");
}
示例2: selectTypeOf
/**
* @param <type> $key
* @return Provider
*/
private function selectTypeOf($key)
{
if ($this->types->containsKey($key)) {
return $this->types->get($key);
}
return null;
}
示例3: isFieldSerializable
private static function isFieldSerializable(Clazz $clazz, Map $whitelist)
{
if ($clazz->isPrimitive()) {
return true;
}
return $whitelist->containsKey($clazz);
}
示例4: addHook
public function addHook($hook, $callback = null, $recallHook = false)
{
if ($this->hooks->containsKey($hook)) {
throw new RuntimeException('A plugin cannot listen to the same hook several time. Please check ' . $hook);
}
$value = array();
$value['hook'] = $hook;
$value['callback'] = $callback ? $callback : $hook;
$value['recallHook'] = $recallHook;
$this->hooks->put($hook, $value);
}