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