コード例 #1
0
ファイル: Site.php プロジェクト: serundeputy/cli
 /**
  * Owner handler
  *
  * @param string $owner UUID of new owner of site
  * @return Workflow
  * @throws TerminusException
  */
 public function setOwner($owner = null)
 {
     $new_owner = $this->user_memberships->get($owner);
     if ($new_owner == null) {
         $message = 'The owner must be a team member. Add them with `site team`';
         throw new TerminusException($message);
     }
     $workflow = $this->workflows->create('promote_site_user_to_owner', array('params' => array('user_id' => $new_owner->get('id'))));
     return $workflow;
 }
コード例 #2
0
ファイル: Site.php プロジェクト: sammys/terminus
 /**
  * Update service level
  *
  * @param string $level Level to set service on site to
  * @return \stdClass
  * @throws TerminusException
  */
 public function updateServiceLevel($level)
 {
     try {
         $workflow = $this->workflows->create('change_site_service_level', ['params' => ['service_level' => $level]]);
     } catch (\Exception $e) {
         if (strpos($e->getMessage(), '403') !== false) {
             throw new TerminusException('Instrument required to increase service level', [], 1);
         }
         throw $e;
     }
     return $workflow;
 }