00001 <?php
00002
00012 class SDRAdminLdapRole extends ModelBase {
00014 public static $ATTRIBUTES = array(
00015 'username' => array(
00016 'nullable' => false,
00017 'type' => 'string'
00018 ),
00019 'role' => array(
00020 'type' => 'string'
00021 )
00022 );
00023
00032 public function __construct($constraints = null) {
00033 parent::__construct();
00034
00035 $this->registerAttributes(self::$ATTRIBUTES);
00036 $this->registerTableName('SDRAdminLdapRole');
00037
00038 if($constraints !== null)
00039 $this->populate($constraints);
00040 }
00041
00053 public static function retrieve($constraints = array(), $checkOnly = false) {
00054 $list = self::getList($constraints, array(1), array(), $checkOnly);
00055 if(!$list || count($list) == 0)
00056 return $checkOnly ? false : null;
00057 else if($checkOnly)
00058 return $list > 0;
00059 else
00060 return $list[0];
00061 }
00062
00071 public static function exists($constraints = array()) {
00072 return self::retrieve($constraints, true);
00073 }
00074
00088 public static function getList($constraints = array(), $limit = array(), $order = array(), $count = false) {
00089 return parent::getListBase(self::getDBI(), $constraints, $limit, $order, $count, 'SDRAdminLdapRole', true);
00090 }
00091
00101 public static function getAttributesStatic() {
00102 return self::$ATTRIBUTES;
00103 }
00104
00110 public static function getTableNameStatic() {
00111 return 'SDRAdminLdapRole';
00112 }
00113
00114 }
00115
00116 ?>