Example #1
0
 /**
  * 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);
 }
Example #2
0
 /**
  * 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();
 }
Example #3
0
 /**
  * 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'));
 }
Example #4
0
 /**
  * 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));
 }
Example #5
0
 /**
  * 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);
 }
Example #6
0
 /**
  * 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));
 }
Example #7
0
File: Site.php Project: andrefy/cli
 /**
  * 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));
 }
Example #8
0
 /**
  * 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));
 }