Creates a new UpgradeStatus object from the parsed response.

@param array $parsed The parsed response body in array representation

@return \WindowsAzure\ServiceManagement\Models\UpgradeStatus
198898
public static function create($parsed)
    {
        $result = new self();
        $upgradeType = Utilities::tryGetValue(
            $parsed,
            Resources::XTAG_UPGRADE_TYPE
        );
        $currentUpgradeDomainState = Utilities::tryGetValue(
            $parsed,
            Resources::XTAG_CURRENT_UPGRADE_DOMAIN_STATE
        );
        $currentUpgradeDomain = Utilities::tryGetValue(
            $parsed,
            Resources::XTAG_CURRENT_UPGRADE_DOMAIN
        );

        $result->setCurrentUpgradeDomain(intval($currentUpgradeDomain));
        $result->setCurrentUpgradeDomainState($currentUpgradeDomainState);
        $result->setUpgradeType($upgradeType);

        return $result;
    }
475531
protected function actionAdd($params=array())
    {
        $response = array(
            'errors' => array(),
            'data' => array(),
        );
        $values = $this->company->prepareParams($params);

        if (empty($values['name'])) {
            $response['errors'][] = 'cmp01';
        }
        if (empty($values['build'])) {
            $response['errors'][] = 'cmp02';
        }
        if (!$this->checkBuildExists($values['build'])) {
            $response['errors'][] = 'cmp03';
        }
        if ($this->checkCompanyExists($values['id'])) {
            $response['errors'][] = 'cmp04';
            $response['data']['id'] = $values['id'];
        }

        if (!empty($response['errors'])) {
            return $response;
        }
        $result = $this->company->add($values);
        if ($result) {
            $response['data']['id'] = $values['id'];
        } else {
            $response['errors'][] = 'err01';
        }
        return $response;
    }
456461
public function add(array $conditions)
    {
        $this->conditions = array_merge($this->conditions, $conditions);

        return $this->conditions;
    }
437842
public static function create($parsed)
    {
        $result = new self();
        $properties = Utilities::tryGetValue(
            $parsed,
            Resources::XTAG_HOSTED_SERVICE_PROPERTIES
        );
        $result->_hostedService = new HostedService($parsed, $properties);

        return $result;
    }
957714
public static function create(array $parsedResponse)
    {
        $result = new self();
        $result->setLogging(Logging::create($parsedResponse['Logging']));
        $result->setMetrics(Metrics::create($parsedResponse['Metrics']));

        return $result;
    }
633626
public function updatedBy($guid)
    {
        $model = $this->noInitModel;
        if (!is_string($model->updatedByAttribute)) {
            return $this;
        }
        if ($guid instanceof BaseUserModel) {
            $guid = $guid->getGUID();
        }
        return $this->andWhere([$model->updatedByAttribute => new Binary($guid, Binary::TYPE_UUID)]);
    }
1305729
public static function create(array $parsedResponse)
    {
        $result = new self();
        $result->_serviceProperties = ServiceProperties::create($parsedResponse);

        return $result;
    }
1171546
public function parse(): Parsed
    {
        return new Parsed(
            $this->jwt,
            $this->decodeHeader(),
            $this->decodePayload(),
            $this->getSignature()
        );
    }
1149672
public function createNew($versionComments)
    {
        $app = Facade::getFacadeApplication();
        $cloner = $app->make(Cloner::class);
        $clonerOptions = $app->build(ClonerOptions::class)
            ->setCopyContents(false)
            ->setVersionComments($versionComments)
        ;
        $myCollection = Page::getByID($this->getCollectionID());
        $newVersion = $cloner->cloneCollectionVersion($this, $myCollection, $clonerOptions);

        return $newVersion;
    }
929307
public function refresh(array $params = [])
    {
        return $this->client->indices()->refresh(array_merge(['index' => $this->getIndexName()], $params));
    }
476323
public function addByArray(array $services = [])
  {
    if (!empty($services)) {
      foreach ($services as $name => $methods) {
        if (!$this->has($name)) {
          $service = new Service();

          foreach ($methods as $method => $value) {
            if (method_exists($service, $method)) {
              $service->{$method}($value);
            } else {
                throw new ServiceMethodNotExists(sprintf(
                  "Method '%s' does not exists on the %s service.",
                  $method,
                  $name
                ));
              }
          }

          $this->services[$name] = $service;

          continue;
        }

        throw new ServiceAlreadyExists(sprintf(
          "Service '%s' already exists.",
          $name
        ));
      }
    }

    return $this;
  }
818999
public static function createFromArray(array $updates)
    {
        $update = new MapUpdate();

        foreach ($updates as $key => $val) {

            if (is_bool($val)) {
                $update->updateFlag($key, new FlagOp($val));

                continue;
            }

            if (is_string($val)) {
                $update->updateRegister($key, new RegisterOp($val));

                continue;
            }

            if (is_int($val)) {
                $update->updateCounter($key, new CounterOp($val));

                continue;
            }

            if (is_array($val) && ($val === array_values($val))) {

                $update->updateSet($key, new SetOp($val, []));

                continue;
            }

            if (is_array($val)) {

                $update->updateMap($key, self::createFromArray($val)->getOp());

                continue;
            }

            $message = 'Map element "%s" must be of the type (boolean, string, integer, or an array), "%s" given.';
            $type    = is_object($val) ? get_class($val) : gettype($val);

            throw new InvalidArgumentException(sprintf($message, $key, $type));
        }

        return $update;
    }
241542
public function newInstance($cloned = array())
    {
        if ($cloned instanceof Model) {
            $cloned = $cloned->toArray(Model::FETCH_PUBLISHED);
        }

        if (isset($this->options['model'])) {
            $Model = $this->options['model'];
            return new $Model($cloned, array('collection' => $this));
        } else {
            return new Model($cloned, array('collection' => $this));
        }
    }
421572
public function update(array $sets, array $where = [])
    {
        $this->where($where);
        $this->builderCache->store('sets', $sets);

        return $this->platformUpdateHandler($this->builderCache);
    }
1107110
final public function getMessage($parsed = true) {
        return ($parsed) ? $this->parseMessages($this->messages) :
                $this->messages;
    }
75743
public function ajax( $params ) {

		if ( ! isset( $params->step ) ) {
			return pods_error( __( 'Invalid upgrade process.', 'pods' ) );
		}

		if ( ! isset( $params->type ) ) {
			return pods_error( __( 'Invalid upgrade method.', 'pods' ) );
		}

		if ( ! method_exists( $this, $params->step . '_' . $params->type ) ) {
			return pods_error( __( 'Upgrade method not found.', 'pods' ) );
		}

		return call_user_func( array( $this, $params->step . '_' . $params->type ), $params );
	}
1027550
public function setStatus($status)
    {
        if($status === Database::STATUS_CREATED) {
            $this->__new = false;
        }

        if($status === Database::STATUS_DELETED) {
            $this->__new = true;
        }

        if($status === Database::STATUS_FETCHED) {
            $this->__new = false;
        }

        $this->_status = $status;
        return $this;
    }