Get the list of status to update in $statusCollection
Only indexes in $statusCollection are returned

@param array $statusCollection
@param array $formData

@return array
11895
protected function getStatusIndexesToUpdate(array $statusCollection, array $formData)
    {
        $formStatuses = $formData['statuses'];
        $originalStatusesMap = $this->generateStatusesPropertiesMap($statusCollection);

        $newPropertiesIndexes = $this->getStatusIndexesWithNewProperty($originalStatusesMap, $formStatuses);
        $lostPropertiesIndexes = $this->getStatusIndexesWithLostProperty($originalStatusesMap, $formStatuses);

        return array_unique(array_merge($newPropertiesIndexes, $lostPropertiesIndexes));
    }
1011470
public static function response($mdata = array(), $status = null, $msg = '')
    {
        if (is_array($mdata) && isset($mdata['msg']) && isset($mdata['data']) && isset($mdata['status']) && !$status) {
            $status = $mdata['status'];
            $msg = $mdata['msg'];
            $mdata = $mdata['data'];
        }


        if (!$status && count($mdata)) {
            $status = 200;
        } elseif (!$status) {
            $status = 400;
        }


        $response = array(
            'status' => $status,
            'msg' => $msg,
            'data' => $mdata
        );

        return $response;
    }
474045
public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti=false)
    {
        if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) {
            // http_build_query() almost does the job for us. We just
            // need to fix the result of multidimensional arrays.
            return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&'));
        }
        switch ($collectionFormat) {
            case 'pipes':
                return implode('|', $collection);

            case 'tsv':
                return implode("\t", $collection);

            case 'ssv':
                return implode(' ', $collection);

            case 'csv':
                // Deliberate fall through. CSV is default format.
            default:
                return implode(',', $collection);
        }
    }
962348
public function statusExist($status)
    {
        $generator = $this->getStatuses();
        $list = iterator_to_array($generator);

        return in_array($status, $list);
    }
787825
public static boolean containsStatus(final Status status, final Status[] statusArray) {
    if (status == null) {
      return false;
    }

    for (Status currentStatus : statusArray) {
      if (currentStatus == status) {
        return true;
      }
    }

    return false;
  }
1299148
public function updateStatus(string $id, string $code, string $status): array
    {
        return $this->httpClient->postJson('card/invoice/reimburse/updateinvoicestatus', ['card_id' => $id, 'encrypt_code' => $code, 'reimburse_status' => $status]);
    }
224442
private function userHasRequestedARegistrationOnCollection(\collection $collection, $userData)
    {
        if (null === $userRegistration = igorw\get_in($userData, [$collection->get_sbas_id(), $collection->get_base_id()])) {
            return false;
        }

        return !is_null($userRegistration['active']);
    }
997176
private function generateStatusCollection()
    {
        $collection = new StatusCollection();

        /**
         * @var $statuses \SimpleXMLElement
         */
        if (!isset($this->simpleXml->{'statuses'})) {
            throw new MalformedResponseException('Missing statuses in response.');
        }
        $statuses = $this->simpleXml->{'statuses'};
        if (count($statuses->{'status'}) > 0) {
            foreach ($statuses->{'status'} as $statusNode) {
                /**
                 * @var $statusNode \SimpleXMLElement
                 */
                $attributes = $statusNode->attributes();

                if ((string)$attributes['code'] !== '') {
                    $code = (string)$attributes['code'];
                } else {
                    throw new MalformedResponseException('Missing status code in response.');
                }
                if ((string)$attributes['description'] !== '') {
                    $description = (string)$attributes['description'];
                } else {
                    throw new MalformedResponseException('Missing status description in response.');
                }
                if ((string)$attributes['severity'] !== '') {
                    $severity = (string)$attributes['severity'];
                } else {
                    throw new MalformedResponseException('Missing status severity in response.');
                }
                $status = new Status($code, $description, $severity);
                $collection->add($status);
            }
        }

        return $collection;
    }
174694
public function check_data($formdata) {
        $field = $this->_name;
        // Check if disable if options are set. if yes then don't add this..
        if (!empty($this->disableelements) && is_array($this->disableelements)) {
            foreach ($this->disableelements as $disableelement) {
                if (array_key_exists($disableelement, $formdata)) {
                    return false;
                }
            }
        }
        if (array_key_exists($field, $formdata) and $formdata->$field !== '') {
            return array('value' => (string)$formdata->$field);
        }
        return false;
    }
555251
public function getChildrenByStatus($status)
    {
        $children = new ArrayCollection();
        foreach ($this->getChildren() as $child) {
            if ($status === Page::STATUS_PUBLISHED) {
                if ($child->getPage() && !$child->getPage()->getSnapshot()) {
                    continue;
                }
            }
            $children->add($child);
        }

        return $children;
    }
801108
private function getStatusIndex($statusname)
    {
        $status_count = count($this->states);
        for ($i = 0; $i < $status_count; ++$i) {
            if ($this->states[$i]->getName() == $statusname) {
                return $i;
            }
        }
    }
102141
protected function listStatuses(StatusableInterface $document)
    {
        $possibleStatuses = array($document->getStatus());
        $availableStatus = $this->get('open_orchestra_model.repository.status')->findAll();

        foreach ($availableStatus as $status) {
            if ($status->getId() != $document->getStatus()->getId()
                && $this->isGranted($status, $document)
            ) {
                $possibleStatuses[] = $status;
            }
        }

        return $this->get('open_orchestra_api.transformer_manager')->transform('status_collection', $possibleStatuses);
    }
623170
public function listAll()
    {
        try {
            $ret    = array();
            $result = $this->getSoapClient()->ListTemplates();
            if ( isset($result->ListTemplatesResult) ) {
                $ret = $this->getSoapClient()->backendListArrayToMultiAssocArray($result->ListTemplatesResult);
            }

            return $ret;
        } catch ( SoapException $ex ) {
            throw new StatusException('Error while getting the list of all uploaded templates' , $ex);
        }
    }
778242
public function check_data($formdata) {
        $field    = $this->_name;
        $operator = $field.'_op';

        if (array_key_exists($operator, $formdata)) {
            if ($formdata->$operator != 5 and $formdata->$field == '') {
                // No data - no change except for empty filter.
                return false;
            }
            // If field value is set then use it, else it's null.
            $fieldvalue = null;
            if (isset($formdata->$field)) {
                $fieldvalue = $formdata->$field;
            }
            return array('operator' => (int)$formdata->$operator, 'value' => $fieldvalue);
        }

        return false;
    }
1041025
public function withStatus(string $status)
    {
        Assert::oneOf($status, [
            Status::ANY,
            Status::ACTIVE,
            Status::OPEN,
            Status::CLOSED,
            Status::PENDING,
            Status::SPAM,
        ]);

        $filters = clone $this;
        $filters->status = $status;

        return $filters;
    }
1206015
public function getByStatus($status)
    {
        $components = [];

        foreach ($this->all() as $name => $component) {
            if ($component->isStatus($status)) {
                $components[$name] = $component;
            }
        }

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

        return $this->cachedStatuses[$statusId];
    }