Get the id of a neighborhood from the id of a street

@param int $idSousQuartier : id of the sub neighborhood
@return int  $idQuartier :  id of the neighborhood (or null if error occurs)
431479
public function getIdQuartier($idSousQuartier)
    {
        $idQuartier = null;
        if (!isset($idSousQuartier) && $idSousQuartier != '') {
            echo "Error while getting neighborhood id, no sub neighborhood informations were specified for this request.";
        } else {
            $req = "
    				SELECT idQuartier
    				FROM sousQuartier
    				WHERE idSousQuartier = ".$idSousQuartier."
    				";
            $res = $this->connexionBdd->requete($req);
            $fetchQuartier = mysql_fetch_assoc($res);
            $idQuartier = $fetchQuartier['idQuartier'];
        }
        return $idQuartier;
    }
1164786
public static IdDt of(IBaseResource theResouce) {
		if (theResouce == null) {
			throw new NullPointerException("theResource can not be null");
		}
		IIdType retVal = theResouce.getIdElement();
		if (retVal == null) {
			return null;
		} else if (retVal instanceof IdDt) {
			return (IdDt) retVal;
		} else {
			return new IdDt(retVal.getValue());
		}
	}
112076
private function getCityName($id,$type){
		switch($type){
			case 'quartier':
				$requete = "
						SELECT v.nom
						FROM ville v
						LEFT JOIN quartier q on q.idVille = v.idVille
						WHERE q.idQuartier = $id 
						";
				break;
			case 'sousQuartier':
				$requete = "
						SELECT v.nom
						FROM ville v
						LEFT JOIN quartier q on q.idVille = v.idVille
						LEFT JOIN sousQuartier sq on sq.idQuartier = q.idQuartier
						WHERE sq.idSousQuartier = $id
						";
				break;
			case 'rue':
				$requete = "
						SELECT v.nom
						FROM ville v
						LEFT JOIN quartier q on q.idVille = v.idVille
						LEFT JOIN sousQuartier sq on sq.idQuartier = q.idQuartier
						LEFT JOIN rue r on r.idSousQuartier = sq.idSousQuartier
						WHERE r.idRue = $id
						";
				break;
			default:
				return false;
		}
		$result = $this->connexionBdd->requete($requete);
		$row = mysql_fetch_assoc($result);
		return $row['nom'];
	}
898887
public function getUrlImageFromQuartier($idQuartier, $format = 'mini')
    {
        $url="";

        switch ($format) {
            case 'mini':
                $chemin = $this->getUrlImage("mini");
                break;
            case 'moyen':
                $chemin = $this->getUrlImage("moyen");
                break;
            case 'grand':
                $chemin = $this->getUrlImage("grand");
                break;
        }



        $queryQuartier = "
				SELECT idRue
				FROM rue
				WHERE idSousQuartier in(SELECT idSousQuartier FROM sousQuartier WHERE idQuartier='".$idQuartier."' )";

        $resQuartier = $this->connexionBdd->requete($queryQuartier);
        $arrayRues=array();
        while ($fetchQuartier = mysql_fetch_assoc($resQuartier)) {
            $arrayRues[] = $fetchQuartier['idRue'];
        }


        $queryAdresse = "
				SELECT hi.idHistoriqueImage as idHistoriqueImage , hi.idImage as idImage, hi.nom as nom , hi.dateUpload as dateUpload , hi.dateCliche as dateCliche
				FROM historiqueImage hi2, historiqueImage hi
				RIGHT JOIN _adresseImage ai ON ai.idImage = hi.idImage
				WHERE ai.idAdresse in (select idAdresse FROM historiqueAdresse where idRue in ('".implode("','", $arrayRues)."'))
						AND hi2.idImage = hi.idImage
						GROUP BY hi.idImage, hi.idHistoriqueImage
						HAVING hi.idHistoriqueImage = max(hi2.idHistoriqueImage)
						LIMIT 1
						";

        $resAdresse = $this->connexionBdd->requete($queryAdresse);
        $string = new stringObject();
        if (mysql_num_rows($resAdresse)==1) {
            $fetchAdresse = mysql_fetch_assoc($resAdresse);
            //$url = $chemin.$fetchAdresse['dateUpload'].'/'.$fetchAdresse['idHistoriqueImage'].".jpg";
            $intituleAdresse = $this->getIntituleAdresseFrom($idQuartier, 'idQuartier', array('debug'=>true,'noQuartier'=>false,'noSousQuartier'=>true,'styleCSSTitreAdresse'=>'font-weight:bold;font-size:9px;','displayFirstTitreAdresse'=>true,'setSeparatorAfterTitle'=>'_'));
            $url = 'photos-'.$string->convertStringToUrlRewrite($intituleAdresse).'-'.$fetchAdresse['dateUpload'].'-'.$fetchAdresse['idHistoriqueImage'].'-'.$format.'.jpg';
        } else {
            // on recherche une image appartenant a un evenement de l'adresse
            // recherche des evenements de l'adresse:
            //$queryEvenements ="SELECT idEvenement FROM _adresseEvenement WHERE idAdresse = '".$idAdresse."'";

            $queryEvenements="
					SELECT ae.idEvenement as idEvenement
					FROM historiqueAdresse ha2, historiqueAdresse ha
					RIGHT JOIN _adresseEvenement ae ON ae.idAdresse = ha.idAdresse
					WHERE ha2.idAdresse = ha.idAdresse
					AND ha.idRue in ('".implode("','", $arrayRues)."')
							GROUP BY ha.idAdresse , ha.idHistoriqueAdresse
							HAVING ha.idHistoriqueAdresse = max(ha2.idHistoriqueAdresse)
							";


            //echo $queryEvenements."<br>";
            $resEvenements = $this->connexionBdd->requete($queryEvenements);
            $arrayListeEvenementsGroupeAdresse=array();
            while ($fetchEvenement = mysql_fetch_assoc($resEvenements)) {
                $arrayListeEvenementsGroupeAdresse[] = $fetchEvenement['idEvenement'];
            }

            if (count($arrayListeEvenementsGroupeAdresse)>0) {
            // on recherche les evenements du groupe d'adresses
                $listeEvenementsGroupeAdresse = implode("','", $arrayListeEvenementsGroupeAdresse);
                $queryEvenementAssocies = "
						SELECT idEvenementAssocie FROM _evenementEvenement WHERE idEvenement in ('".$listeEvenementsGroupeAdresse."')
								";

                $resEvenementsAssocies = $this->connexionBdd->requete($queryEvenementAssocies);

                $arrayListeEvenementsAssocies=array();
                while ($fetchEvenementsAssocies = mysql_fetch_assoc($resEvenementsAssocies)) {
                    $arrayListeEvenementsAssocies[] = $fetchEvenementsAssocies['idEvenementAssocie'];
                }

                $listeEvenementsAssocies = implode("','", $arrayListeEvenementsAssocies);

                $queryImage = " SELECT hi.idImage as idImage , hi.idHistoriqueImage as idHistoriqueImage, hi.dateUpload as dateUpload
						FROM historiqueImage hi2, historiqueImage hi
						RIGHT JOIN _evenementImage ei ON ei.idImage = hi.idImage
						WHERE ei.idEvenement in ('".$listeEvenementsAssocies."')
								AND hi2.idImage = hi.idImage
								GROUP BY hi.idImage , hi.idHistoriqueImage
								HAVING hi.idHistoriqueImage = max(hi2.idHistoriqueImage)
								LIMIT 1
								"; // on limit a 1 sinon cela peut prendre du temps

                $resImage = $this->connexionBdd->requete($queryImage);
                if (mysql_num_rows($resImage)>0) {
                    $fetchImage = mysql_fetch_assoc($resImage);

                    $intituleAdresse = $this->getIntituleAdresseFrom($idQuartier, 'idQuartier', array('debug'=>true,'noQuartier'=>false,'noSousQuartier'=>true,'styleCSSTitreAdresse'=>'font-weight:bold;font-size:9px;','displayFirstTitreAdresse'=>true,'setSeparatorAfterTitle'=>'_'));
                    $url = 'photos-'.$string->convertStringToUrlRewrite($intituleAdresse).'-'.$fetchImage['dateUpload'].'-'.$fetchImage['idHistoriqueImage'].'-'.$format.'.jpg';


                    //$url = $chemin.$fetchImage['dateUpload'].'/'.$fetchImage['idHistoriqueImage'].".jpg";
                }
            }
        }
        return $url;
    }
193218
protected function getAbstractId($id)
    {
        if (isset($this->aliases[$id])) {
            $id = $this->aliases[$id];
        }

        return $id;
    }
171014
public function getIdentifier()
    {
        $identifierAttribute = $this->getFamily()->getAttributeAsIdentifier();
        if ($identifierAttribute) {
            /** @noinspection ExceptionsAnnotatingAndHandlingInspection */

            return $this->get($identifierAttribute->getCode());
        }

        return $this->getId();
    }
154642
private Evse getEvseByIdentifier(ChargingStationType chargingStationType, int identifier) {
        for (Evse evse:chargingStationType.getEvses()) {
            if(identifier == evse.getIdentifier()) {
                return evse;
            }
        }
        return null;
    }
146660
function getId(record) {
    Validate.isObject(record);
    Validate.notNull(record);

    for (var property in record) {
        if (property.toLowerCase() === idPropertyName.toLowerCase()) {
            return record[property];
        }
    }
}
1155928
public static function get_unused_idnumber($idnumber) {
        global $DB;

        $currentidnumber = $idnumber;
        $counter = 0;
        // Iteratere while the idnumber exists.
        while ($DB->record_exists_select(static::TABLE, 'idnumber = ?', array($currentidnumber))) {
            $suffixidnumber = '_' . ++$counter;
            $currentidnumber = substr($idnumber, 0, 100 - strlen($suffixidnumber)).$suffixidnumber;
        }

        // Return the uniq idnumber.
        return $currentidnumber;
    }
485231
public function getByIdentifier(Identifier $identifier)
    {
        $className = $identifier->class->getName();
        $mapId     = $identifier->getSerialized();

        return $this->identityMap[$className][$mapId];
    }
114298
public function getFilter(QueryBuilder $qb, $dqlAlias)
    {
        if (null !== $this->dqlAlias) {
            $dqlAlias = $this->dqlAlias;
        }

        return sprintf('%s INSTANCE OF %s', $dqlAlias, $this->value);
    }
534460
function get_identity($id = null)
    {
        $id = (int)$id;
        // cache identities for better performance
        if (!array_key_exists($id, $this->identities)) {
            $result = $this->list_identities($id ? "AND `identity_id` = $id" : '');
            $this->identities[$id] = $result[0];
        }

        return $this->identities[$id];
    }
768660
public function getGatewayCustomerId($uid)
    {
		$result = 0;
		$user   = $this->findUser( $uid );
		if (! is_null($user)) {
			$result = intval($user->getGatewayCustomerId());
		}

		return $result;
	}
524902
public static function getUniqueId($uriResource)
    {
        $returnValue = '';

        if (stripos($uriResource, "#") > 0) {
            $returnValue = substr($uriResource, stripos($uriResource, "#") + 1);
        }

        return $returnValue;
    }
1112423
@Override
	int getOldID() {
		int ID_ = getID();

		if (m_userOldestWkid != -1)
			return m_userOldestWkid;

		m_userOldestWkid = Wkid.wkid_to_old(ID_);

		if (m_userOldestWkid != -1)
			return m_userOldestWkid;

		return ID_;
	}
440105
public boolean[] getIssuerUniqueID() {
        if (info == null)
            return null;
        try {
            UniqueIdentity id = (UniqueIdentity)info.get(
                                 X509CertInfo.ISSUER_ID);
            if (id == null)
                return null;
            else
                return (id.getId());
        } catch (Exception e) {
            return null;
        }
    }
320806
public function retrieveById($identifier)
    {
        $userService = app()->make(UserService::class);
        $user = $userService->byId($identifier)->get();

        if (! $user) {
            return null;
        }

        return $user;
    }