@param $params
@return \Thelia\Core\Template\Element\LoopResult

Return loop results for a product sale element
495428
protected function getProductSaleElements($params)
    {
        $loop = new ProductSaleElementsLoop($this->container);
        $loop->initializeArgs($params);

        return $loop->exec($pagination);
    }
917395
public function delete_template( $params ) {

		$params       = (object) $params;
		$params->type = 'template';

		return $this->delete_object( $params );
	}
176081
public function search($params)
    {
        $query = ShopAttribute::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'type_id' => $this->type_id,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        return $dataProvider;
    }
207653
public function search(array $params = array())
    {
        $endpoint = '/admin/customers/search.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Customer::class, $response['customers']);
    }
711369
public function all($productId, array $params = array())
    {
        $endpoint = '/admin/products/'.$productId.'/variants.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(ProductVariant::class, $response['variants']);
    }
1314779
public function generateSelectItems(array &$params)
    {
        $pageUid = $params['flexParentDatabaseRow']['_tx_column_layout_orig_pid'] ?? $params['flexParentDatabaseRow']['pid'];
        $size = $params['config']['txColumnLayout']['size'];
        $type = $params['config']['txColumnLayout']['type'];

        $columnSizes = ColumnLayoutUtility::getSizesFor($size, $type, $pageUid);

        $settings = ColumnLayoutUtility::getColumnLayoutSettings($pageUid);
        $sizeSettings = $settings['sizes.'][$size . '.'];
        $typeSettings = $settings['types.'][$type . '.'];
        $itemLabel = $this->getLanguageService()->sL($typeSettings['itemLabel']);

        $items = array_map(function ($column) use ($size, $itemLabel) {
            return [
                sprintf(
                    $itemLabel,
                    $column,
                    $size
                ),
                $column
            ];
        }, $columnSizes);

        if ($columnSizes[0] === 0 && ($typeSettings['itemLabelDisabled'] ?? false)) {
            $items[0][0] = sprintf($this->getLanguageService()->sL($typeSettings['itemLabelDisabled']), $type);
        }

        $typeOrdering = $typeSettings['ordering'] ?? null;
        $sizeTypeOverride = array_key_exists($type . '.', $sizeSettings) ? $sizeSettings[$type . '.']['ordering'] ?? false : false;
        $typeOrdering = $sizeTypeOverride ? $sizeTypeOverride : $typeOrdering;
        if ($typeOrdering === 'reverse') {
            $items = array_reverse($items);
        }

        $params['items'] = $items;
    }
511136
public function get(array $params) {
        $this->_requireDataType($params);

        if (array_get($params, 'datatype') === self::METHOD_DICTIONARY) {
            return $this->getDictionary();
        } elseif (array_get($params, 'relatedType') && array_get($params, 'id')) {
            list($response, $httpCode) = $this->_getRelatedResults($params);
        } elseif (array_get($params, 'id')) {
            list($response, $httpCode) = $this->_getSingleResult($params);
        } else {
            list($response, $httpCode) = $this->_getIndex($params);
        }

        return $this->_formatResponse($response, $httpCode);
    }
1079113
public function search($params)
    {
        $query = Event::find()->with('category');

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'plugin_id' => $this->plugin_id,
            'app_id' => $this->app_id,
            'category_id' => $this->category_id,
            'status' => $this->status
        ]);

        $query->andFilterWhere(['like', 'trigger_class', $this->trigger_class])
            ->andFilterWhere(['like', 'trigger_event', $this->trigger_event])
            ->andFilterWhere(['like', 'handler_class', $this->handler_class])
            ->andFilterWhere(['like', 'handler_method', $this->handler_method])
            ->andFilterWhere(['like', 'data', $this->data]);

        return $dataProvider;
    }
507998
public function getRows(array $params = [])
    {
        $query = $this->createQueryBuilder('pc');

        if (array_key_exists('idPlayer', $params)) {
            $query->where('pc.idPlayer= :idPlayer')
                ->setParameter('idPlayer', $params['idPlayer']);
        }

        if (array_key_exists('limit', $params)) {
            $query->setMaxResults($params['limit']);
        }

        if (array_key_exists('orderBy', $params)) {
            $query->orderBy($params['orderBy']['column'], $params['orderBy']['order']);
        }

        return $query->getQuery()->getResult();
    }
107202
public function search($params)
    {
        $query = WarehouseVoucherItems::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }
        $query->andFilterWhere([
            'id'                   => $this->id,
            'warehouse_voucher'    => $this->warehouse_voucher,
            'warehouse_product'    => $this->warehouse_product,
            'product_unit'         => $this->product_unit,
            'product_unit_price'   => $this->product_unit_price,
            'quantity'             => $this->quantity,
            'supplier_quantity'    => $this->quantity,
            'supplier_total_price' => $this->supplier_total_price,
            'total_price'          => $this->total_price,
            'created_at'           => $this->created_at,
            'updated_at'           => $this->updated_at,
            'created_by'           => $this->created_by,
            'updated_by'           => $this->updated_by,
        ]);
        $query->andFilterWhere([
            'like',
            'currency_unit',
            $this->currency_unit,
        ]);

        return $dataProvider;
    }
289277
public function buy($params = null)
    {
        $requestor = new Requestor($this->_apiKey);
        $url = $this->instanceUrl() . '/buy';

        list($response, $apiKey) = $requestor->request('post', $url, $params);
        $this->refreshFrom($response, $apiKey, true);

        return $this;
    }
1331523
public function export(array $params = array()) {
		$result = array(
			'type' => 'list',
			'count' => $this->getCount(),
			'limit' => elgg_extract('limit', $this->options, elgg_get_config('default_limit')),
			'offset' => elgg_extract('offset', $this->options, 0),
			'items' => array(),
		);

		$batch = $this->getBatch();
		foreach ($batch as $entity) {
			$result['items'][] = hypeApps()->graph->export($entity, $params);
		}

		return $result;
	}
328298
public function finish( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'items' ) );
		$this->setLocale( $params->site );

		$manager = $this->getManager();
		$indexManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.id', $params->items ) );
		$search->setSlice( 0, count( $params->items ) );

		foreach( $manager->searchItems( $search ) as $item ) {
			$indexManager->saveItem( $item, false );
		}

		$this->clearCache( (array) $params->items );

		return array(
			'success' => true,
		);
	}
79216
public function search($params)
    {
        $query = Order::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'ref_by' => $this->ref_by,
            'created_by' => $this->created_by,
            'updated_by' => $this->updated_by,
        ]);

        $query->andFilterWhere(['like', 'status', $this->status])
            ->andFilterWhere(['like', 'payment_method', $this->payment_method])
            ->andFilterWhere(['like', 'note', $this->note])
            ->andFilterWhere(['like', 'include_vat', $this->include_vat])
            ->andFilterWhere(['like', 'customer_username', $this->customer_username])
            ->andFilterWhere(['like', 'customer_phone', $this->customer_phone])
            ->andFilterWhere(['like', 'customer_name', $this->customer_name])
            ->andFilterWhere(['like', 'customer_email', $this->customer_email])
            ->andFilterWhere(['like', 'customer_address', $this->customer_address])
            ->andFilterWhere(['like', 'customer_company', $this->customer_company])
            ->andFilterWhere(['like', 'customer_area', $this->customer_area])
            ->andFilterWhere(['like', 'customer_tax_number', $this->customer_tax_number])
            ->andFilterWhere(['like', 'real_value', $this->real_value])
            ->andFilterWhere(['like', 'discount_value', $this->discount_value])
            ->andFilterWhere(['like', 'total_price', $this->total_price])
            ->andFilterWhere(['like', 'created_at', $this->created_at])
            ->andFilterWhere(['like', 'updated_at', $this->created_at]);

        return $dataProvider;
    }
1084031
public function search($params)
    {
        $query = static::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'pid' => $this->pid,
            'sort_order' => $this->sort_order,
            'status' => $this->status,
        ]);

        $query->andFilterWhere(['like', 'label', $this->label])
            ->andFilterWhere(['like', 'url', $this->url])
            ->andFilterWhere(['like', 'content', $this->content]);

        return $dataProvider;
    }
562926
public function select($params/*, ...*/)
    {
        $rel = $this->currentOrClone();
        
        $params = func_get_args();
        if (is_array($params[0])) {
            $params = array_shift($params);
        }
        $rel->select->columns($params);
        return $rel;
    }
806872
public function search($params)
    {
        $query = Article::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        if ($this->created_at !== null) {
            $date = strtotime($this->created_at);
            $query->andFilterWhere(['between', 'created_at', $date, $date + 3600 * 24]);
        }


        if ($this->updated_at !== null) {
            $date = strtotime($this->updated_at);
            $query->andFilterWhere(['between', 'updated_at', $date, $date + 3600 * 24]);
        }

        if ($this->published_at !== null) {
            $date = strtotime($this->published_at);
            $query->andFilterWhere(['between', 'published_at', $date, $date + 3600 * 24]);
        }


        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'status' => $this->status,
            'comments' => $this->comments,
            'views' => $this->views,
            'supports' => $this->supports,
            'collections' => $this->collections,
            'is_top' => $this->is_top,
            'is_best' => $this->is_best,
            'user_id' => $this->user_id,
        ]);

        $query->andFilterWhere(['like', 'title', $this->title]);

        return $dataProvider;
    }