本文整理匯總了PHP中ControllerBase::listAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP ControllerBase::listAll方法的具體用法?PHP ControllerBase::listAll怎麽用?PHP ControllerBase::listAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ControllerBase
的用法示例。
在下文中一共展示了ControllerBase::listAll方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: listAll
/**
* @remotable
*/
public function listAll($a)
{
$return = parent::listAll($a);
if (!isset($return["items"])) {
return $return;
}
$items = $return["items"];
$user = $this->getSessionValue("contactID");
for ($i = 0; $i < count($items); $i++) {
$items[$i]["colorCode"] = $this->getUserColorCode($user);
}
$return["items"] = $items;
return $return;
}
示例2: listAll
/**
* @remotable
*/
public function listAll($a)
{
$return = parent::listAll($a);
if (!isset($return["items"])) {
return $return;
}
$items = $return["items"];
for ($i = 0; $i < count($items); $i++) {
$items[$i]["genderName"] = $items[$i]["gender"] == 1 ? "male" : "female";
$items[$i]["age"] = $this->calculateAge($items[$i]["birthDate"]);
}
$return["items"] = $items;
return $return;
}
示例3: listAll
/**
* @remotable
*/
public function listAll($a)
{
if (isset($a->dateNeeded)) {
$dateNeeded = $a->dateNeeded;
} else {
$dateNeeded = "null";
}
if ($this->getSessionValue('isDesktop') == 1) {
$prev = parent::listAll($a);
return $prev;
} else {
if ($dateNeeded == "null") {
//Current date
$currentDate = date("Y-m-d");
//Get week range from given date
$weekRange = $this->getWeekRange($currentDate, $start = true);
$weekRange = explode("|", $weekRange);
$startDate = $weekRange[0];
$endDate = $weekRange[1];
} else {
//Current date
$dateNeeded = explode("T", $dateNeeded);
//Get week range from given date
$currentDate = $dateNeeded[0];
//Get week range from given date
$weekRange = $this->getWeekRange($currentDate, $start = true);
$weekRange = explode("|", $weekRange);
$startDate = $weekRange[0];
$endDate = $weekRange[1];
}
$orgID = $this->getOrgID();
$query = "SELECT * FROM observ_detail AS obs\r\n\t\tWHERE obs.actDetailID IN\r\n (SELECT id FROM activity_detail where\r\n actDtlStime >= '{$startDate}' and\r\n actDtlEtime <= '{$endDate}' and orgId= {$orgID}\r\n )";
$q = Doctrine_Manager::getInstance()->getCurrentConnection();
$result = $q->execute($query);
$result = $result->fetchAll();
$total = sizeof($result);
$newRes = array();
foreach ($result as $key => $value) {
$newRes[] = $value;
}
$this->response['total'] = $total;
$this->response['success'] = true;
if ($this->response['total'] > 0) {
$this->response['items'] = $newRes;
} else {
$this->response['items'] = array();
}
return $this->response;
}
}