本文整理汇总了PHP中Organization::getOrganizationByOrgCity方法的典型用法代码示例。如果您正苦于以下问题:PHP Organization::getOrganizationByOrgCity方法的具体用法?PHP Organization::getOrganizationByOrgCity怎么用?PHP Organization::getOrganizationByOrgCity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Organization
的用法示例。
在下文中一共展示了Organization::getOrganizationByOrgCity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter_input
$name = filter_input(INPUT_GET, "name", FILTER_SANITIZE_STRING);
$state = filter_input(INPUT_GET, "state", FILTER_SANITIZE_STRING);
$type = filter_input(INPUT_GET, "type", FILTER_SANITIZE_STRING);
$zip = filter_input(INPUT_GET, "zip", FILTER_SANITIZE_STRING);
$current = filter_input(INPUT_GET, "current", FILTER_SANITIZE_STRING);
//handle REST calls, while only allowing administrators access to database-modifying methods
//should already have checked if they're a volunteer, so another check here would be redundant
if ($method === "GET") {
//set XSRF cookie
setXsrfCookie("/");
//get the organization based on the given field
if (empty($id) === false) {
$reply->data = Organization::getOrganizationByOrgId($pdo, $id);
} else {
if (empty($city) === false) {
$reply->data = Organization::getOrganizationByOrgCity($pdo, $city)->toArray();
} else {
if (empty($name) === false) {
$reply->data = Organization::getOrganizationByOrgName($pdo, $name)->toArray();
} else {
if (empty($type) === false) {
$reply->data = Organization::getOrganizationByOrgType($pdo, $type)->toArray();
} else {
if (empty($zip) === false) {
$reply->data = Organization::getOrganizationByOrgZip($pdo, $zip)->toArray();
} else {
if (empty($current) === false) {
//used to fetch the current organization info for angular
$reply->data = Organization::getOrganizationByOrgId($pdo, $_SESSION["volunteer"]->getOrgId());
} else {
$reply->data = Organization::getAllOrganizations($pdo)->toArray();
示例2: testGetInvalidOrganizationByCity
/**
* test for grabbing an organization by city that does not exist
*/
public function testGetInvalidOrganizationByCity()
{
$organization = Organization::getOrganizationByOrgCity($this->getPDO(), "Atlantis");
$this->assertSame($organization->getSize(), 0);
}