Sets the result code for one or more properties.

@param string|string[] $properties
@param int             $resultCode
321100
public function setResultCode($properties, $resultCode)
    {
        foreach ((array) $properties as $propertyName) {
            $this->result[$propertyName] = $resultCode;
        }

        if ($resultCode >= 400) {
            $this->failed = true;
        }
    }
349704
public function setProperties($propValues)
    {
        foreach ($propValues as $propName => $propValue) {
            if (property_exists($this, $propName)) {
                $this->{$propName} = $propValue;
            } else {
                $this->throwException('Property "%propName%" does not exist in class "%className%"', array(
                    '%propName%'  => $propName,
                    '%className%' => static::className(),
                ));
            }
        }
    }
482487
public function setExitCode($exitCode)
    {
        $this->exitCode = (int) $exitCode;

        $r = new \ReflectionProperty($this->error, 'code');
        $r->setAccessible(true);
        $r->setValue($this->error, $this->exitCode);
    }
1245243
public function setCode($code)
    {
        if ($code instanceof PagSeguroPaymentMethodCode) {
            $this->code = $code;
        } else {
            $this->code = new PagSeguroPaymentMethodCode($code);
        }
    }
819127
public function setExitCode(int $code): void
    {
        if (isset($this->protocol)) {
            $this->protocol->writeExitCode($code);
        }
    }
1288307
protected function setObjectProperties(array $properties, $data, array &$out = [])
    {
        foreach ($properties as $property) {
            $prop =  $property->getName();

            if (in_array($name = $this->normalize($prop), $this->ignoredAttributes)) {
                continue;
            }

            $out[$prop] = $this->getObjectPropertyValue($property, $prop, $data);
        }
    }
494208
protected function setProperties(array $properties = [])
    {
        foreach ($properties as $name => $value) {
            // set property
            if (property_exists($this, $name)) {
                $this->$name = $value;

            // unknown property found
            } else {
                trigger_error(
                    sprintf(
                        'unknown property "%s" for "%s"',
                        $name,
                        get_class($this)
                    ),
                    E_USER_WARNING
                );
            }
        }
    }
1371718
public function setCode($code)
    {
        if (!is_scalar($code)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Wrong parameters for %s([int|string $code]); %s given.',
                    __METHOD__,
                    is_object($code) ? get_class($code) : gettype($code)
                ),
                E_ERROR
            );
        }

        $this->code = $code;

        return $this;
    }
1105673
protected function setProperties()
    {
        // Fetch request query string values passed by an API client.
        list($limit, $offset) = $this->paramBag->get('limit');
        list($sortKey, $sortDirection) = $this->paramBag->get('sort');

        // If nothing is passed by API client,
        // falling back to class property's value.
        $this->limit = $limit ?: $this->limit;
        $this->offset = $offset ?: $this->offset;
        $this->sortKey = $sortKey ?: $this->sortKey;
        $this->sortDirection = $sortDirection ?: $this->sortDirection;
    }
778478
public function setProperties(array $properties = [])
    {
        foreach ($properties as $property => $value) {
            $method = 'set'.ucfirst($property);
            if (!method_exists($this, $method)) {
                throw new \RuntimeException("Undefined method $method.");
            }

            if (!in_array($property, $this->validProperties)) {
                throw new \Exception('You are trying to set invalid properties. Please check valid properties.');
            }

            $this->{$method}($value);
        }
    }
1161553
public function setResult($result = self::RESULT_SUCCESS,
                              $message = null,
                              array $data = [],
                              array $additional = [])
    {
        $this->headers->set('X-Phlexible-Response', 'result');

        $values = [
            'success' => $result,
            'msg' => $message,
            'data' => $data,
        ];

        if (is_array($additional) && count($additional)) {
            foreach ($additional as $key => $value) {
                $values += $additional;
            }
        }

        $this->setData($values);
    }
851821
public function setStateCodeAttribute($code)
    {
        if (!$state = State::whereCode($code)->first()) {
            return;
        }

        $this->model->state = $state;
    }
1221918
public function set($propertyName, $value, $status = null)
    {
        if (is_null($status)) {
            $status = is_null($value) ? 404 : 200;
        }
        $this->result[$propertyName] = [$status, $value];
    }
1001154
private static function addToResultArray(
        string $propertyName,
        $propertyValue,
        array $propertyNameMapper,
        array $resultArray
    ) {
        $mappedName = $propertyNameMapper[$propertyName]['name'] ?? $propertyNameMapper[$propertyName] ?? $propertyName;

        $resultArray[$mappedName] = self::isNestedData($propertyValue)
            ? self::toArray($propertyValue, $propertyNameMapper[$propertyName]['mapper'] ?? [])
            : $propertyValue;

        return $resultArray;
    }
1288744
@Override
    public void setResultProperties(AbstractWrapperIdPages results) {
        super.setResultProperties(results);
        results.setPage(page);
        results.setTotalPages(totalPages);
        results.setTotalResults(totalResults);
    }
736346
protected function setCountry($code)
    {
        $this->data_country = $this->country->get($code);

        if (empty($this->data_country)) {
            $this->outputHttpStatus(404);
        }
    }
861363
public function addProperty($name, $initialValueCode, $visibility = 'private', $docComment = '')
    {
        $this->properties[$name] = [
            'initialValueCode' => $initialValueCode,
            'visibility' => $visibility,
            'docComment' => $docComment
        ];
    }