00001 <?php
00002
00017 class TSDSection extends TSDObject {
00018 public static $ATTRIBUTES = array(
00019 'id' => false,
00020 'name' => 'edit',
00021 'description' => 'edit',
00022 'chapterId' => false
00023 );
00024
00033 public function __construct($id = '') {
00034 parent::__construct('TSDSection', self::$ATTRIBUTES, 'id', $id);
00035 }
00036
00046 public function isValid() {
00047 return (
00048 ($this->id == '' || ctype_digit((string) $this->id)) &&
00049 (is_string($this->name) && $this->name != '') &&
00050 (ctype_digit((string) $this->chapterId) && $this->chapterId > 0)
00051 );
00052 }
00053
00069 public static function getList($constraints = array(), $limit = array(), $order = array(), $cnt = false) {
00070 return self::getListImpl('TSDSection', 'TSDSection', array_keys(self::$ATTRIBUTES), $constraints,
00071 array(), $limit, $order, $cnt);
00072 }
00073
00079 public function getParent() {
00080 if(!$this->checkInit('Retrieve chapter')) return null;
00081
00082 $chapter = new TSDChapter($this->chapterId);
00083 if(!$chapter->isValid())
00084 return null;
00085 else
00086 return $chapter;
00087 }
00088
00097 public function getIdentifier() {
00098 return $this->name;
00099 }
00100
00112 public function listChildren($constraints = array(), $limit = array(), $order = array(), $cnt = false) {
00113 return null;
00114 }
00115
00127 public function listValidChildren($constraints = array(), $limit = array(), $order = array(), $cnt = false) {
00128 return null;
00129 }
00130 }
00131
00132 ?>