33                $this->
id = (int)$a_id;
 
   52                $this->title = $a_title;
 
   70                $this->description = $a_value;
 
   88                $this->pool_id = (int)$a_pool_id;
 
  106                $this->schedule_id = (int)$a_schedule_id;
 
  124                $this->nr_of_items = (int)$a_value;
 
  142                $this->info_file = $a_value;
 
  159                if($this->
id && $this->info_file)
 
  162                        return $path.$this->info_file;                  
 
  182                $original = $a_upload[
"name"];
 
  185                        chmod(
$path.$original, 0770);
 
  215                $this->post_text = $a_value;
 
  233                $this->post_file = $a_value;
 
  250                if($this->
id && $this->post_file)
 
  253                        return $path.$this->post_file;                  
 
  273                $original = $a_upload[
"name"];
 
  277                        chmod(
$path.$original, 0770);
 
  308                        include_once 
"Modules/BookingManager/classes/class.ilFSStorageBooking.php";
 
  326                include_once 
"Modules/BookingManager/classes/class.ilFSStorageBooking.php";
 
  330                $path = $storage->getAbsolutePath().
"/";
 
  334                        $path .= $a_subdir.
"/";
 
  354                        $set = 
$ilDB->query(
'SELECT *'.
 
  355                                ' FROM booking_object'.
 
  356                                ' WHERE booking_object_id = '.
$ilDB->quote($this->id, 
'integer'));
 
  376                        'title' => array(
'text', $this->
getTitle()),
 
  380                        'info_file' => array(
'text', $this->
getFile()),                 
 
  381                        'post_text' => array(
'text', $this->
getPostText()),                     
 
  401                $this->
id = $ilDB->nextId(
'booking_object');
 
  404                $fields[
'booking_object_id'] = array(
'integer', $this->
id);
 
  405                $fields[
'pool_id'] = array(
'integer', $this->
getPoolId());
 
  407                return $ilDB->insert(
'booking_object', $fields);
 
  425                return $ilDB->update(
'booking_object', $fields, 
 
  426                        array(
'booking_object_id'=>array(
'integer', $this->
id)));
 
  435        static function getList($a_pool_id, $a_title = 
null)
 
  440                        ' FROM booking_object'.
 
  441                        ' WHERE pool_id = '.$ilDB->quote($a_pool_id, 
'integer');
 
  445                        $sql .= 
' AND ('.$ilDB->like(
'title', 
'text', 
'%'.$a_title.
'%').
 
  446                                ' OR '.$ilDB->like(
'description', 
'text', 
'%'.$a_title.
'%').
')';
 
  449                $sql .= 
' ORDER BY title';
 
  451                $set = 
$ilDB->query($sql);
 
  472                        return $ilDB->manipulate(
'DELETE FROM booking_object'.
 
  473                                ' WHERE booking_object_id = '.
$ilDB->quote($this->id, 
'integer'));
 
  488                $set = 
$ilDB->query(
"SELECT booking_object_id,nr_items".
 
  489                        " FROM booking_object".
 
  490                        " WHERE ".
$ilDB->in(
"booking_object_id", $a_obj_ids, 
"", 
"integer"));
 
  493                        $map[
$row[
"booking_object_id"]] = 
$row[
"nr_items"];
 
  499        public function doClone($a_pool_id, $a_schedule_map = 
null)
 
  501                $new_obj = 
new self();
 
  502                $new_obj->setPoolId($a_pool_id);
 
  503                $new_obj->setTitle($this->
getTitle());
 
  506                $new_obj->setFile($this->
getFile());
 
  523                $target = $new_obj->initStorage($new_obj->getId());             
 
  537                $db = 
$DIC->database();
 
  538                $set = $db->queryF(
"SELECT pool_id FROM booking_object ".
 
  539                        " WHERE booking_object_id = %s ",
 
  543                $rec = $db->fetchAssoc($set);
 
  544                return (
int) $rec[
"pool_id"];
 
An exception for terminatinating execution or to throw for unit testing.
setScheduleId($a_schedule_id)
Set booking schedule id.
setFile($a_value)
Set info file.
uploadFile(array $a_upload)
Upload new info file.
setTitle($a_title)
Set object title.
getScheduleId()
Get booking schedule id.
getPostText()
Get post text.
static lookupPoolId($object_id)
Lookup pool id.
static getNrOfItemsForObjects(array $a_obj_ids)
Get nr of available items
getPostFile()
Get post file.
setPoolId($a_pool_id)
Set booking pool id.
getTitle()
Get object title.
getNrOfItems()
Get number of items.
setPostFile($a_value)
Set post file.
deleteFile()
remove existing info file
uploadPostFile(array $a_upload)
Upload new post file.
setDescription($a_value)
Set object description.
getPoolId()
Get booking pool id.
__construct($a_id=NULL)
Constructor.
doClone($a_pool_id, $a_schedule_map=null)
setNrOfItems($a_value)
Set number of items.
getFileFullPath()
Get path to info file.
setPostText($a_value)
Set post text.
getDescription()
Get object description.
deleteFiles()
remove existing files
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type
save()
Create new entry in db.
getPostFileFullPath()
Get path to post file.
getDBFields()
Parse properties for sql statements.
deletePostFile()
remove existing post file
static initStorage($a_id, $a_subdir=null)
Init file system storage.
update()
Update entry in db.
read()
Get dataset from db.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.