/*!
\static
\return the status of the approval collaboration item \a $approvalID.
512118
static function checkApproval( $approvalID )
    {
        $collaborationItem = eZCollaborationItem::fetch( $approvalID );
        if ( $collaborationItem !== null )
        {
            return $collaborationItem->attribute( 'data_int3' );
        }
        return false;
    }
101624
public function getStatusesShow($id, array $parameters = array(), $multipart = false, $appOnlyAuth = false)
    {
        return $this->get("statuses/show/{$id}", $parameters, $multipart, $appOnlyAuth);
    }
920429
protected function currentStatus()
    {
        if (! $masters = app(MasterSupervisorRepository::class)->all()) {
            return 'inactive';
        }

        return collect($masters)->contains(function ($master) {
            return $master->status === 'paused';
        }) ? 'paused' : 'running';
    }
657053
protected function getStatus($projectId)
    {
        $branch = $this->getParam('branch', 'master');
        try {
            $project = $this->projectStore->getById($projectId);
            $status = 'passing';

            if (!$project->getAllowPublicStatus()) {
                return null;
            }

            if (isset($project) && $project instanceof Project) {
                $build = $project->getLatestBuild($branch, array(2,3));

                if (isset($build) && $build instanceof Build && $build->getStatus() != 2) {
                    $status = 'failed';
                }
            }
        } catch (\Exception $e) {
            $status = 'error';
        }

        return $status;
    }
586283
public function approve($friendId)
    {

        $uri = $this->buildUserResourceUri('approve', $friendId);
        $response = $this->makeAuthenticatedApiRequest($uri);

        return $response->user;

    }
570281
public function actionChangeProductStatus($id, $status)
    {
        if (!empty($id) && !empty($status)) {
            $product = Product::findOne($id);
            if ($product->status == Product::STATUS_ON_MODERATION) {

                switch ($status) {
                    case Product::STATUS_SUCCESS:
                        $product->status = Product::STATUS_SUCCESS;
                        $product->save();

                        $this->trigger(self::EVENT_AFTER_ACCEPT_PRODUCT, new ProductEvent([
                            'id' => $id
                        ]));

                        break;
                    case Product::STATUS_DECLINED:
                        $product->status = Product::STATUS_DECLINED;
                        $product->save();
                        break;
                }

                $this->trigger(self::EVENT_AFTER_EDIT_PRODUCT, new ProductEvent([
                    'id' => $id
                ]));
            }
        }
        return $this->redirect(Yii::$app->request->referrer);
    }
895773
public function getStatus($id = null)
    {
        if ($this->isSuccess()) {
            if (!$id) {
                $result = $this->getResult();
                return $result[0]['status'];
            }

            foreach ($this->getResult() as $row) {
                if ($row['id'] == $id) {
                    return $row['status'];
                }
            }
        }

        return false;
    }
773551
public function confirmAction()
	{
		$context = $this->getContext();
		$client = \Aimeos\Client\Html::create( $context, 'checkout/confirm' );

		$view = $context->getView();
		$param = array_merge( \TYPO3\CMS\Core\Utility\GeneralUtility::_GET(), \TYPO3\CMS\Core\Utility\GeneralUtility::_POST() );
		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
		$view->addHelper( 'param', $helper );

		$client->setView( $view );
		$client->process();

		$this->response->addAdditionalHeaderData( (string) $client->getHeader() );

		return $client->getBody();
	}
638724
function _get_license_by_id( $id, $sync_licenses = true ) {
            $this->_logger->entrance();

            if ( ! FS_Plugin_License::is_valid_id( $id ) ) {
                return false;
            }

            /**
             * When running from the network level admin and opted-in from the network,
             * check if the license exists in the network user licenses collection.
             *
             * @author Vova Feldman (@svovaf)
             * @since  2.0.0
             */
            if ( fs_is_network_admin() &&
                 $this->is_network_registered() &&
                 ( ! is_object( $this->_user ) || $this->_storage->network_user_id != $this->_user->id )
            ) {
                $licenses = $this->get_user_licenses( $this->_storage->network_user_id );

                foreach ( $licenses as $license ) {
                    if ( $id == $license->id ) {
                        return $license;
                    }
                }
            }

            if ( ! $this->has_any_license() && $sync_licenses ) {
                $this->_sync_licenses( $id );
            }

            if ( is_array( $this->_licenses ) ) {
                foreach ( $this->_licenses as $license ) {
                    if ( $id == $license->id ) {
                        return $license;
                    }
                }
            }

            return false;
        }
371526
public function fulfil($id)
	{
		$endpoint = new Fulfil($this->getTransport());
		$endpoint->setId($id);

		try {
			$result = $endpoint->performRequest();
		} catch (ResourceNotFoundException $e) {
			return false;
		}

		return $result['status'] == 204;
	}
977246
public function getStatusOfTaskWithId($taskId)
    {
        $task = $this->taskRepo->find($taskId);
        if (!($task instanceof Task)) {
            //the task was not found
            return Task::STATUS_GONE;
        }
        return $task->getStatus();
    }
847882
public function getStatus($id)
    {
        if ($this->isSuccess()) {
            foreach ($this->getResult() as $row) {
                if ($row['id'] == $id) {
                    return $row['status'];
                }
            }
        }

        return false;
    }
1188091
static function fetch( $id, $asObject = true, $status = eZRSSExport::STATUS_VALID )
    {
        return eZPersistentObject::fetchObject( eZRSSExportItem::definition(),
                                                null,
                                                array( "id" => $id,
                                                       'status' => $status ),
                                                $asObject );
    }
114504
public function getPublishedStatus()
    {
        /** @var Versioned $obj */
        $obj = $this->owner;

        // get child statuses if applicable
        $relations = Config::inst()->get($obj->ClassName, 'versioned_child_relations');
        $relations = $relations ?: [];
        $childStatuses = [];
        foreach ($relations as $relation) {
            foreach ($obj->$relation() as $item) {
                $childStatuses[] = $item->getPublishedStatus();
            }
        }
        $childStatuses = array_flip(array_unique($childStatuses));

        // [Not versioned] - Object or Children don't have Versioned extension
        if (!$obj->hasExtension(Versioned::class)) {
            return self::STATUS_NOT_VERSIONED;
        }
        if (array_key_exists(self::STATUS_NOT_VERSIONED, $childStatuses)) {
            return 'Child ' . lcfirst(self::STATUS_NOT_VERSIONED);
        }

        // [Not saved] - Object or Child objects are not saved i.e. have an ID = 0
        if ($obj->ID == 0) {
            return self::STATUS_NOT_SAVED;
        }
        if (array_key_exists(self::STATUS_NOT_SAVED, $childStatuses)) {
            return 'Child' . lcfirst(self::STATUS_NOT_SAVED);
        }

        // [Draft] - Object is Draft
        if (Versioned::get_by_stage($obj->ClassName, 'Live')->byID($obj->ID) == null) {
            return self::STATUS_DRAFT;
        }

        // [Modified] - Object is modified or Child objects are modified or draft
        if (!$obj->latestPublished() ||
            array_key_exists(self::STATUS_DRAFT, $childStatuses) ||
            array_key_exists(self::STATUS_MODIFIED, $childStatuses)
        ) {
            return self::STATUS_MODIFIED;
        }

        // [Published] Object and Children are all published
        return self::STATUS_PUBLISHED;
    }
746746
function canModifyStatus( $statusID, $user = false )
    {
        if ( $user === false )
            $user = eZUser::currentUser();
        else if ( is_numeric( $user ) )
            $user = eZUser::fetch( $user );

        if ( !is_object( $user ) )
        {
            eZDebug::writeError( "Cannot check status access without a user", __METHOD__ );
            return false;
        }

        $accessResult = $user->hasAccessTo( 'shop' , 'setstatus' );
        $accessWord = $accessResult['accessWord'];
        $access = false;

        $currentStatusID = $this->attribute( "status_id" );

        if ( $accessWord == 'yes' )
            $access = true;

        if ( $accessWord == 'limited' )
        {
            $limitationList = $accessResult['policies'];
            $access = true;
            foreach ( $limitationList as $pid => $limit )
            {
                $access = true;
                foreach ( $limit as $name => $value )
                {
                    if ( $name == 'FromStatus' )
                    {
                        if ( !in_array( $currentStatusID, $value )  )
                            $access = false;
                    }
                    if ( $name == 'ToStatus' )
                    {
                        if ( !in_array( $statusID, $value ) )
                            $access = false;
                    }
                    if ( !$access )
                        break;
                }
                if ( $access )
                    break;
            }
        }
        return $access;
    }
615871
public function getMatchStatus($matchId) {
        $endpoint = vsprintf('/match/%s', $matchId);
        $requestData = $this->getDefaultRequestData('query', []);

        return $this->sendRequest($endpoint, $requestData, self::HTTP_METHOD_GET);
    }
369318
function pull_status(array $param) {
        static $must = [self::APIKEY];
        $r = $this->verifyParam($param, $must);
        if (!$r->isSucc()) return $r;
        
        $v = $this->version();
        $h = new CommonResultHandler(function ($rsp) use ($v) {
            switch ($v) {
                case self::VERSION_V1:
                    return $rsp[self::VOICE_STATUS];
                case self::VERSION_V2:
                    return $rsp;
            }
            return null;
        });
        return $this->path("pull_status.json")->post($param, $h, $r);
    }