Hydrate a status object into a StatusEntity

@param \stdClass $status
@return StatusEntity
420730
public static function hydrate(stdClass $status)
    {
        $hydrated = new StatusEntity();

        if (isset($status->version)) {
            $hydrated->setVersion($status->version);
        }

        if (isset($status->cloud)) {
            $hydrated->setCloud($status->cloud);
        }

        if (isset($status->maintenance)) {
            $hydrated->setMaintenance($status->maintenance);
        }

        if (isset($status->hardware_id)) {
            $hydrated->setHardwareId($status->hardware_id);
        }

        if (isset($status->census)) {
            $hydrated->setCensus(CensusHydrator::hydrate($status->census));
        }

        if (isset($status->trial_issue_types) && is_array($status->trial_issue_types)) {
            $hydrated->setTrialIssueTypes(TypeHydrator::hydrateCollection($status->trial_issue_types));
        }

        if (isset($status->user)) {
            $hydrated->setUser(UserHydrator::hydrate($status->user));
        }

        if (isset($status->organization)) {
            $hydrated->setOrganization(OrgHydrator::hydrate($status->organization));
        }

        return $hydrated;
    }
618565
protected function getStatus($statusId)
    {
        if (!isset($this->cachedStatuses[$statusId])) {
            $this->cachedStatuses[$statusId] = $this->statusRepository->findOneById($statusId);
        }

        return $this->cachedStatuses[$statusId];
    }
1070749
public static function hydrate(stdClass $ignore)
    {
        $hydrated = new IgnoredLocationEntity();

        if (isset($ignore->id)) {
            $hydrated->setId($ignore->id);
        }

        if (isset($ignore->path)) {
            $hydrated->setPath($ignore->path);
        }

        if (isset($ignore->match)) {
            $hydrated->setMatch($ignore->match);
        }

        if (isset($ignore->exclude)) {
            $hydrated->setExclude($ignore->exclude);
        }

        return $hydrated;
    }
1252316
public function set_status($status = 0) {
        $this->status = $status;
        $this->save();
        if ($status == BADGE_STATUS_ACTIVE) {
            // Trigger event, badge enabled.
            $eventparams = array('objectid' => $this->id, 'context' => $this->get_context());
            $event = \core\event\badge_enabled::create($eventparams);
            $event->trigger();
        } else if ($status == BADGE_STATUS_INACTIVE) {
            // Trigger event, badge disabled.
            $eventparams = array('objectid' => $this->id, 'context' => $this->get_context());
            $event = \core\event\badge_disabled::create($eventparams);
            $event->trigger();
        }
    }
313231
public function setStatus(\Sulu\Bundle\Sales\ShippingBundle\Entity\ShippingStatus $status)
    {
        $this->status = $status;
    
        return $this;
    }
1242580
public function setStatus($status)
    {
        $status = $status ? self::STATUS_ENABLED : self::STATUS_DISABLED;

        $this->setData('status', $status);
        return $this;
    }
818992
public static function hydrate(stdClass $team)
    {
        $hydrated = new TeamEntity();

        if (isset($team->id)) {
            $hydrated->setId($team->id);
        }

        if (isset($team->name)) {
            $hydrated->setName($team->name);
        }

        if (isset($team->organization)) {
            $hydrated->setOrganization(OrgHydrator::hydrate($team->organization));
        }

        if (isset($team->users) && is_array($team->users)) {
            $hydrated->setUsers(UserHydrator::hydrateCollection($team->users));
        }

        if (isset($team->created_by)) {
            $hydrated->setCreatedBy(UserHydrator::hydrate($team->created_by));
        }

        if (isset($team->created_at)) {
            $hydrated->setCreatedAt(new DateTime($team->created_at));
        }

        return $hydrated;
    }
1176922
public function setStatus($status)
    {
        $allowed_values = array('active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted');
        if ((!in_array($status, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted'");
        }
        $this->container['status'] = $status;

        return $this;
    }
199872
public static function hydrate(stdClass $census)
    {
        $hydrated = new CensusEntity();

        if (isset($census->id)) {
            $hydrated->setId($census->id);
        }

        if (isset($census->scans)) {
            $hydrated->setScans($census->scans);
        }

        if (isset($census->issues)) {
            $hydrated->setIssues($census->issues);
        }

        if (isset($census->loc)) {
            $hydrated->setLoc($census->loc);
        }

        return $hydrated;
    }
102883
public static function hydrate(stdClass $client)
    {
        $hydrated = new ClientEntity();

        if (isset($client->id)) {
            $hydrated->setId($client->id);
        }

        if (isset($client->name)) {
            $hydrated->setName($client->name);
        }

        if (isset($client->random_id)) {
            $hydrated->setRandomId($client->random_id);
        }

        if (isset($client->secret)) {
            $hydrated->setSecret($client->secret);
        }

        if (isset($client->allowed_grant_types)) {
            $hydrated->setAllowedGrantTypes($client->allowed_grant_types);
        }

        if (isset($client->redirect_uris)) {
            $hydrated->setRedirectUris($client->redirect_uris);
        }

        return $hydrated;
    }
1338752
public function setStatus(string $status = "E") : CNabuDataObject
    {
        if ($status === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$status")
            );
        }
        $this->setValue('nb_user_group_status', $status);
        
        return $this;
    }
998444
public static function hydrate(stdClass $part)
    {
        $hydrated = new PartEntity();

        if (isset($part->id)) {
            $hydrated->setId($part->id);
        }

        if (isset($part->type)) {
            $hydrated->setType($part->type);
        }

        if (isset($part->content)) {
            $hydrated->setContent($part->content);
        }

        return $hydrated;
    }
1032583
public static function hydrate(stdClass $type)
    {
        $hydrated = new TypeEntity();

        if (isset($type->id)) {
            $hydrated->setId($type->id);
        }

        if (isset($type->tag)) {
            $hydrated->setTag($type->tag);
        }

        if (isset($type->description)) {
            $hydrated->setDescription($type->description);
        }

        if (isset($type->name)) {
            $hydrated->setName($type->name);
        }

        if (isset($type->markup)) {
            $hydrated->setMarkup($type->markup);
        }

        if (isset($type->severity)) {
            $hydrated->setSeverity($type->severity);
        }

        if (isset($type->effort)) {
            $hydrated->setEffort($type->effort);
        }

        if (isset($type->second_order)) {
            $hydrated->setSecondOrder($type->second_order);
        }

        if (isset($type->cwe)) {
            $hydrated->setCwe($type->cwe);
        }

        if (isset($type->owasp2010)) {
            $hydrated->setOwasp2010($type->owasp2010);
        }

        if (isset($type->owasp2013)) {
            $hydrated->setOwasp2013($type->owasp2013);
        }

        if (isset($type->owasp2017)) {
            $hydrated->setOwasp2017($type->owasp2017);
        }

        if (isset($type->sans)) {
            $hydrated->setSans($type->sans);
        }

        if (isset($type->pcidss)) {
            $hydrated->setPcidss($type->pcidss);
        }

        if (isset($type->asvs301)) {
            $hydrated->setAsvs301($type->asvs301);
        }

        if (isset($type->asvs401)) {
            $hydrated->setAsvs401($type->asvs401);
        }

        if (isset($type->enabled)) {
            $hydrated->setEnabled($type->enabled);
        }

        if (isset($type->category)) {
            $hydrated->setCategory($type->category);
        }

        if (isset($type->parent)) {
            $hydrated->setParent(self::hydrate($type->parent));
        }

        if (isset($type->resources)) {
            $hydrated->setResources(ResourceHydrator::hydrateCollection($type->resources));
        }

        if (isset($type->inactive)) {
            $hydrated->setInactive($type->inactive);
        }

        if (isset($type->languages) && is_array($type->languages)) {
            $hydrated->setLanguages(LanguageHydrator::hydrateCollection($type->languages));
        }

        return $hydrated;
    }
1253455
public function setStatus($status)
    {
        if (!in_array($status, $this->statusList)) {
            throw new \InvalidArgumentException(sprintf('Invalid status for %s.', __CLASS__));
        }
        $this->status = $status;

        return $this;
    }
441027
public function status($status)
    {
        $httpStatus = (string) $this->response->getStatusCode();
        if (is_array($status) && !in_array($httpStatus, $status)) {
            throw new \RuntimeException(
                "Unexpected response status code: {$httpStatus}"
            );
        }

        if (is_string($status) && $httpStatus !== $status) {
            throw new \RuntimeException(
                "Unexpected response status code: {$httpStatus}"
            );
        }

        return $this;
    }
1292407
public function setStatus($status)
    {
        if (!in_array($status, [static::STATUS_STARTED, static::STATUS_STOPPED], true)) {
            throw new InvalidArgumentException('Invalid status value.');
        }

        $this->status = $status;

        return $this;
    }
1050454
public function status($status = null)
    {
        if ($status === null) {
            return $this->subscription_status;
        } else {
            $this->subscription_status = $status;
            return $this;
        }
    }