/**
  * Expands Criteria Parameters by walking the expressions and grabbing all
  * parameters and types from it.
  *
  * @param \Doctrine\Common\Collections\Criteria $criteria
  *
  * @return array
  */
 private function expandCriteriaParameters(Criteria $criteria)
 {
     $expression = $criteria->getWhereExpression();
     if ($expression === null) {
         return array();
     }
     $valueVisitor = new SqlValueVisitor();
     $valueVisitor->dispatch($expression);
     list($values, $types) = $valueVisitor->getParamsAndTypes();
     return $types;
 }
 /**
  * {@inheritdoc}
  */
 public function expandCriteriaParameters(Criteria $criteria)
 {
     $expression = $criteria->getWhereExpression();
     $sqlParams = array();
     $sqlTypes = array();
     if ($expression === null) {
         return array($sqlParams, $sqlTypes);
     }
     $valueVisitor = new SqlValueVisitor();
     $valueVisitor->dispatch($expression);
     list($params, $types) = $valueVisitor->getParamsAndTypes();
     foreach ($params as $param) {
         $sqlParams = array_merge($sqlParams, $this->getValues($param));
     }
     foreach ($types as $type) {
         list($field, $value) = $type;
         $sqlTypes = array_merge($sqlTypes, $this->getTypes($field, $value, $this->class));
     }
     return array($sqlParams, $sqlTypes);
 }
Example #3
0
    /**
     * Expands Criteria Parameters by walking the expressions and grabbing all
     * parameters and types from it.
     *
     * @param \Doctrine\Common\Collections\Criteria $criteria
     *
     * @return array(array(), array())
     */
    private function expandCriteriaParameters(Criteria $criteria)
    {
        $expression = $criteria->getWhereExpression();

        if ($expression === null) {
            return array(array(), array());
        }

        $valueVisitor = new SqlValueVisitor();

        $valueVisitor->dispatch($expression);

        list($values, $types) = $valueVisitor->getParamsAndTypes();

        $sqlValues = array();
        foreach ($values as $value) {
            $sqlValues[] = $this->getValue($value);
        }

        $sqlTypes = array();
        foreach ($types as $type) {
            list($field, $value) = $type;
            $sqlTypes[] = $this->getType($field, $value);
        }

        return array($sqlValues, $sqlTypes);
    }
 /**
  * Expand Criteria Parameters by walking the expressions and grabbing all
  * parameters and types from it.
  *
  * @param \Doctrine\Common\Collections\Criteria $criteria
  *
  * @return array(array(), array())
  */
 private function expandCriteriaParameters(Criteria $criteria)
 {
     $expression = $criteria->getWhereExpression();
     if ($expression === null) {
         return array(array(), array());
     }
     $valueVisitor = new SqlValueVisitor($this->_class);
     $valueVisitor->dispatch($expression);
     return $valueVisitor->getParamsAndTypes();
 }