Created
November 9, 2020 06:18
-
-
Save OlegShchavelev/2116b68d78c621e008c1c9f4fa9c54d4 to your computer and use it in GitHub Desktop.
getinfoblock.class.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class customTvssComboGetgetmseiProfileProcessor extends modObjectGetListProcessor | |
{ | |
public $classKey = 'infoBlockItem'; | |
//public $languageTopics = array('resource'); | |
public $defaultSortField = 'id'; | |
public $defaultSortDirection = 'ASC'; | |
/** | |
* @param xPDOQuery $c | |
* | |
* @return xPDOQuery | |
*/ | |
public function prepareQueryBeforeCount(xPDOQuery $c) | |
{ | |
if ($query = trim($this->getProperty('query'))) { | |
$c->where(array( | |
'id:LIKE' => "{$query}%", | |
'OR:name:LIKE' => "%{$query}%" | |
)); | |
} | |
return $c; | |
} | |
/** | |
* @param xPDOObject $obj | |
* | |
* @return array | |
*/ | |
public function prepareRow(xPDOObject $obj) | |
{ | |
$array = $obj->toArray(); | |
$data = array( | |
'display' => "<div><small>({$array['id']})</small> <b>{$array['name']}</b></div>", | |
'value' => $array['name'], | |
); | |
return $data; | |
} | |
} | |
return 'customTvssComboGetgetmseiProfileProcessor'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment