Sets upload size limit
@param int $value
@return \ZfTusServer\Server
@throws \BadMethodCallException
778427
public function setAllowMaxSize($value) {
        $value = intval($value);
        if ($value > 0) {
            $this->allowMaxSize = $value;
        } else {
            throw new \BadMethodCallException('given $value must be integer, greater them 0');
        }
        return $this;
    }
74445
public function setSharedMaxAge(int $value): self
    {
        $this->setPublic();
        $this->header->addCacheControlDirective('s-maxage', $value);

        return $this;
    }
118198
public static function setMaxStep($value)
    {
        Session::set(self::classNameWithoutNumber() . '.maxStep', (int) $value);
        return Session::save();
    }
968193
public function setGrayscaleSaturation($value)
    {
        if (!is_numeric($value) ||
            $value < 0 || $value > 1
        ) {
            throw new \InvalidArgumentException(
                "The grayscale saturation was invalid. ".
                "Only values in the range [0.0, 1.0] are allowed.");
        }
        $this->grayscaleSaturation = (float)$value;
        return $this;
    }
1239670
public function setHash($value) {
        // TODO: freeze the instance after configuration and automatically call copy()

        if (isset($value)) {
            if (!is_scalar($value)) throw new IllegalTypeException('Illegal type of parameter $value: '.gettype($value));
            if (is_bool($value))
                $value = (int) $value;
        }
        $value = (string) $value;
        $path = $this->getPath();
        $this->setPath(strLeftTo($path, '#', $count=1, $includeLimiter=false, $onNotFound=$path).'#'.$value);

        return $this;
    }
798388
public function setMultipleOption($value, $dc)
	{
		$db = Database::getInstance();
		
		if ($value > 3 && $dc->activeRecord->maxLength > 200)
		{
			// change maxLegth in database
			$db->prepare("UPDATE " . $this->table . " SET maxLength=? WHERE id=?")
			   ->execute(200, $dc->activeRecord->id);
		}
		
		return $value;
	}
551031
public function computeZigzag32Size($value)
    {
        $varint = ($value << 1) ^ ($value >> 32 - 1);
        $size   = $this->computeVarintSize($varint);

        return $size;
    }
1351873
public function setLimit(int $limit)
    {
        $this->limit = $limit;
        if ($this->limit < $this->batchSize) {
            $this->batchSize = $this->limit;
        }

        return $this;
    }
857997
public function setCoreUploadFlash($value)
    {
        $this->setFieldName('upload_flash');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1248102
protected function validateValueSize($value){

		// Serialize the value being saved to get a byte-stream string.
		// Strlen returns number of bytes in a string.
		$size = strlen(serialize($value));

		// The limit for values is 4 MB.
		$allowed = 1024 * 1024 * 4;
		if($size > $allowed){

			return false;
		}

		return true;
	}
330647
public function setOption($option, $value) {
        switch ($option) {
            case self::OPT_THREAD_FLAGS:
                $this->setThreadStartFlags($value); break;
            case self::OPT_POOL_SIZE_MIN:
                $this->setPoolSizeMin($value); break;
            case self::OPT_POOL_SIZE_MAX:
                $this->setPoolSizeMax($value); break;
            case self::OPT_TASK_TIMEOUT:
                $this->setTaskTimeout($value); break;
            case self::OPT_IDLE_WORKER_TIMEOUT:
                $this->setIdleWorkerTimeout($value); break;
            case self::OPT_EXEC_LIMIT:
                $this->setExecutionLimit($value); break;
            case self::OPT_IPC_URI:
                $this->setIpcUri($value); break;
            case self::OPT_UNIX_IPC_DIR:
                $this->setUnixIpcSocketDir($value); break;
            default:
                throw new \DomainException(
                    sprintf('Unknown option: %s', $option)
                );
        }

        return $this;
    }
1013663
private function setLimit()
    {
        if (isset($this->requestParams['start']) && -1 != $this->requestParams['length']) {
            $this->qb->setFirstResult($this->requestParams['start'])->setMaxResults($this->requestParams['length']);
        }

        return $this;
    }
376077
public function setCoreFriendlyAliasMaxLength($value)
    {
        $this->setFieldName('friendly_alias_max_length');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
665715
public function validate($value) {
        if(!is_string($value)) {
            throw new DataType('value', 'string', $value);
        }
        
        try {
            $filesize = @filesize($value);            
        } catch (Exception $ex) {
            $filesize = false;
        }

        if($filesize===false) {
            throw new \Wellid\Exception\FileNotFound($value, 'file for Filesize validator');
        }
        
        if($filesize>$this->max) {
            return new ValidationResult(false, 'File is too large');
        }

        return new ValidationResult(true);
    }
955662
public function limit($value, $offset = null)
	{
		if($value >= 0)
		{
			$property = $this->unions ? 'unionLimit' : 'limit';
			$this->$property = $value;
		}
		if( is_int($offset) )
		{
			$this->offset($offset);
		}

		return $this;
	}
503080
public function setConfigAttribute($value)
    {
        $this->config = (array)$value;
        $localConfig = $this->getAttributeFromArray('config');
        $localConfig = ($localConfig ? json_decode($localConfig, true) : []);
        // take the type information and get the config_handler class
        // set the config giving the service id and new config
        if (!empty($serviceCfg = $this->getConfigHandler())) {
            // go ahead and save the config here, otherwise we don't have key yet
            $localConfig = $serviceCfg::setConfig($this->getKey(), $this->config, $localConfig);
            if ($this->isJsonCastable('config') && !is_null($localConfig)) {
                $localConfig = $this->castAttributeAsJson('config', $localConfig);
            }
            $this->attributes['config'] = $localConfig;

        } else {
            if (null !== $typeInfo = ServiceManager::getServiceType($this->type)) {
                if ($subscription = $typeInfo->subscriptionRequired()) {
                    throw new BadRequestException("Provisioning Failed. '$subscription' subscription required for this service type.");
                }
            }
        }
    }
890640
public function setAge($value)
    {
        if ($value === null) {
            $this->parameters['age'] = null;
        } else {
            validators\Number::validate($value, 0, null, 'Invalid age');
            $this->parameters['age'] = max(0, (int)$value);
        }
        return $this;
    }