Nastavi zdroj pravidlu
@param int $id
@param int $value
@throws AbortException
774825
public function setPermissionResource(int $id, int $value): void
	{
		if ($this->isAjax()) {
			$acl = $this->orm->acl->getById($id);
			$acl->resource = $value;
			$this->orm->persistAndFlush($acl);

			$this->flashNotifier->success('default.dataSaved');

			$this['permissionsList']->redrawItem($id);
		} else {
			$this->terminate();
		}
	}
670689
public static function saveToCache($id, $value)
    {
        $arrayCache = Configuration::getArrayCache();
        $cacheDriver = Configuration::getCacheDriver();

        $arrayCache->save($id, $value);
        if ($cacheDriver !== null) {
            $cacheDriver->save($id, $value);
        }
    }
878915
public function setState(int $id, bool $value): void
	{
		if ($this->isAjax()) {
			$user = $this->orm->users->getById($id);
			$user->active = $value;
			$this->orm->persistAndFlush($user);
			$this['userList']->redrawItem($id);
		} else {
			$this->terminate();
		}
	}
1237755
public function bind( $id, $value = null, $singleton = false ) {
		if ( is_string( $id ) && $this->is_singleton( $id ) ) {
			throw new Exception( sprintf( 'Identifier `%s` is a singleton and cannot be rebind', $id ) );
		}

		if ( is_string( $value ) && class_exists( $value ) ) {
			$closure = new ReflectionClass( $value );
			$value   = $this->call_closure( $closure );
			$closure = function () use ( $value ) {
				return $value;
			};

			$this->bindings[$id] = compact( 'closure', 'singleton' );
			$this->keys[$id]     = true;

			return $value;
		}

		if ( is_object( $id ) && get_class( $id ) !== false ) {
			$value              = $id;
			$id                 = $this->get_class_prefix( get_class( $id ), false );
			$this->classes[$id] = true;
		}

		if ( $value instanceof Closure ) {
			$closure = $value;
		} else {
			$closure = $this->get_closure( $value, $singleton );
		}

		$this->bindings[$id] = compact( 'closure', 'singleton' );
		$this->keys[$id]     = true;

		return $value;
	}
370140
public function offsetSet($id, $value)
    {
        if ($this->locked) {
            throw new BadMethodCallException('Setting values into a locked container is not allowed');
        }

        if ($value instanceof JuiceParam) {
            $this->values[$id] = $value->value;
            return;
        }

        if (is_callable($value) || $value instanceof JuiceDefinition) {
            $this->definitions[$id] = $value;
            return;
        }

        if (is_string($value) && '@' == $value[0]) {
            $this->aliases[$id] = substr($value, 1);
            return;
        }

        $this->values[$id] = $value;
    }
442280
public function inc($id, $value = 1) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$id     = $this->prepareId($id);
		$result = $this->getClient()->increment($id, $value);
		
		if ($result === false && $this->operationsExceptions) {
			throw new OperationFailed('Incrementing of the data in the cache failed, ID: "' . $id . '"');
		}
		
		return $result;
	}
692456
public function set($id, $value) {
		// Format id
		$id = $this->_format($id);
		// Instantiate value
		if(!($value instanceof Value)) {
			$value = new Value($value);
		}
		// Set value
		if(isset($id)) {
			if(!isset($this->values[$id])) {
				$this->values[$id] = $value;
			}
			else {
				$this->values[$id]->setValue($value);
			}
		}
		else {
			$this->values[] = $value;
		}
	}
1240741
public function isValid( $id, $value, $context = null )
    {
        return $this->createRegeneratable( array( 'id' => $id ) )
                    ->isValid( $value, $context );
    }
907206
public function handleDelete(int $id): void
	{
		if ($this->isAjax() && $this->editConst) {
			$content = $this->orm->content->getById($id);
			$this->orm->content->removeAndFlush($content);
			$this['list']->reload();
		} else {
			$this->terminate();
		}
	}
950501
public function save( $id, $value, $ttl = 0 ) {

		$this->count++;
		$this->cacheInserts++;

		if ( $this->contains( $id ) ) {
			$this->count--;
			$this->moveToMostRecentlyUsedPosition( $id );
		} elseif ( $this->count > $this->maxCacheCount ) {
			$this->count--;
			reset( $this->cache );
			unset( $this->cache[ key( $this->cache ) ] );
		}

		$this->cache[ $id ] = $value;
		$this->ttl[ $id ] = $ttl > 0 ? microtime( true ) + $ttl : 0;
	}
390452
public static function async($value, $throw = null)
    {
        if (!self::$self) {
            throw new \BadMethodCallException('Co::async() must be called along with Co::wait(). ');
        }
        if ($throw !== null) {
            $throw = filter_var($throw, FILTER_VALIDATE_BOOLEAN, [
                'flags' => FILTER_NULL_ON_FAILURE,
            ]);
            if ($throw === null) {
                throw new \InvalidArgumentException("\$throw must be null or boolean.");
            }
        }
        self::$self->start($value, false, $throw);
    }
1363078
public function add_param($name, $value, $id = null) {
        if (!$id) {
            $id = $name;
        }
        $this->params[] = [
            'name' => $name,
            'value' => $value,
            'id' => $id
        ];
    }
235434
public function handleDelete(int $id): void
	{
		if ($this->isAjax()) {
			$page = $this->orm->pages->getById($id);
			$parent = $page->parent;
			$this->orm->pages->removeAndFlush($page);
			if ($parent !== null) {
				$this['list']->setDataSource($this->orm->pages->findById($parent->id));
				$this['list']->redrawItem($parent->id);
			} else {
				$this['list']->redrawControl();
			}
		} else {
			$this->terminate();
		}
	}
1369427
public function set(string $id, $value): bool
    {
        return $this->getCache()->set($id, $value);
    }
1119470
public function set($id, $value, $lock = false)
    {
        parent::set($id, $value);

        if ((bool) $lock) {
            $this->lock($id);
        }
    }
422989
public function dec($id, $value = 1) {
		$id = $this->prepareId($id);
		
		return $this->getBackend()->dec($id, $value);
	}
1280261
public function setEndHandler($value) {
        if ($value !== null && !is_callable($value)) {
            throw new \Exception('A function is expected, or null.');
        }

        $this->endHandler = $value;
    }