Toggle the "enabled"-state of the Cache.

<p>Returns the previous "enabled"-state of the Cache.</p>

@param boolean $state

@return boolean
6009
public final function enable($state = true){

		$old_state = $this->_enabled;

		$this->_enabled = (bool) $state;

		return $old_state;
	}
1043810
public function get($state) : State
    {
        $this->addCallback('GET', $state);
        if (!isset($this->actions['POST'])) {
            $this->addCallback('POST', $state);
        }
        return $this;
    }
724527
public function toggleOptions($options, $state = null)
    {
        if ($state === null) {
            $state = ($this->options & $options) !== $options;
        }

        return $this->setOptions(
            $state ?
            $this->options | $options :
            $this->options & ~$options
        );
    }
1029867
public function setSelected( $state ) {
		$this->selected = (bool)$state;
		if ( $this->selected ) {
			$this->input->setAttributes( [ 'checked' => 'checked' ] );
		} else {
			$this->input->removeAttributes( [ 'checked' ] );
		}
		return $this;
	}
736594
public function setDebugging( $state = false )
	{
		$existingState = $this->debug;
		$this->debug = $state;
		return $existingState;
	}
258979
public function enableCache($enable = true)
    {
        $this->enableCache = (bool) $enable;

        $this->refreshSettingDependentCriteria();

        return $this;
    }
455971
public function getState($state)
    {
        if ($state instanceof StatableInterface) {
            $state = $state->getState();
        }

        return $this->options['state']['translation'].'.'.$state;
    }
911946
protected function stateHasAfterCallback($state)
    {
        return isset($this->afterMaking[$this->class][$state]) ||
               isset($this->afterCreating[$this->class][$state]);
    }
1265153
public function setState($state)
    {
        $this->complement['state'] = $state;
        $this->states['state'] = $state;
        $this->setStates();

        return $state;
    }
438493
public static function set_StockState( $state )
    {
        if( $state instanceof StockState or null === $state ) {
            $state = StockState::makeFromString( $state );
        }
        return $state;
    }
885722
public function setState($state = null)
        {
            if (null === $state) {
                $this->_state = $state;
                return $this;
            }

            if (in_array($state, array(static::STATE_SUCCESS, static::STATE_ERROR, static::STATE_INFO))) {
                $this->_state = $state;
            }

            return $this;
        }
550064
public function findOptions( $state     = Structure::STATE_ACTIVE,
                                 $confirmed = true )
    {
        $where = array();

        if ( ! empty( $state ) )
        {
            $where['state'] = $state;
        }

        if ( null !== $confirmed )
        {
            $where['confirmed'] = (bool) $confirmed;
        }

        return $this->getMapper()
                    ->findOptions(
                        array(
                            'value'         => 'id',
                            'label'         => 'displayName',
                            'data-email'    => 'email',
                            'data-avatar'   => 'avatar',
                        ),
                        $where,
                        array(
                            'displayName'   => 'ASC',
                            'id'            => 'ASC',
                        )
                    );
    }
990628
public function any($state) : State
    {
        foreach (['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'] as $verb) {
            $this->addCallback($verb, $state);
        }
        return $this;
    }
388180
public function toggleAutoRedirection($enabled)
    {
        $driver = $this->getSession()->getDriver();
        if ($driver instanceof KernelDriver) {
            /** @var Client $client */
            $client = $driver->getClient();

            if ($enabled === 'enabled') {
                $client->followRedirects(true);
            } else {
                $client->followRedirects(false);

            }
        }
    }
1259704
public function changeState($state)
    {
        $availableStates = $this->dbObject('Status')->enumValues();
        if (in_array($state, $availableStates)) {
            $this->Status = $state;
            return true;
        } else {
            user_error(_t('Reservation.STATE_CHANGE_ERROR', 'Selected state is not available'));
            return false;
        }
    }
531103
public function isPlatformReady(MaintenanceState $state = null)
    {
        if (is_null($state)) {
            $state = $this->getPlatformState();
        }
        return ($state->getBooleanStatus() === true);
    }
794040
public function setState($state)
    {
        $oldState = $this->getState()->getUri();
        if ($oldState == $state) {
            common_Logger::w('Delivery execution ' . $this->getIdentifier() . ' already in state ' . $state);
            return false;
        }
        $this->setData(OntologyDeliveryExecution::PROPERTY_STATUS, $state);
        if ($state == DeliveryExecutionInterface::STATE_FINISHED) {
            $this->setData(OntologyDeliveryExecution::PROPERTY_TIME_END, microtime());
        }
        return $this->service->updateDeliveryExecutionStatus($this, $oldState, $state);
    }