本文整理汇总了PHP中AppModel::afterFind方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::afterFind方法的具体用法?PHP AppModel::afterFind怎么用?PHP AppModel::afterFind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::afterFind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterFind
public function afterFind($results, $primary = false)
{
parent::afterFind($results, $primary);
if (Router::getParam('action') !== 'editar') {
return $this->formatDateFields($results, $this->datesToLoad, "%a - %d/%m/%Y %H:%M");
}
}
示例2: afterFind
/**
* After find callback
*
* @param array
* @param boolean
* @return array
*/
public function afterFind($results = array(), $primary = null)
{
for ($i = 0; $i < count($results); $i++) {
// the 'put the icon html here' part of that if statement is temporary and can be removed soon 9/6/2013 RK
$results[$i][$this->alias]['icon'] = !empty($results[$i][$this->alias]['icon']) && $results[$i][$this->alias]['icon'] != 'put the icon html here' ? $results[$i][$this->alias]['icon'] : $this->dummyfield('icon');
}
return parent::afterFind($results, $primary);
}
示例3: afterFind
public function afterFind($results, $primary = false)
{
parent::afterFind($results, $primary);
$format = ['Concluido' => 'Concluído', 'Atuando' => 'Téc. Atuando'];
foreach ($results as $key => $val) {
$results[$key][$this->alias]['status'] = isset($format[$val[$this->alias]['status']]) ? $format[$val[$this->alias]['status']] : $val[$this->alias]['status'];
}
return $results;
}
示例4: afterFind
/**
* Altera para texto a informação contida no campo ativo (0 = Não e 1 = Sim)
*
* {@inheritDoc}
*
* @see Model::afterFind()
*/
public function afterFind($results, $primary = false)
{
foreach ($results as $key => $value) {
if (isset($value['Sistema']['ativo'])) {
$results[$key]['Sistema']['ativoTexto'] = $results[$key]['Sistema']['ativo'] ? __('Sim') : __('Não');
}
}
return parent::afterFind($results, $primary);
}
示例5: afterFind
/**
* After getting data we add an extra field "url" to avoid extra arrays in the views and extra Routes resolution
**/
public function afterFind($results, $primary = false)
{
foreach ($results as $k => $result) {
if (isset($result[$this->alias]['slug'])) {
$results[$k][$this->alias]['url'] = '/' . $result[$this->alias]['slug'];
}
}
return parent::afterFind($results, $primary);
}
示例6: afterFind
public function afterFind($items, $primary = false)
{
parent::afterFind($items);
foreach ($items as $index => $item) {
if (isset($items[$index][$this->alias])) {
$items[$index][$this->alias]['url'] = DS . 'files' . DS . 'assets' . DS . $item[$this->alias]['folder'] . DS . 'original' . DS . $item[$this->alias]['id'] . '.' . $item[$this->alias]['extension'];
}
}
return $items;
}
示例7: afterFind
/**
* Encrypted Id and convert time format to 24 hour time format after find
* @param array $result data
* @param bool $primary
* @return array $result encrypted id
* @author Gaurav Bhandari
*/
public function afterFind($results, $primary = false)
{
$results = parent::afterFind($results);
foreach ($results as $key => $val) {
if (isset($val['Group']['meeting_time'])) {
$results[$key]['Group']['meeting_time'] = date("H:i", strtotime($val['Group']['meeting_time']));
}
}
return $results;
}
示例8: afterFind
public function afterFind($results, $primary = false)
{
parent::afterFind($results, $primary);
foreach ($results as $key => $val) {
if (isset($val[$this->alias]['fees'])) {
$results[$key][$this->alias]['fees'] = unserialize($val[$this->alias]['fees']);
}
}
return $results;
}
示例9: afterFind
function afterFind($results, $primary = false)
{
parent::afterFind($results, $primary);
foreach ($results as $k => $auditorBranch) {
if (!empty($auditorBranch['AuditorFirmHO']['id'])) {
$results[$k]['AuditorBranch']['auditor_branch_name'] .= ' (HO)';
}
}
return $results;
}
示例10: afterFind
public function afterFind($results, $primary = false)
{
parent::afterFind($results, $primary);
foreach ($results as $key => $value) {
if (isset($value[$this->alias]['payment_date'])) {
$results[$key][$this->alias]['payment_date'] = $this->formatPaypalDateToDate($value[$this->alias]['payment_date']);
}
}
return $results;
}
示例11: afterFind
/**
* Encrypted Id after find and upper case first letter of profession name
* @param array $results data
* @param bool $primary
* @return array $result encrypted id
* @author Priti Kabra
*/
public function afterFind($results, $primary = false)
{
$results = parent::afterFind($results);
foreach ($results as $key => $val) {
if (isset($val['ProfessionCategory']['name'])) {
$results[$key]['ProfessionCategory']['name'] = ucfirst($val['ProfessionCategory']['name']);
}
}
return $results;
}
示例12: afterFind
function afterFind($results, $primary = false)
{
$results = parent::afterFind($results, $primary);
//var_dump($results);
foreach ($results as $key => $val) {
$results[$key]['Profile']['fullname'] = $results[$key]['Profile']['firstname'] . ' ' . $results[$key]['Profile']['lastname'];
}
//$results['Patient']['patient_number'] = strtoupper($results['Patient']['patient_number']);
//var_dump($results);
return $results;
}
示例13: afterFind
function afterFind($results, $primary)
{
$results = parent::afterFind($results, $primary);
if (!$primary) {
$return = $this->behaviorsTrigger($this, 'assocAfterFind', array($results, $primary), array('modParams' => true));
if ($return !== true) {
$results = $return;
}
}
return $results;
}
示例14: afterFind
function afterFind($results, $primary = false)
{
$results = parent::afterFind($results, $primary);
//var_dump($results);
foreach ($results as $key => $val) {
if (isset($val['Patient']['patient_number'])) {
$results[$key]['Patient']['patient_number'] = strtoupper($val['Patient']['patient_number']);
}
}
//$results['Patient']['patient_number'] = strtoupper($results['Patient']['patient_number']);
return $results;
}
示例15: afterFind
public function afterFind($results, $primary = false)
{
Configure::write('debug', 2);
App::uses("CakeTime", "Utility");
$gc = new CakeTime();
parent::afterFind($results, $primary);
if (isset($results[0]['Order']['timestamp'])) {
foreach ($results as $key => $val) {
$results[$key]['Order']['created'] = $gc->timeAgoInWords($results[$key]['Order']['timestamp']);
}
}
return $results;
}