Exemple #1
0
 /**
  * This function will save the current state of all types to disk. A full
  * validation cycle is done beforehand, if any validation fails, the function
  * aborts and sets the $validation_errors member variable accordingly.
  *
  * @return boolean Indicating success
  */
 public function save()
 {
     if (!$this->validate()) {
         return false;
     }
     return $this->storage->store($this->types);
 }
Exemple #2
0
 /**
  * Checks whether the current user has the given privilege on the storage backend.
  * The storage backend is resposible for the actual execution of this operation,
  * so this is merely a shortcut.
  *
  * @param string $privilege The privilege to check against.
  * @return boolean true if the user has the permission, false otherwise.
  */
 public function can_do($privilege)
 {
     return $this->storage->can_do($privilege);
 }
Exemple #3
0
 /**
  * Start up the storage manager and bind it to a given MidgardObject.
  * The passed object must be a MidCOM DBA object, otherwise the system bails with
  * generate_error. In this case, no automatic conversion is done, as this would
  * destroy the reference.
  *
  * @param midcom_helper_datamanagerschema &$schema The data schema to use for processing.
  * @param MidCOMDBAObject &$object A reference to the DBA object to user for Data I/O.
  */
 public function __construct(&$schema, &$object)
 {
     parent::__construct($schema);
     $this->object =& $object;
 }
Exemple #4
0
 /**
  * TODO
  *
  * @param midcom_helper_datamanager_schema &$schema The data schema to use for processing.
  * @param Array $defaults The defaults to use as "artificial" storage. This can be omitted
  *     safely.
  */
 function __construct(&$schema, $defaults = array())
 {
     parent::__construct($schema);
     $this->_defaults = $defaults;
 }