Set the value of an indicator

@param int    $ind   number of the indicator (1 or 2)
@param string $value value of the indicator

@return string       returns indicator value if it exists, otherwise false
199601
function setIndicator($ind, $value)
    {
        switch ($ind) {

        case 1:
            $this->ind1 = $this->_validateIndicator($value);
            break;

        case 2:
            $this->ind2 = $this->_validateIndicator($value);
            break;

        default:
            $errorMessage = File_MARC_Exception::formatError(File_MARC_Exception::$messages[File_MARC_Exception::ERROR_INVALID_INDICATOR_REQUEST], array("indicator" => $ind));
            throw new File_MARC_Exception($errorMessage, File_MARC_Exception::ERROR_INVALID_INDICATOR_REQUEST);
            return false;
        }

        return $this->getIndicator($ind);
    }
93431
public static function intValue($value): bool
    {
        if (!is_numeric($value)) {
            return false;
        }

        return strval(intval($value)) == $value;
    }
588495
public function setProjectId($value)
    {
        $this->_validateNotNull('ProjectId', $value);
        $this->_validateInt('ProjectId', $value);

        if ($this->data['project_id'] === $value) {
            return;
        }

        $this->data['project_id'] = $value;

        $this->_setModified('project_id');
    }
216533
public function setValue($value)
    {
        if ($value instanceof DateInterval) {
            $value = Utils::now()->add($value);
        }

        if ($value instanceof DateTimeInterface) {
            $value = $value->getTimestamp();
        }

        return parent::setValue($value);
    }
802050
public function setInt(string $key, int $value): self
    {
        $this->set($key, intval($value));
        return $this;
    }
1027275
public function indexOf($value)
    {
        $count = $this->count();
        for ($i = 0; $i < $count; ++$i) {
            if ($value === $this->source[$i]) {
                return $i;
            }
        }
        throw new OutOfBoundsException("Value $value not found");
    }
1192614
public function setIndividual($value)
    {
        if ($value && !$value instanceof MerchantIndividual) {
            $value = new MerchantIndividual($value);
        }

        return $this->setParameter('individual', $value);
    }
709234
private function getInt32Value($value)
    {
        if ($value > self::$int32Max || $value < -self::$int32Max - 1) {
            return false;
        }

        return (int) $value;
    }
633259
public function setValue($value)
    {
        $this->value = [];

        $token = ' ,;';
        $values = strtok($value, $token);

        while ($values !== false) {
            $this->value[] = $values;
            $values = strtok($token);
        }
    }
662789
public static function toInt($value)
    {
        $letter_signs = array('P', 'M');
        $numeric_signs = array('', '-');

        $value_numeric = str_replace($letter_signs, $numeric_signs, $value);

        if (preg_match('#^[\-0-9]#', $value_numeric)) {
            return intval($value_numeric);
        } else {
            return;
        }
    }
655867
public function setNumber($value)
    {
        $name = $this->getName();
        $this->setCallerIdVariable('num', $value);
        $this->setCallerIdVariable('all', "$name<$value>");
    }
1226566
protected function _validate_int($value)
    {
        if (is_int($value)) {
            return $value;
        }

        return preg_match('#^[+-]?\d+$#', $value) ? (int)$value : null;
    }
361387
public function setValue($value)
	{
		// any preparation goes here, for example casting to int
		$errors = $this->getValidationErrors($value);
		// if specific validation existed would go here & if
		// anything goes wrong will put error message into errors
		if(!empty($errors))
			throw $this->getContext()->getModel('ValidationException', 'Form', array(($errors)));
		return $value;
	}
966568
public function setType(?int $value) : Log
    {

        if ($this->data['type'] !== $value) {
            $this->data['type'] = $value;
            $this->setModified('type');
        }

        return $this;
    }
33192
public function get($value) {
        //TODO throw exception instead?!
        if (\is_int($value)) {
            $info = $this->getIndexAndMask($value);
            $i = $info["i"];
            $k = $info["k"];

            $flag = 1;
            $flag = $flag << $k;

            if (isset($this->array[$i])) return (($this->array[$i] & $flag) !== 0);
            return false;
        }
        return false;
    }
793889
public static function isInt($value) {
        if(is_object($value)) {
            $value = Assert::isString($value);
        }
        if(is_int($value)) {
            return $value;
        } elseif(is_scalar($value) && preg_match('@^-?[0-9]+$@', $value)) {
            return (int)$value;
        } else {
            throw new \InvalidArgumentException('Must be Int: ' . print_r($value, true));
        }
    }
981916
public function setValue($value, EntityInterface $entity = null)
    {
        $attribute_validator = $this->getAttribute()->getValidator();
        $validation_result = $attribute_validator->validate($value, $entity);

        if ($validation_result->getSeverity() <= IncidentInterface::NOTICE) {
            $previous_native_value = $this->toNative();
            $this->value = $validation_result->getSanitizedValue();

            if (!$this->sameValueAs($previous_native_value)) {
                $value_changed_event = $this->createValueHolderChangedEvent($previous_native_value);
                $this->propagateValueChangedEvent($value_changed_event);
            }

            if ($this->value instanceof CollectionInterface) {
                $this->value->addListener($this);
            }
            if ($this->value instanceof EntityList) {
                $this->value->addEntityChangedListener($this);
            }
        }

        return $validation_result;
    }