/** * Short description of method __construct * * @access public * @author Joel Bout, <*****@*****.**> * @param Class clazz * @param Resource user * @param boolean forceAdd * @return mixed */ public function __construct(core_kernel_classes_Class $clazz, core_kernel_classes_Resource $user = null, $forceAdd = false) { if (empty($clazz)) { throw new Exception('Set the user class in the parameters'); } $this->formName = 'user_form'; $options = array(); $service = tao_models_classes_UserService::singleton(); if (!empty($user)) { $this->user = $user; $options['mode'] = 'edit'; } else { if (isset($_POST[$this->formName . '_sent']) && isset($_POST['uri'])) { $this->user = new core_kernel_classes_Resource(tao_helpers_Uri::decode($_POST['uri'])); } else { $this->user = $service->createInstance($clazz, $service->createUniqueLabel($clazz)); } $options['mode'] = 'add'; } if ($forceAdd) { $options['mode'] = 'add'; } $options['topClazz'] = CLASS_GENERIS_USER; parent::__construct($clazz, $this->user, $options); }
public function __construct($content) { //@FIXME had to use CLASS_LTI_OUTGOING_LINK instead of CLASS_LTI_TESTCONTENT as it was not working... $class = new core_kernel_classes_Class(CLASS_LTI_OUTGOING_LINK); parent::__construct($class, $content, array('excludedProperties' => array(RDFS_LABEL))); }
public function __construct($class, $content) { parent::__construct($class, $content, array('topClazz' => DeliveryContent::CLASS_URI, 'excludedProperties' => array(RDFS_LABEL))); }