/** * Object constructor * * @param object $attributes Attributes of this model * @param array $options Options to set as $this->key */ public function __construct($attributes, array $options = array()) { parent::__construct($attributes, $options); $options = ['environment' => $this]; $this->backups = new Backups($options); $this->bindings = new Bindings($options); $this->commits = new Commits($options); }
/** * Object constructor * * @param [stdClass] $attributes Attributes of this model * @param [array] $options Options to set as $this->key * @return [User] $this */ public function __construct($attributes, $options = array()) { if (!isset($options['id'])) { $options['id'] = Session::getValue('user_uuid'); } parent::__construct($attributes, $options); $this->workflows = new Workflows(array('owner' => $this)); $this->instruments = new Instruments(array('user' => $this)); $this->setProfile(); }
/** * Object constructor * * @param object $attributes Attributes of this model * @param array $options Options to set as $this->key */ public function __construct($attributes = null, array $options = array()) { parent::__construct($attributes, $options); if (!isset($this->user)) { $this->user = Session::getUser(); } $this->site_memberships = new OrganizationSiteMemberships(array('organization' => $this, 'owner' => $this, 'owner_type' => 'organization')); $this->user_memberships = new OrganizationUserMemberships(array('organization' => $this, 'owner' => $this, 'owner_type' => 'organization')); $this->workflows = new Workflows(array('owner' => $this, 'owner_type' => 'organization')); }
/** * Object constructor * * @param object $attributes Attributes of this model * @param array $options Options to set as $this->key */ public function __construct($attributes = null, array $options = array()) { parent::__construct($attributes, $options); if (isset($attributes->profile)) { $this->profile = $attributes->profile; } $this->workflows = new Workflows(array('owner' => $this)); $this->instruments = new Instruments(array('user' => $this)); $this->organizations = new UserOrganizationMemberships(array('user' => $this)); }
/** * Object constructor * TODO: Implement OrganizationUserMemberships * * @param [stdClass] $attributes Attributes of this model * @param [array] $options Options to set as $this->key * @return [Organization] $this */ public function __construct($attributes = null, $options = array()) { parent::__construct($attributes, $options); if (!isset($this->user)) { $this->user = new User(new stdClass(), array()); } $params = array('organization' => $this, 'owner' => $this, 'owner_type' => 'organization'); $this->site_memberships = new OrganizationSiteMemberships($params); //$this->user_memberships = new OrganizationUserMemberships($params); $this->workflows = new Workflows($params); }
/** * Object constructor * * @param [stdClass] $attributes Attributes of this model * @param [array] $options Options to set as $this->key * @return [User] $this */ public function __construct($attributes = null, $options = array()) { if (!isset($options['id'])) { $options['id'] = Session::getValue('user_uuid'); } parent::__construct($attributes, $options); if (isset($attributes->profile)) { $this->profile = $attributes->profile; } $this->workflows = new Workflows(array('owner' => $this)); $this->instruments = new Instruments(array('user' => $this)); $this->organizations = new UserOrganizationMemberships(array('user' => $this)); }
/** * Object constructor * * @param [stdClass] $attributes Attributes of this model * @param [array] $options Options to set as $this->key * @return [Site] $this */ public function __construct($attributes = null, $options = array()) { if ($attributes == null) { $attributes = new \stdClass(); } $must_haves = array('name', 'id', 'service_level', 'framework', 'created', 'memberships'); foreach ($must_haves as $must_have) { if (!isset($attributes->{$must_have})) { $attributes->{$must_have} = null; } } parent::__construct($attributes, $options); $this->environments = new Environments(array('site' => $this)); $this->org_memberships = new SiteOrganizationMemberships(array('site' => $this)); $this->user_memberships = new SiteUserMemberships(array('site' => $this)); $this->workflows = new Workflows(array('owner' => $this)); }
/** * Object constructor * * @param [stdClass] $attributes Attributes of this model * @param [array] $options Options to set as $this->key * @return [TerminusModel] $this */ public function __construct($attributes, $options = array()) { parent::__construct($attributes, $options); $this->bindings = new Bindings(array('environment' => $this)); }