本文整理汇总了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));
}
示例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);
}
示例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());
}