コード例 #1
0
ファイル: Handler.php プロジェクト: LeeGlendenning/formulize
 /**
  * retrieve groups from the database
  *
  * @param object $criteria {@link icms_db_criteria_Element} with conditions for the groups
  * @param bool $id_as_key should the groups' IDs be used as keys for the associative array?
  * @return mixed Array of groups
  */
 public function getObjects($criteria = null, $id_as_key = false)
 {
     $ret = array();
     $limit = $start = 0;
     $sql = "SELECT * FROM " . icms::$xoopsDB->prefix('groups');
     if (isset($criteria) && is_subclass_of($criteria, 'icms_db_criteria_Element')) {
         $sql .= " " . $criteria->renderWhere();
         $limit = $criteria->getLimit();
         $start = $criteria->getStart();
     }
     $result = icms::$xoopsDB->query($sql, $limit, $start);
     if (!$result) {
         return $ret;
     }
     while ($myrow = icms::$xoopsDB->fetchArray($result)) {
         $group = new icms_member_group_Object();
         $group->assignVars($myrow);
         if (!$id_as_key) {
             $ret[] =& $group;
         } else {
             $ret[$myrow['groupid']] =& $group;
         }
         unset($group);
     }
     return $ret;
 }
コード例 #2
0
ファイル: group.php プロジェクト: LeeGlendenning/formulize
 public function __construct()
 {
     parent::getInstance();
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_member_group_Object', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
 }