Ejemplo n.º 1
0
 /**
  * Map criteria to Select Query Object
  *
  * @param CriteriaInterface $criteria
  * @return Select
  */
 public function map(CriteriaInterface $criteria)
 {
     $criteriaParts = $criteria->toArray();
     foreach ($criteriaParts as $key => $value) {
         $camelCaseKey = \Magento\Framework\Api\SimpleDataObjectConverter::snakeCaseToUpperCamelCase($key);
         $mapperMethod = 'map' . $camelCaseKey;
         if (method_exists($this, $mapperMethod)) {
             if (!is_array($value)) {
                 $value = [$value];
             }
             call_user_func_array([$this, $mapperMethod], $value);
         }
     }
     return $this->select;
 }