/** * Create a new Site * @param $options (array) * @param $options label(string) * @param $options name(string) * @option $options organization_id(string) * @option product_id(string) * * @return Workflow * */ static function create($options = array()) { $data = array('label' => $options['label'], 'site_name' => $options['name']); if (isset($options['organization_id'])) { $data['organization_id'] = $options['organization_id']; } if (isset($options['product_id'])) { $data['deploy_product'] = array('product_id' => $options['product_id']); } $user = User::instance(); $workflow = $user->workflows->create('create_site', array('params' => $data)); return $workflow; }
public function __construct($org) { // if the org id is passed in then we need to fetch it from the user object if (is_string($org)) { $user = User::instance(); $orgs = $user->organizations(); $org = $orgs->{$org}; } // hydrate the object $properties = get_object_vars($org); foreach (get_object_vars($org) as $key => $value) { if (!property_exists($this, $key)) { $this->{$key} = $properties[$key]; } } return $this; }
public function __construct($org) { // if the org id is passed in then we need to fetch it from the user object if (is_string($org)) { $this->user = User::instance(); $orgs = $this->user->organizations(); $org = $orgs->{$org}; } $this->id = $org->id; // hydrate the object $properties = get_object_vars($org); foreach (get_object_vars($org) as $key => $value) { if (!property_exists($this, $key)) { $this->{$key} = $properties[$key]; } } $this->workflows = new Workflows(array('owner' => $this, 'owner_type' => 'organization')); return $this; }