Retrieves all items matching the given criteria.

@param stdClass $params Associative array containing the parameters
@return array List of associative arrays with item properties, total number of items and success property
431657
public function searchItems( stdClass $params )
	{
		$total = 0;
		$search = $this->_initCriteria( $this->_getManager()->createSearch(), $params );

		$sort = $search->getSortations();
		$sort[] = $search->sort( '+', 'locale.currency.label' );
		$search->setSortations( $sort );

		$items = $this->_getManager()->searchItems( $search, array(), $total );

		return array(
			'items' => $this->_toArray( $items ),
			'total' => $total,
			'success' => true,
		);
	}
454685
public function moveItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'items', 'oldparentid', 'newparentid', 'refid' ) );

		$manager = $this->_getManager();

		if( $params->newparentid === 'root' ) {
			$params->newparentid = null;
		}

		$refId = ( isset( $params->refid ) ? $params->refid : null );
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry ) {
			$manager->moveItem( $entry, $params->oldparentid, $params->newparentid, $refId );
		}

		return array(
			'success' => true,
		);
	}
581778
public function search($params)
    {
        $query = Category::find()->joinWith('translations')->orderBy(['parent_id' => SORT_ASC, 'position' => SORT_ASC]);

        $this->load($params);

        // grid filtering conditions
        $query->andFilterWhere([
            'shop_category.parent_id' => $this->parent_id,
        ])->andFilterWhere(['like', 'shop_category_translation.title', $this->title
        ])->andFilterWhere(['shop_category.show' => $this->show]);


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


        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;
        }

        return $dataProvider;
    }
646631
public function searchItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site' ) );
		$this->_setLocale( $params->site );

		$total = 0;
		$search = $this->_initCriteria( $this->_getManager()->createSearch(), $params );

		if( isset( $params->domain ) && isset( $params->parentid ) )
		{
			$listManager = MShop_Factory::createManager( $this->_getContext(), $params->domain . '/list' );
			$criteria = $listManager->createSearch();

			$expr = array();
			$expr[] = $criteria->compare( '==', $params->domain . '.list.parentid', $params->parentid );
			$expr[] = $criteria->compare( '==', $params->domain . '.list.domain', 'price' );
			$criteria->setConditions( $criteria->combine( '&&', $expr ) );

			$result = $listManager->searchItems( $criteria );

			$ids = array();
			foreach( $result as $items ) {
				$ids[] = $items->getRefId();
			}

			$expr = array();
			$expr[] = $search->compare( '==', 'price.id', $ids );
			$expr[] = $search->getConditions();
			$search->setConditions( $search->combine( '&&', $expr ) );
		}

		$items = $this->_getManager()->searchItems( $search, array(), $total );

		return array(
			'items' => $this->_toArray( $items ),
			'total' => $total,
			'success' => true,
		);
	}
1017747
public function get($params = null) {
		$this->buffer = $this->getConfigs();

		if (isset($params)) {
			$params = trim($params);
			$params_list = explode('/', $params);
			$params_count = count($params_list);

			for ($i=0; $i<$params_count; $i++) {
				if ($i == $params_count) { return $this->buffer[$params_list[$i]]; }

				$this->buffer = $this->buffer[$params_list[$i]];
			}
		}

		return $this->buffer;
	}
1220823
public function search($params)
    {
        $searchResult = $this->getRequest()->request(
            'POST',
            $this->getRequestUrl('searches'),
            $this->getSearchQuery($params)
        );

        return $this->getInputsFromSearchResult($searchResult);
    }
1217471
public function searchItems( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site' ) );
		$this->setLocale( $params->site );

		$totalList = 0;
		$search = $this->initCriteria( $this->getManager()->createSearch(), $params );
		$result = $this->getManager()->searchItems( $search, [], $totalList );

		$idLists = [];
		$listItems = [];

		foreach( $result as $item )
		{
			if( ( $domain = $item->getDomain() ) != '' ) {
				$idLists[$domain][] = $item->getRefId();
			}
			$listItems[] = (object) $item->toArray( true );
		}

		return array(
			'items' => $listItems,
			'total' => $totalList,
			'graph' => $this->getDomainItems( $idLists ),
			'success' => true,
		);
	}
518867
public function insertItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$ids = array();
		$manager = $this->_getManager();

		$refId = ( isset( $params->refid ) ? $params->refid : null );
		$parentId = ( isset( $params->parentid ) ? $params->parentid : null );
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$manager->insertItem( $item, $parentId, $refId );

			$ids[] = $item->getId();
		}

		$this->_clearCache( $ids );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'catalog.id', $ids ) );
		$search->setSlice( 0, count( $ids ) );
		$items = $this->_toArray( $manager->searchItems( $search ) );

		return array(
			'items' => ( !is_array( $params->items ) ? reset( $items ) : $items ),
			'success' => true,
		);
	}
928210
public function all(array $params = array())
    {
        $endpoint = '/admin/themes.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Theme::class, $response['themes']);
    }
551826
public function deleteItems( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'items' ) );
		$this->setLocale( $params->site );

		$idList = [];
		$context = $this->getContext();
		$manager = \Aimeos\MShop\Factory::createManager( $context, 'media' );
		$cntl = \Aimeos\Controller\Common\Media\Factory::createController( $context );

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

		foreach( $manager->searchItems( $search ) as $id => $item )
		{
			$idList[$item->getDomain()][] = $id;
			$cntl->delete( $item );
		}

		$manager->deleteItems( (array) $params->items );


		foreach( $idList as $domain => $domainIds )
		{
			$manager = \Aimeos\MShop\Factory::createManager( $context, $domain . '/lists' );

			$search = $manager->createSearch();
			$expr = array(
				$search->compare( '==', $domain . '.lists.refid', $domainIds ),
				$search->compare( '==', $domain . '.lists.domain', 'media' )
			);
			$search->setConditions( $search->combine( '&&', $expr ) );
			$search->setSortations( array( $search->sort( '+', $domain . '.lists.id' ) ) );

			$start = 0;

			do
			{
				$result = $manager->searchItems( $search );
				$manager->deleteItems( array_keys( $result ) );

				$count = count( $result );
				$start += $count;
				$search->setSlice( $start );
			}
			while( $count >= $search->getSliceSize() );
		}


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

		return array(
			'success' => true,
		);
	}
1005515
public function search(array $params = array())
    {
        $endpoint = '/admin/gift_cards/search.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(GiftCard::class, $response['gift_cards']);
    }
1100927
public function getListeArchitectesProductifs($params=array())
	{
		$pagination = new paginationObject();
		$adresse = new archiAdresse();
		$nbEnregistrementsParPage=10;

		$sqlLimit="";

		$titre = "";
		if (isset($params['setTitre'])) {
			$titre = $params['setTitre']."<br><br>";
		}


		if (isset($params['sqlLimit'])) {
			$sqlLimit = $params['sqlLimit'];
		}
		$paginationHTML="";
		if (!isset($params['noPagination']) || $params['noPagination']==false) {
			$reqArchitectesCount = "
					SELECT  p.idPersonne, p.nom, p.prenom,  count(distinct ae.idAdresse) as nbAdresses
					FROM personne p
					LEFT JOIN personne p2 ON p2.idPersonne = p.idPersonne
					LEFT JOIN _evenementPersonne ep ON ep.idPersonne = p2.idPersonne
					LEFT JOIN _evenementEvenement ee ON ee.idEvenementAssocie = ep.idEvenement
					LEFT JOIN _adresseEvenement ae ON ae.idEvenement = ee.idEvenement
					WHERE ae.idAdresse IS NOT NULL
					GROUP BY p.idPersonne
					";

			$resArchitectesCount = $this->connexionBdd->requete($reqArchitectesCount);

			$arrayPagination=$pagination->pagination(
					array(
							'nomParamPageCourante'=>'archiPageCouranteArchitectes',
							'nbEnregistrementsParPage'=>$nbEnregistrementsParPage,
							'nbEnregistrementsTotaux'=>mysql_num_rows($resArchitectesCount),
							'typeLiens'=>'noformulaire'
					)
			);

			$sqlLimit = "LIMIT ".$arrayPagination['limitSqlDebut'].", ".$nbEnregistrementsParPage;
		}
		// liste des architectes
		$reqArchitectes = "
		SELECT  p.idPersonne, p.nom, p.prenom,  count(distinct ae.idAdresse) as nbAdresses
		FROM personne p
		LEFT JOIN personne p2 ON p2.idPersonne = p.idPersonne
		LEFT JOIN _evenementPersonne ep ON ep.idPersonne = p2.idPersonne
		LEFT JOIN _evenementEvenement ee ON ee.idEvenementAssocie = ep.idEvenement
		LEFT JOIN _adresseEvenement ae ON ae.idEvenement = ee.idEvenement
		WHERE ae.idAdresse IS NOT NULL
		GROUP BY p.idPersonne
		ORDER BY nbAdresses DESC
		$sqlLimit
		";

		$resArchitectes = $this->connexionBdd->requete($reqArchitectes);
		$tableau = new tableau();

		if (!isset($params['noPagination']) || $params['noPagination']==false) {
			$paginationHTML = $arrayPagination['html']."<br>";
		}


		while ($fetchArchitectes = mysql_fetch_assoc($resArchitectes)) {
			$tableau->addValue("<a href='".$this->creerUrl('', 'evenementListe', array('selection'=>'personne', 'id'=>$fetchArchitectes['idPersonne']))."'>".$fetchArchitectes['nom']." ".$fetchArchitectes['prenom']."</a>&nbsp;(".$fetchArchitectes['nbAdresses'].")");

			$tableau->addValue("<img src='".$adresse->getUrlImageFromPersonne($fetchArchitectes['idPersonne'], 'mini')."' alt=\"".$fetchArchitectes['nom']." ".$fetchArchitectes['prenom']."\" title=\"".$fetchArchitectes['nom']." ".$fetchArchitectes['prenom']."\" >");
		}

		return $titre.$paginationHTML.$tableau->createHtmlTableFromArray(2, "", "tableau");
	}
767209
public function saveItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$ids = array();
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$this->_manager->saveItem( $item );
			$ids[] = $item->getId();
		}

		$this->_clearCache( $ids );

		$search = $this->_manager->createSearch();
		$search->setConditions( $search->compare( '==', 'price.id', $ids ) );
		$search->setSlice( 0, count( $ids ) );
		$items = $this->_toArray( $this->_manager->searchItems( $search ) );

		return array(
			'items' => ( !is_array( $params->items ) ? reset( $items ) : $items ),
			'success' => true,
		);
	}
818398
public function deleteItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		foreach( (array) $params->items as $id ) {
			$this->_getManager()->deleteItem( $id );
		}

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

		return array(
			'items' => $params->items,
			'success' => true,
		);
	}
708897
public function fetchAll($params = [])
    {
        return $this->table->select(
            function (Select $select) {
                $select->columns([]);
                $select->join(
                    $this->roleTableName,
                    sprintf('%s.role_id=%s.role_id', $this->roleTableName, $this->table->getTable())
                );
                $select->where(['user_id' => $this->getUserId()]);
            }
        );

//        $adapter = new DbSelect($select, $this->table->getAdapter());
//        return new $this->collectionClass($adapter);
    }
1168313
public function searchItems( \stdClass $params )
	{
		$manager = $this->getManager();

		$total = 0;
		$search = $manager->createSearch();

		if( isset( $params->options->showall ) && $params->options->showall == false )
		{
			$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $this->getContext() );

			$langids = [];
			foreach( $localeManager->searchItems( $localeManager->createSearch() ) as $item ) {
				$langids[] = $item->getLanguageId();
			}

			if( !empty( $langids ) ) {
				$search->setConditions( $search->compare( '==', 'locale.language.id', $langids ) );
			}
		}

		$search = $this->initCriteria( $search, $params );

		$sort = $search->getSortations();
		$sort[] = $search->sort( '+', 'locale.language.label' );
		$search->setSortations( $sort );

		$items = $this->getManager()->searchItems( $search, [], $total );

		return array(
			'items' => $this->toArray( $items ),
			'total' => $total,
			'success' => true,
		);
	}
153025
public static function get($params = array())
	{
		$object = new static;
		$data   = $object->request('GET', $object->getUrl(), $params);
		$data   = $object->stripResponseData($data);

		// Initialise a collection
		$collection = self::newCollection();

		if (isset($data[0]) && is_array($data[0])) {
			// This should be a collection
			$collection->setItems($data);
		}

		return $collection;
	}