for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright CONTENT CONTROL GmbH, http://www.contentcontrol-berlin.de
*/
namespace midcom\datamanager\storage;
use midcom_error;
* Experimental storage class
class privilege extends delayed
{
* {@inheritdoc}
public function load()
//$source = $this->object->get_parameter($this->config['storage']['domain'], $this->config['storage']['name']);
$source = $this->object->get_privilege(
$this->config['type_config']['privilege_name'],
$this->config['type_config']['assignee'],
$this->config['type_config']['classname']
);
return $source->__get('value');
}
public function save()
//workaround for weird mgd API behavior where setting falsy (i.e. deleting) a nonexistent parameter
//returns an error
if ( !$this->value
&& $this->load() === null) {
return true;
return $this->object->set_privilege(
$this->value,
$this->config['type_config']['classname']);