Get all the addresses informations from their ID
@param unknown $idList
341975
private function getAddressesInfoFromIdHA($idList = array(), $optionsPagination = array())
    {
        $addressesInformations = array();
        if (!empty($idList)) {
            $i=0;
            $nbElt=count($idList);
            $arrayAdresse = array();
            foreach ($idList as $id) {
                //If the idHistoAdresse is set, it's an address
                if (isset($id ['idHistoriqueAdresse']) && $id ['idHistoriqueAdresse'] != '') {
                    $req = "
					SELECT ha.nom ,
					ha.idHistoriqueAdresse ,
					ha.idAdresse ,
					ae.idEvenement as idEvenementGroupeAdresse

    				FROM historiqueAdresse ha
					LEFT JOIN _adresseEvenement ae on ae.idAdresse = ha.idAdresse
    				WHERE ha.idAdresse =" . $id ['idAdresse'] . "
    				and ae.idEvenement = " . $id ['idEvenementGroupeAdresse'] . "
    				GROUP BY ha.idHistoriqueAdresse
							";
                    $res = $this->connexionBdd->requete($req);
                    $row = mysql_fetch_assoc($res);


                    //Sometimes addresses and goup event are strangely not linked between each other so double check
                    if (empty($row)) {
                        $req = "
							SELECT ha.nom ,
							ha.idHistoriqueAdresse ,
							ha.idAdresse ,
							ae.idEvenement as idEvenementGroupeAdresse

		    				FROM historiqueAdresse ha
							LEFT JOIN _adresseEvenement ae on ae.idAdresse = ha.idAdresse
		    				WHERE ae.idEvenement = " . $id ['idEvenementGroupeAdresse'] . "
		    				GROUP BY ha.idHistoriqueAdresse
							";
                        $res = $this->connexionBdd->requete($req);
                        $row = mysql_fetch_assoc($res);
                    }

                    $arrayAdresse [] = $row;
                } //Else it's a person
                else {
                    $req = "
					SELECT p.nom ,
					p.prenom,
					p.idPersonne,
					m.nom as nomMetier,
					ep.idEvenement as idEvenementGroupeAdresse

    				FROM personne p
					LEFT JOIN _personneEvenement ep on ep.idPersonne = p.idPersonne
					LEFT JOIN metier m on m.idMetier = p.idMetier
    				WHERE p.idPersonne = " . $id ['idPersonne'] . "
							";

                    $res = $this->connexionBdd->requete($req);
                    $row = mysql_fetch_assoc($res);
                    $nom = $row['prenom'].' ' .$row['nom'];
                    $personne['nom']=$nom;
                    $personne['idPersonne']=$row['idPersonne'];
                    $personne['idEvenementGroupeAdresse']=$row['idEvenementGroupeAdresse'];
                    $personne['titresEvenements'][0]="<a href=\"".$this->creerUrl('', 'evenementListe', array('selection'=>'personne','id' => $row['idPersonne']))."\">".ucfirst($row['nomMetier'])."</a>";
                    $personne['titre']='';
                    $arrayAdresse [] = $personne;
                }
            }


            /*
			 * Previous request
			 */
            //Processing all the adresses get from the request : getting address title and link to the events linked

            foreach ($arrayAdresse as $fetch) {
                $evenement = new archiEvenement();
                $idTitre = $evenement->getIdEvenementTitre($fetch);
                $requeteTitreLegacy ="SELECT titre from evenements where idEvenement = $idTitre";
                $resTitreLegacy = $this->connexionBdd->requete($requeteTitreLegacy);
                $arrayTitre = mysql_fetch_assoc($resTitreLegacy);

                if (isset($fetch['idEvenementGroupeAdresse']) &&$fetch['idEvenementGroupeAdresse']!='') {
                    if (!isset($arrayTitre['titre']) || $arrayTitre['titre'] == '' || empty($arrayTitre['titre'])) {
                        $titreRequest = "
							SELECT evt2.titre
							FROM evenements evt , evenements evt2
							WHERE evt.idEvenement = ".$fetch['idEvenementGroupeAdresse']."
							AND evt2.idEvenement = evt.idEvenementRecuperationTitre
							";
                        $resTitre = $this->connexionBdd->requete($titreRequest);
                        $arrayTitre = mysql_fetch_assoc($resTitre);
                        if (!isset($arrayTitre['titre']) || $arrayTitre['titre'] == '' || empty($arrayTitre['titre'])) {
                            $requeteAutreTitre ="
								SELECT evt.titre
								FROM evenements evt
								LEFT JOIN _evenementEvenement ee on ee.idEvenementAssocie = evt.idEvenement
								WHERE ee.idEvenement = ".$fetch['idEvenementGroupeAdresse']."
								";
                            $resultAutreTitre = $this->connexionBdd->requete($requeteAutreTitre);
                            if (mysql_num_rows($resultAutreTitre)==1) { //Si il n'y a qu'un résultat...
                                $arrayTitre = mysql_fetch_assoc($resultAutreTitre);
                            }
                        }
                    }
                    $fetch ['titre'] = stripslashes($arrayTitre ['titre']);

                    $reqTitresEvenements ="
						SELECT  distinct he1.titre,he1.idEvenement
	    				FROM evenements he1
						LEFT JOIN _evenementEvenement ee on ee.idEvenementAssocie = he1.idEvenement
						LEFT JOIN _adresseEvenement ae on ae.idEvenement = ee.idEvenement
						LEFT JOIN historiqueAdresse ha on ha.idAdresse = ae.idAdresse
						WHERE ee.idEvenement = ".$fetch['idEvenementGroupeAdresse']."
						AND TRIM(he1.titre) <> ''
							";

                    $resTitresEvenements = $this->connexionBdd->requete($reqTitresEvenements);
                    $titresEvenements = array();
                    $positionAncre=0;
                    $defaultEventTitle= "Événement sans titre";

                    //Generating all the link to the events linked to current address
                    while ($row = mysql_fetch_assoc($resTitresEvenements)) {
                        $titre = ($row['titre']=="") ? $defaultEventTitle : ucfirst($row['titre']); //Assigning default title to event which doesn't have one
                        //Link creation with the ancre to each event
                        $titresEvenements[] =
                        "<a href='".
                        $this->creerUrl(
                            '',
                            'adresseDetail',
                            array(
                                        'archiIdAdresse'=>$fetch['idAdresse'],
                                        'archiIdEvenementGroupeAdresse'=>$fetch['idEvenementGroupeAdresse'],
                                        'debut'=>'')
                        )
                        ."#evenement".$row['idEvenement']."'>"
                        .stripslashes($titre).
                        "</a>";
                    }
                    //Putting all this in a nice array
                    if (isset($fetch['idHistoriqueAdresse']) && $fetch['idHistoriqueAdresse']!='') {
                        $fetch['titresEvenements'] = $titresEvenements;
                    }
                    $addressesInformations[]=$fetch;
                    $positionAncre++;
                } else {
                    $this->messages->addError("Problème dans la recherche");
                    $this->messages->display();
                    return null;
                }
            }
        }
        return $addressesInformations;
    }
586355
public static function get_userids_from_context(\core_privacy\local\request\userlist $userlist) {
        $context = $userlist->get_context();
        if ($context->contextlevel != CONTEXT_MODULE) {
            return;
        }
        comments_provider::get_users_in_context_from_sql($userlist, 'c', 'assignsubmission_comments', 'submission_comments',
                $context->id);
    }
927289
public function fromArray( array $list )
	{
		$unknown = array();
		$list = parent::fromArray( $list );

		foreach( $list as $key => $value )
		{
			switch( $key )
			{
				case 'order.base.address.baseid': $this->setBaseId( $value ); break;
				case 'order.base.address.addressid': $this->setAddressId( $value ); break;
				case 'order.base.address.type': $this->setType( $value ); break;
				default: $unknown[$key] = $value;
			}
		}

		return $unknown;
	}
1299578
public function setByIDList($idList)
    {
        $has = [];

        // Index current data
        foreach ($this->column() as $id) {
            $has[$id] = true;
        }

        // Keep track of items to delete
        $itemsToDelete = $has;

        // add items in the list
        // $id is the database ID of the record
        if ($idList) {
            foreach ($idList as $id) {
                unset($itemsToDelete[$id]);
                if ($id && !isset($has[$id])) {
                    $this->add($id);
                }
            }
        }

        // Remove any items that haven't been mentioned
        $this->removeMany(array_keys($itemsToDelete));
    }
352999
def getaddresses(fieldvalues):
    """"""
    all = COMMASPACE.join(fieldvalues)
    a = _AddressList(all)
    return a.addresslist
676403
def GetIPAddresses(self):
    """"""
    results = []
    for address in self.addresses:
      human_readable_address = address.human_readable_address
      if human_readable_address is not None:
        results.append(human_readable_address)

    return results
1212804
public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
    {
        $builder = $this->connection->createQueryBuilder()
            ->select('value, COUNT(value) as mm_count')
            ->from($this->getValueTable())
            ->andWhere('att_id = :att_id')
            ->setParameter('att_id', $this->get('id'))
            ->groupBy('value');


        if ($idList) {
            $builder
                ->andWhere('item_id IN (:id_list)')

                ->orderBy('FIELD(id,:id_list)')
                ->setParameter('id_list', $idList, Connection::PARAM_INT_ARRAY);
        }

        $statement = $builder->execute();

        $arrResult = array();
        while ($objRow = $statement->fetch(\PDO::FETCH_OBJ)) {
            $strValue = $objRow->value;

            if (is_array($arrCount)) {
                $arrCount[$strValue] = $objRow->mm_count;
            }

            $arrResult[$strValue] = $strValue;
        }

        return $arrResult;
    }
956787
protected function getIDListFromDB() : array
    {
            if ($this->sValue == OfferListStore::SORT_PRICE_ASC) {
                $arElementIDList = $this->getByPriceASC();
            } elseif ($this->sValue == OfferListStore::SORT_PRICE_DESC) {
                $arElementIDList = $this->getByPriceDESC();
            } elseif ($this->sValue == OfferListStore::SORT_NEW) {
                $arElementIDList = $this->getNewOfferList();
            } elseif ($this->sValue == OfferListStore::SORT_NO) {
                $arElementIDList = $this->getOfferList();
            } elseif (preg_match('%^'.OfferListStore::SORT_PRICE_ASC.'\|.+%', $this->sValue)) {
                $arElementIDList = $this->getByPriceTypeASC();
            } elseif (preg_match('%^'.OfferListStore::SORT_PRICE_DESC.'\|.+%', $this->sValue)) {
                $arElementIDList = $this->getByPriceTypeDESC();
            } else {
                $arElementIDList = $this->getCustomSortingList();
            }

        return $arElementIDList;
    }
1014597
protected function getIpAddresses() {
        if (!$this->_ipAddresses) {
            $this->_ipAddresses = new IpAddressList(
                $this->version,
                $this->solution['accountSid'],
                $this->solution['sid']
            );
        }

        return $this->_ipAddresses;
    }
1279008
public function getDocuments(array $idList, $callable = null)
    {
        $idListToFindDirectly = $idList;

        // try to egt document from pool if enabled
        $documentsInDocumentPool = array();
        if ($this->isDocumentPoolEnabled() && !$callable) {
            $documentsInDocumentPool = $this->getDocumentsFromDocumentPool($idList);
            if (count($documentsInDocumentPool) === count($idList)) {
                return $documentsInDocumentPool;
            }

            // skip ids already found in pool
            $idListToFindDirectly = array_diff_key(
                array_map('strval', $idList),
                array_keys($documentsInDocumentPool)
            );
        }

        // get documents directly
        $cursor = $this->find();

        if (is_callable($callable)) {
            call_user_func($callable, $cursor);
        }

        $documentsGettingDirectly = $cursor->byIdList($idListToFindDirectly)->findAll();
        if (empty($documentsGettingDirectly)) {
            return $documentsInDocumentPool ? $documentsInDocumentPool : array();
        }

        if ($this->isDocumentPoolEnabled()) {
            $this->addDocumentsToDocumentPool($documentsGettingDirectly);
        }

        return $documentsGettingDirectly + $documentsInDocumentPool;
    }
814541
public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
    {
        if (!$this->isFilterOptionRetrievingPossible($idList)) {
            return [];
        }

        $idColumn = $this->getIdColumn();
        $builder  = $this->getConnection()->createQueryBuilder();
        $builder
            ->setParameter('attId', $this->get('id'))
            ->from($this->getTagSource(), 'v')
            ->leftJoin(
                'v',
                'tl_metamodel_tag_relation',
                'r',
                '(r.att_id=:attId) AND (r.value_id=v.' . $idColumn . ')'
            )
            ->groupBy('v.' . $idColumn)
            ->orderBy('v.' . $this->getSortingColumn());

        if ($usedOnly) {
            $builder->select('COUNT(v.' . $idColumn . ') AS mm_count');
            if (!empty($idList)) {
                $builder
                    ->where('r.item_id IN (:valueIds)')
                    ->setParameter('valueIds', $idList, Connection::PARAM_STR_ARRAY);
            }
        } else {
            $builder->select('COUNT(r.value_id) AS mm_count');
            if (!empty($idList)) {
                $builder
                    ->where('v.' . $idColumn . ' IN (:valueIds)')
                    ->setParameter('valueIds', $idList, Connection::PARAM_STR_ARRAY);
            }
        }
        $builder->addSelect('v.*');

        if ($additionalWhere = $this->getWhereColumn()) {
            $builder->andWhere($additionalWhere);
        }

        $aliasColumn = $this->getAliasColumn();
        $valueColumn = $this->getValueColumn();
        $result      = [];
        foreach ($builder->execute()->fetchAll(\PDO::FETCH_ASSOC) as $value) {
            if ($arrCount !== null) {
                $arrCount[$value[$aliasColumn]] = $value['mm_count'];
            }
            $result[$value[$aliasColumn]] = $value[$valueColumn];
        }

        return $result;
    }
1062466
static function isUserIPInList( $ipList )
    {
        $ipAddress = eZSys::clientIP();
        if ( $ipAddress )
        {
            $result = false;
            foreach( $ipList as $itemToMatch )
            {
                if ( preg_match("/^(([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+))(\/([0-9]+)$|$)/", $itemToMatch, $matches ) )
                {
                    if ( $matches[6] )
                    {
                        if ( eZDebug::isIPInNet( $ipAddress, $matches[1], $matches[7] ) )
                        {
                            $result = true;
                            break;
                        }
                    }
                    else
                    {
                        if ( $matches[1] == $ipAddress )
                        {
                            $result = true;
                            break;
                        }
                    }
                }
            }
        }
        else
        {
            $result = (
                in_array( 'commandline', $ipList ) &&
                ( php_sapi_name() == 'cli' )
            );
        }
        return $result;
    }
827800
protected function listQueryParams(array $list)
    {
        $result = [];
        $params = $this->getRequest()->getQueryParams();
        
        foreach ($list as $key => $value) {
            if (is_int($key)) {
                $key = $value;
                $value = null;
            }
            
            $result[] = isset($params[$key]) ? $params[$key] : $value;
        }
        
        return $result;
    }
880632
public static function &GetListForIds($aIdList, $iLanguageId = null)
    {
        $aIdList = TTools::MysqlRealEscapeArray($aIdList);
        $sQuery = self::GetDefaultQuery($iLanguageId, "`id` IN ('".implode("', '", $aIdList)."') ");

        return TdbShopModuleArticlelistOrderbyList::GetList($sQuery, $iLanguageId);
    }
1098494
public function getIDList()
    {
        // Get a list of IDs of our current items - if it's not a number then object then assume it's a DO.
        $ids = array_map(function ($obj) {
            return is_numeric($obj) ? $obj : $obj->ID;
        }, $this->items);

        // Strip out duplicates and anything resolving to False.
        $ids = array_filter(array_unique($ids));

        // Change the array from (1, 2, 3) to (1 => 1, 2 => 2, 3 => 3)
        if ($ids) {
            $ids = array_combine($ids, $ids);
        }

        return $ids;
    }
557154
public function setIdObjectsAlertList(array $idObjectsAlertList)
    {
        $this->idObjectsAlertList = $idObjectsAlertList;
        self::logInfo($this->translate("Objects subject to an alert") . " : \r\n");
        self::logInfo(print_r($idObjectsAlertList, true));
    }
51283
public function setIds(array $ids)
    {
        $this->ids = [];
        $this->idsAsAddresses = [];
        foreach ($ids as $id) {
            $this->idsAsAddresses[] = new Address($id);
            $this->ids[] = $id;
        }
    }