當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Organization::getWhere方法代碼示例

本文整理匯總了PHP中Organization::getWhere方法的典型用法代碼示例。如果您正苦於以下問題:PHP Organization::getWhere方法的具體用法?PHP Organization::getWhere怎麽用?PHP Organization::getWhere使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Organization的用法示例。


在下文中一共展示了Organization::getWhere方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 public function run($insee = null)
 {
     $controller = $this->getController();
     $where = array("address.codeInsee" => $insee);
     $params["events"] = Event::getWhere($where);
     $params["organizations"] = Organization::getWhere($where);
     $params["people"] = Person::getWhere($where);
     $controller->render("directory", $params);
 }
開發者ID:CivicTechFR,項目名稱:PixelHumain,代碼行數:9,代碼來源:DirectoryAction.php

示例2: actionExportInitData

 /**
  * Export all data related to a person 
  * Generates a json file
  * and an image folder
  */
 public function actionExportInitData($id, $module)
 {
     if (isset(Yii::app()->session["userId"]) && $id == Yii::app()->session["userId"]) {
         $account = PHDB::findOne(PHType::TYPE_CITOYEN, array("_id" => new MongoId(Yii::app()->session["userId"])));
         if ($account) {
             /* **************************************
              * SETUP FILE SYSTEM
              ***************************************** */
             $suffixe = "";
             //"_".date('YmdHi')
             $base = 'upload' . DIRECTORY_SEPARATOR . 'export' . DIRECTORY_SEPARATOR . Yii::app()->session["userId"] . $suffixe . DIRECTORY_SEPARATOR;
             $upload_dir = $base . "assets" . DIRECTORY_SEPARATOR;
             if (!file_exists($upload_dir)) {
                 mkdir($upload_dir, 0775, true);
             }
             $upload_dir = $base;
             $account["_id"] = array('$oid' => (string) $account["_id"]);
             unset($account["_id"]['$id']);
             /* **************************************
              * CITOYENS MAP
              ***************************************** */
             $exportInitData = array(PHType::TYPE_CITOYEN => array($account));
             /* **************************************
              * ORGANIZATIONS MAP
              ***************************************** */
             $myOrganizations = Organization::getWhere(array("creator" => Yii::app()->session["userId"]));
             if ($myOrganizations) {
                 $exportInitData[Organization::COLLECTION] = array();
                 foreach ($myOrganizations as $key => $o) {
                     array_push($exportInitData[Organization::COLLECTION], $o);
                 }
             }
             /* **************************************
              * Events MAP
              ***************************************** */
             $myEvents = Event::getWhere(array("creator" => Yii::app()->session["userId"]));
             if ($myEvents) {
                 $exportInitData[Event::COLLECTION] = array();
                 foreach ($myEvents as $key => $e) {
                     array_push($exportInitData[Event::COLLECTION], $e);
                 }
             }
             /* **************************************
              * Documents MAP
              ***************************************** */
             $myDocs = Document::getWhere(array("creator" => Yii::app()->session["userId"]));
             if ($myDocs) {
                 $exportInitData[Document::COLLECTION] = array();
                 foreach ($myDocs as $key => $doc) {
                     array_push($exportInitData[Document::COLLECTION], $doc);
                     $src = "upload" . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $doc["type"] . DIRECTORY_SEPARATOR . $doc["id"] . DIRECTORY_SEPARATOR . $doc["name"];
                     $dest = $upload_dir . "assets" . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $doc["folder"] . DIRECTORY_SEPARATOR . $doc["name"];
                     if (file_exists($src)) {
                         if (!file_exists($upload_dir . "assets" . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $doc["folder"] . DIRECTORY_SEPARATOR)) {
                             mkdir($upload_dir . "assets" . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $doc["folder"] . DIRECTORY_SEPARATOR, 0775, true);
                         }
                         copy($src, $dest);
                     }
                 }
             }
             $res = json_encode($exportInitData);
             file_put_contents($upload_dir . Yii::app()->session["userId"] . ".json", $res, LOCK_EX);
             echo "<a href='" . Yii::app()->createUrl("/" . $upload_dir . Yii::app()->session["userId"] . ".json") . "' target='_blank'>See your Exported data</a>";
         } else {
             echo Rest::json(array("result" => false, "msg" => "Cette requete ne peut aboutir."));
         }
     } else {
         echo Rest::json(array("result" => false, "msg" => "Cette requete ne peut aboutir."));
     }
 }
開發者ID:zourite,項目名稱:communecter,代碼行數:75,代碼來源:DataController.php


注:本文中的Organization::getWhere方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。