当前位置: 首页>>代码示例>>PHP>>正文


PHP Organization::update方法代码示例

本文整理汇总了PHP中Organization::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Organization::update方法的具体用法?PHP Organization::update怎么用?PHP Organization::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Organization的用法示例。


在下文中一共展示了Organization::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionTestUpdateOrganization

 public function actionTestUpdateOrganization()
 {
     $organizationId = "55794e302336f240060041a8";
     $userId = "55c0c1a72336f213040041ee";
     $organization = array("name" => "Ekopratik");
     var_dump(Organization::update($organizationId, $organization, $userId));
 }
开发者ID:zourite,项目名称:communecter,代码行数:7,代码来源:TestController.php

示例2: InvalidArgumentException

         throw new InvalidArgumentException("organization state cannot be empty", 405);
     }
     if (empty($requestObject->orgType) === true) {
         throw new InvalidArgumentException("organization type cannot be empty", 405);
     }
     if (empty($requestObject->orgZip) === true) {
         throw new InvalidArgumentException("organization zip code cannot be empty", 405);
     }
     //perform the actual put or post
     if ($method === "PUT") {
         $organization = Organization::getOrganizationByOrgId($pdo, $id);
         if ($organization === null) {
             throw new RuntimeException("Organization does not exist", 404);
         }
         $organization = new Organization($id, $requestObject->orgAddress1, $requestObject->orgAddress2, $requestObject->orgCity, $requestObject->orgDescription, $requestObject->orgHours, $requestObject->orgName, $requestObject->orgPhone, $requestObject->orgState, $requestObject->orgType, $requestObject->orgZip);
         $organization->update($pdo);
         $reply->message = "Organization updated OK";
     } else {
         if ($method === "POST") {
             $organization = new Organization(null, $requestObject->orgAddress1, $requestObject->orgAddress2, $requestObject->orgCity, $requestObject->orgDescription, $requestObject->orgHours, $requestObject->orgName, $requestObject->orgPhone, $requestObject->orgState, $requestObject->orgType, $requestObject->orgZip);
             $organization->insert($pdo);
             $reply->message = "Organization created OK";
         }
     }
 } else {
     if ($method === "DELETE") {
         //verifyXsrf();
         $organization = Organization::getOrganizationByOrgId($pdo, $id);
         if ($organization === null) {
             throw new RuntimeException("Organization does not exist", 404);
         }
开发者ID:brbrown59,项目名称:bread-basket,代码行数:31,代码来源:index.php

示例3: testUpdateInvalidOrganization

 /**
  * test updating an organization that does not exist
  *
  * @expectedException PDOException
  */
 public function testUpdateInvalidOrganization()
 {
     //create an organization and try to update without inserting first
     $organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION, $this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);
     $organization->update($this->getPDO());
 }
开发者ID:brbrown59,项目名称:bread-basket,代码行数:11,代码来源:organization-test.php


注:本文中的Organization::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。