当前位置: 首页>>代码示例>>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;未经允许,请勿转载。