public function evaluate($values) { if ($this->isBindable()) { Assert::isPositiveInteger($this->getValue(), 'wrong substitution number: $' . $this->getValue()); Assert::isIndexExists($values, $this->getValue(), 'parameter $' . $this->getValue() . ' is not binded'); $value = $values[$this->getValue()]; } else { $value = $this->getValue(); } if ($value instanceof Query) { return $value; } elseif ($value instanceof Identifiable) { return $value->getId(); } elseif (is_array($value)) { $list = array(); foreach ($value as $key => $parameter) { if ($parameter instanceof OqlQueryParameter) { $list[$key] = $parameter->evaluate($values); } else { $list[$key] = $parameter; } } return $list; } return $value; }
/** * @return MultiPrefixPhpViewResolver **/ public function disablePrefix($alias = null, $disabled = true) { if (!$alias) { $alias = $this->lastAlias; } Assert::isNotNull($alias, 'nothing to disable'); Assert::isIndexExists($this->prefixes, $alias, 'no such alias: ' . $alias); $this->disabled[$alias] = $disabled; return $this; }
public function cloneInnerBuilder($property) { $mapping = $this->getFormMapping(); Assert::isIndexExists($mapping, $property); $primitive = $mapping[$property]; Assert::isInstance($primitive, 'PrimitiveForm'); $result = new $this($primitive->getProto()); if (isset($this->limitedPropertiesList[$primitive->getName()])) { $result->setLimitedPropertiesList($this->limitedPropertiesList[$primitive->getName()]); } return $result; }
protected function checkMandatory(array $assoc) { foreach (self::$mandatoryFields as $field) { Assert::isIndexExists($assoc, $field, "Mandatory field '{$field}' not found"); } return $this; }
/** * @param string $name * @return AMQPSelective */ public function setCurrent($name) { Assert::isIndexExists($this->pool, $name); $this->current = $name; return $this; }