Public Member Functions

ilMDRights Class Reference

Inheritance diagram for ilMDRights:
Collaboration diagram for ilMDRights:

Public Member Functions

 ilMDRights ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setCosts ($a_costs)
 getCosts ()
 setCopyrightAndOtherRestrictions ($a_caor)
 getCopyrightAndOtherRestrictions ()
 setDescription ($a_description)
 getDescription ()
 setDescriptionLanguage (&$lng_obj)
getDescriptionLanguage ()
 getDescriptionLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getId ($a_rbac_id, $a_obj_id)
 ilMDRights ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setCosts ($a_costs)
 getCosts ()
 setCopyrightAndOtherRestrictions ($a_caor)
 getCopyrightAndOtherRestrictions ()
 setDescription ($a_description)
 getDescription ()
 setDescriptionLanguage (&$lng_obj)
getDescriptionLanguage ()
 getDescriptionLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getId ($a_rbac_id, $a_obj_id)

Detailed Description

Definition at line 33 of file class.ilMDRights.php.


Member Function Documentation

ilMDRights::__getFields (  ) 

Definition at line 144 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), ilMDBase::getObjId(), ilMDBase::getObjType(), and ilMDBase::getRBACId().

        {
                return array('rbac_id'  => $this->getRBACId(),
                                         'obj_id'       => $this->getObjId(),
                                         'obj_type'     => $this->getObjType(),
                                         'costs'        => $this->getCosts(),
                                         'copyright_and_other_restrictions' => $this->getCopyrightAndOtherRestrictions(),
                                         'description' => $this->getDescription(),
                                         'description_language' => $this->getDescriptionLanguageCode());
        }

Here is the call graph for this function:

ilMDRights::__getFields (  ) 

Definition at line 144 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), ilMDBase::getObjId(), ilMDBase::getObjType(), ilMDBase::getRBACId(), and ilUtil::prepareDBString().

        {
                return array('rbac_id'  => $this->getRBACId(),
                                         'obj_id'       => $this->getObjId(),
                                         'obj_type'     => ilUtil::prepareDBString($this->getObjType()),
                                         'costs'        => ilUtil::prepareDBString($this->getCosts()),
                                         'copyright_and_other_restrictions' => ilUtil::prepareDBString($this->getCopyrightAndOtherRestrictions()),
                                         'description' => ilUtil::prepareDBString($this->getDescription()),
                                         'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
        }

Here is the call graph for this function:

ilMDRights::_getId ( a_rbac_id,
a_obj_id 
)

Definition at line 204 of file class.ilMDRights.php.

References $query, $res, and $row.

Referenced by ilMD::getRights().

        {
                global $ilDB;

                $query = "SELECT meta_rights_id FROM il_meta_rights ".
                        "WHERE rbac_id = '".$a_rbac_id."' ".
                        "AND obj_id = '".$a_obj_id."'";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        return $row->meta_rights_id;
                }
                return false;
        }

Here is the caller graph for this function:

ilMDRights::_getId ( a_rbac_id,
a_obj_id 
)

Definition at line 197 of file class.ilMDRights.php.

References $query, $res, and $row.

        {
                global $ilDB;

                $query = "SELECT meta_rights_id FROM il_meta_rights ".
                        "WHERE rbac_id = '".$a_rbac_id."' ".
                        "AND obj_id = '".$a_obj_id."'";

                $res = $ilDB->query($query);
                while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        return $row->meta_rights_id;
                }
                return false;
        }

ilMDRights::delete (  ) 

Reimplemented from ilMDBase.

Definition at line 129 of file class.ilMDRights.php.

References $query, and ilMDBase::getMetaId().

        {
                if($this->getMetaId())
                {
                        $query = "DELETE FROM il_meta_rights ".
                                "WHERE meta_rights_id = '".$this->getMetaId()."'";
                        
                        $this->db->query($query);
                        
                        return true;
                }
                return false;
        }

Here is the call graph for this function:

ilMDRights::delete (  ) 

Reimplemented from ilMDBase.

Definition at line 129 of file class.ilMDRights.php.

References $query, and ilMDBase::getMetaId().

        {
                if($this->getMetaId())
                {
                        $query = "DELETE FROM il_meta_rights ".
                                "WHERE meta_rights_id = '".$this->getMetaId()."'";
                        
                        $this->db->query($query);
                        
                        return true;
                }
                return false;
        }

Here is the call graph for this function:

ilMDRights::getCopyrightAndOtherRestrictions (  ) 

Definition at line 73 of file class.ilMDRights.php.

        {
                return $this->caor;
        }

ilMDRights::getCopyrightAndOtherRestrictions (  ) 

Definition at line 73 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

        {
                return $this->caor;
        }

Here is the caller graph for this function:

ilMDRights::getCosts (  ) 

Definition at line 56 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

        {
                return $this->costs;
        }

Here is the caller graph for this function:

ilMDRights::getCosts (  ) 

Definition at line 56 of file class.ilMDRights.php.

        {
                return $this->costs;
        }

ilMDRights::getDescription (  ) 

Definition at line 81 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

        {
                return $this->description;
        }

Here is the caller graph for this function:

ilMDRights::getDescription (  ) 

Definition at line 81 of file class.ilMDRights.php.

        {
                return $this->description;
        }

& ilMDRights::getDescriptionLanguage (  ) 

Definition at line 92 of file class.ilMDRights.php.

        {
                return is_object($this->description_language) ? $this->description_language : false;
        }

& ilMDRights::getDescriptionLanguage (  ) 

Definition at line 92 of file class.ilMDRights.php.

        {
                return is_object($this->description_language) ? $this->description_language : false;
        }

ilMDRights::getDescriptionLanguageCode (  ) 

Definition at line 96 of file class.ilMDRights.php.

        {
                return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
        }

ilMDRights::getDescriptionLanguageCode (  ) 

Definition at line 96 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

        {
                return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
        }

Here is the caller graph for this function:

ilMDRights::ilMDRights ( a_rbac_id = 0,
a_obj_id = 0,
a_obj_type = '' 
)

Definition at line 35 of file class.ilMDRights.php.

References ilMDBase::ilMDBase().

        {
                parent::ilMDBase($a_rbac_id,
                                                 $a_obj_id,
                                                 $a_obj_type);
        }

Here is the call graph for this function:

ilMDRights::ilMDRights ( a_rbac_id = 0,
a_obj_id = 0,
a_obj_type = '' 
)

Definition at line 35 of file class.ilMDRights.php.

References ilMDBase::ilMDBase().

        {
                parent::ilMDBase($a_rbac_id,
                                                 $a_obj_id,
                                                 $a_obj_type);
        }

Here is the call graph for this function:

ilMDRights::read (  ) 

Definition at line 155 of file class.ilMDRights.php.

References $query, $res, $row, ilMDBase::getMetaId(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setDescriptionLanguage(), ilMDBase::setObjId(), ilMDBase::setObjType(), ilMDBase::setRBACId(), and ilUtil::stripSlashes().

        {
                include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';


                if($this->getMetaId())
                {

                        $query = "SELECT * FROM il_meta_rights ".
                                "WHERE meta_rights_id = '".$this->getMetaId()."'";

                
                        $res = $this->db->query($query);
                        while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                        {
                                $this->setRBACId($row->rbac_id);
                                $this->setObjId($row->obj_id);
                                $this->setObjType($row->obj_type);
                                $this->setDescription(ilUtil::stripSlashes($row->description));
                                $this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
                                $this->setCosts(ilUtil::stripSlashes($row->costs));
                                $this->setCopyrightAndOtherRestrictions(ilUtil::stripSlashes($row->copyright_and_other_restrictions));
                        }
                        return true;
                }
                return false;
        }

Here is the call graph for this function:

ilMDRights::read (  ) 

Definition at line 155 of file class.ilMDRights.php.

References $query, $res, $row, ilMDBase::getMetaId(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setDescriptionLanguage(), ilMDBase::setObjId(), ilMDBase::setObjType(), and ilMDBase::setRBACId().

        {
                include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';


                if($this->getMetaId())
                {

                        $query = "SELECT * FROM il_meta_rights ".
                                "WHERE meta_rights_id = '".$this->getMetaId()."'";

                
                        $res = $this->db->query($query);
                        while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
                        {
                                $this->setRBACId($row->rbac_id);
                                $this->setObjId($row->obj_id);
                                $this->setObjType($row->obj_type);
                                $this->setDescription($row->description);
                                $this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
                                $this->setCosts($row->costs);
                                $this->setCopyrightAndOtherRestrictions($row->copyright_and_other_restrictions);
                        }
                        return true;
                }
                return false;
        }

Here is the call graph for this function:

ilMDRights::save (  ) 

Reimplemented from ilMDBase.

Definition at line 101 of file class.ilMDRights.php.

References ilMDBase::getMetaId(), and ilMDBase::setMetaId().

        {
                if($this->db->autoExecute('il_meta_rights',
                                                                  $this->__getFields(),
                                                                  DB_AUTOQUERY_INSERT))
                {
                        $this->setMetaId($this->db->getLastInsertId());

                        return $this->getMetaId();
                }
                return false;
        }

Here is the call graph for this function:

ilMDRights::save (  ) 

Reimplemented from ilMDBase.

Definition at line 101 of file class.ilMDRights.php.

References ilMDBase::getMetaId(), and ilMDBase::setMetaId().

        {
                if($this->db->autoExecute('il_meta_rights',
                                                                  $this->__getFields(),
                                                                  DB_AUTOQUERY_INSERT))
                {
                        $this->setMetaId($this->db->getLastInsertId());

                        return $this->getMetaId();
                }
                return false;
        }

Here is the call graph for this function:

ilMDRights::setCopyrightAndOtherRestrictions ( a_caor  ) 

Definition at line 60 of file class.ilMDRights.php.

Referenced by read().

        {
                switch($a_caor)
                {
                        case 'Yes':
                        case 'No':
                                $this->caor = $a_caor;
                                return true;

                        default:
                                return false;
                }
        }

Here is the caller graph for this function:

ilMDRights::setCopyrightAndOtherRestrictions ( a_caor  ) 

Definition at line 60 of file class.ilMDRights.php.

        {
                switch($a_caor)
                {
                        case 'Yes':
                        case 'No':
                                $this->caor = $a_caor;
                                return true;

                        default:
                                return false;
                }
        }

ilMDRights::setCosts ( a_costs  ) 

Definition at line 43 of file class.ilMDRights.php.

        {
                switch($a_costs)
                {
                        case 'Yes':
                        case 'No':
                                $this->costs = $a_costs;
                                return true;

                        default:
                                return false;
                }
        }

ilMDRights::setCosts ( a_costs  ) 

Definition at line 43 of file class.ilMDRights.php.

Referenced by read().

        {
                switch($a_costs)
                {
                        case 'Yes':
                        case 'No':
                                $this->costs = $a_costs;
                                return true;

                        default:
                                return false;
                }
        }

Here is the caller graph for this function:

ilMDRights::setDescription ( a_description  ) 

Definition at line 77 of file class.ilMDRights.php.

        {
                $this->description = $a_description;
        }

ilMDRights::setDescription ( a_description  ) 

Definition at line 77 of file class.ilMDRights.php.

Referenced by read().

        {
                $this->description = $a_description;
        }

Here is the caller graph for this function:

ilMDRights::setDescriptionLanguage ( &$  lng_obj  ) 

Definition at line 85 of file class.ilMDRights.php.

        {
                if(is_object($lng_obj))
                {
                        $this->description_language = $lng_obj;
                }
        }

ilMDRights::setDescriptionLanguage ( &$  lng_obj  ) 

Definition at line 85 of file class.ilMDRights.php.

Referenced by read().

        {
                if(is_object($lng_obj))
                {
                        $this->description_language = $lng_obj;
                }
        }

Here is the caller graph for this function:

ilMDRights::toXML ( &$  writer  ) 

Reimplemented from ilMDBase.

Definition at line 188 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), and getDescriptionLanguageCode().

        {
                $writer->xmlStartTag('Rights',array('Costs' => $this->getCosts(),
                                                                                        'CopyrightAndOtherRestrictions' => $this->getCopyrightAndOtherRestrictions()));
                $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()),$this->getDescription());
                $writer->xmlEndTag('Rights');
        }

Here is the call graph for this function:

ilMDRights::toXML ( &$  writer  ) 

Reimplemented from ilMDBase.

Definition at line 188 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), and getDescriptionLanguageCode().

        {
                $writer->xmlStartTag('Rights',array('Cost' => $this->getCosts()
                                                                                        ? $this->getCosts()
                                                                                        : 'No',
                                                                                        'CopyrightAndOtherRestrictions' => $this->getCopyrightAndOtherRestrictions()
                                                                                        ? $this->getCopyrightAndOtherRestrictions()
                                                                                        : 'No'));
                $writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()
                                                                                                ? $this->getDescriptionLanguageCode()
                                                                                                : 'en'),
                                                        $this->getDescription());
                $writer->xmlEndTag('Rights');
        }

Here is the call graph for this function:

ilMDRights::update (  ) 

Reimplemented from ilMDBase.

Definition at line 114 of file class.ilMDRights.php.

References ilMDBase::getMetaId().

        {
                if($this->getMetaId())
                {
                        if($this->db->autoExecute('il_meta_rights',
                                                                          $this->__getFields(),
                                                                          DB_AUTOQUERY_UPDATE,
                                                                          "meta_rights_id = '".$this->getMetaId()."'"))
                        {
                                return true;
                        }
                }
                return false;
        }

Here is the call graph for this function:

ilMDRights::update (  ) 

Reimplemented from ilMDBase.

Definition at line 114 of file class.ilMDRights.php.

References ilMDBase::getMetaId().

        {
                if($this->getMetaId())
                {
                        if($this->db->autoExecute('il_meta_rights',
                                                                          $this->__getFields(),
                                                                          DB_AUTOQUERY_UPDATE,
                                                                          "meta_rights_id = '".$this->getMetaId()."'"))
                        {
                                return true;
                        }
                }
                return false;
        }

Here is the call graph for this function:


The documentation for this class was generated from the following files: