12 use Psr\Log\LoggerInterface as Logger;
110 abstract protected function init();
120 $criteriaParts = $criteria->
toArray();
121 foreach ($criteriaParts as $key =>
$value) {
123 $mapperMethod =
'map' . $camelCaseKey;
124 if (method_exists($this, $mapperMethod)) {
126 throw new \InvalidArgumentException(
'Wrong type of argument, expecting array for '. $mapperMethod);
128 call_user_func_array([$this, $mapperMethod],
$value);
151 $fullExpression = $expression;
152 foreach (
$fields as $fieldKey => $fieldItem) {
153 $fullExpression = str_replace(
'{{' . $fieldKey .
'}}', $fieldItem, $fullExpression);
163 if (is_array($field)) {
165 foreach ($field as $key =>
$value) {
169 $resultCondition =
'(' . implode(
') ' . \
Magento\Framework\DB\
Select::SQL_OR .
' (', $conditions) .
')';
192 $this->resourceModel =
$model;
212 if (empty($this->resource)) {
230 if (!$this->select) {
257 foreach (
$table as $k => $v) {
265 if (!isset($this->joinedTables[
$table])) {
267 $this->joinedTables[
$alias] =
true;
291 throw new \InvalidArgumentException(
293 'dbModel read resource does not implement \Magento\Framework\DB\Adapter\AdapterInterface' 323 if (isset($mapper[
'fields'][$field])) {
324 $mappedField = $mapper[
'fields'][$field];
326 $mappedField = $field;
339 if (isset($this->
map)) {
379 return $this->
getConnection()->prepareSqlCondition($fieldName, $condition);
map(CriteriaInterface $criteria)
setResourceModelName($model)
getConditionSql($fieldName, $condition)
static snakeCaseToUpperCamelCase($input)
addFieldToFilter($field, $condition=null)
setConnection($connection)
__construct(Logger $logger, FetchStrategyInterface $fetchStrategy, ObjectFactory $objectFactory, MapperFactory $mapperFactory, Select $select=null)
getConditionFieldName($fieldName)
addExpressionFieldToSelect($alias, $expression, $fields)
initResource($resourceInterface)
join($table, $condition, $cols=' *')
translateCondition($field, $condition)