Пример #1
0
 public function map($filter = "", $sort = "", $blank = "")
 {
     $ret = new SQLMap(singleton('Group')->extendedSQL($filter, $sort));
     if ($blank) {
         $blankGroup = new Group();
         $blankGroup->Title = $blank;
         $blankGroup->ID = 0;
         $ret->getItems()->shift($blankGroup);
     }
     return $ret;
 }
 function search($request, $form)
 {
     // Get the results form to be rendered
     $query = $this->getSearchQuery(array_merge($form->getData(), $request));
     $resultMap = new SQLMap($query, $keyField = "ID", $titleField = "Title");
     $items = $resultMap->getItems();
     $array = array();
     if ($items && $items->count()) {
         foreach ($items as $item) {
             $array[] = $item->ID;
         }
     }
     Session::set("StoreAdminLatestSearch", serialize($array));
     return parent::search($request, $form);
 }
Пример #3
0
 /**
  * Get member SQLMap
  *
  * @param string $filter Filter for the SQL statement (WHERE clause)
  * @param string $sort Sorting function (ORDER clause)
  * @param string $blank Shift a blank member in the items
  * @return SQLMap Returns an SQLMap that returns all Member data.
  *
  * @todo Improve documentation of this function! (Markus)
  */
 public function map($filter = "", $sort = "", $blank = "")
 {
     $ret = new SQLMap(singleton('Member')->extendedSQL($filter, $sort));
     if ($blank) {
         $blankMember = Object::create('Member');
         $blankMember->Surname = $blank;
         $blankMember->ID = 0;
         $ret->getItems()->unshift($blankMember);
     }
     return $ret;
 }