{@inheritDoc}

@throws LogicException if the manipulation table's ID is missing
559346
public function augmentWrite(&$manipulation)
    {
        $locale = Locale::getCurrentLocale();
        if (!$locale) {
            return;
        }

        // Get all tables to translate fields for, and their respective field names
        $includedTables = $this->getLocalisedTables();
        foreach ($includedTables as $table => $localisedFields) {
            $localeTable = $this->getLocalisedTable($table);
            $this->localiseManipulationTable(
                $manipulation,
                $table,
                $localeTable,
                $localisedFields,
                $locale
            );
        }
    }
944601
public function setHidden($hidden)
    {
        if ($this->autocompleterCallback) {
            throw new LogicException('A hidden question cannot use the autocompleter.');
        }

        $this->hidden = (bool) $hidden;

        return $this;
    }
221593
public function unserialize($value) : void
    {
        if (isset($this->numerator)) {
            throw new \LogicException('unserialize() is an internal function, it must not be called directly.');
        }

        [$numerator, $denominator] = \explode('/', $value);

        $this->numerator   = BigInteger::of($numerator);
        $this->denominator = BigInteger::of($denominator);
    }
542888
public function setDefault($default = null)
    {
        if (self::REQUIRED === $this->mode && null !== $default) {
            throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
        }

        if ($this->isArray()) {
            if (null === $default) {
                $default = [];
            } elseif (!\is_array($default)) {
                throw new LogicException('A default value for an array argument must be an array.');
            }
        }

        $this->default = $default;
    }
436606
public function passes()
    {
        if (!($this->validator instanceof \Illuminate\Validation\Validator)) {
            throw new LogicException('No model was set. Nothing to validate.');
        }

        return $this->getValidator()->passes();
    }
1261804
public function getModel()
    {
        if (empty($this->model)) {
            throw new LogicException(
                sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'model')
            );
        }
        return $this->model;
    }
460492
public function get($class, $identifier)
    {
        $id = $this->getId($class, $identifier);
        if (!$id) {
            return null;
        }

        // If the class doesn't exist, look for a table instead
        if (!class_exists($class)) {
            $tableNames = DataObject::getSchema()->getTableNames();
            $potential = array_search($class, $tableNames);
            if (!$potential) {
                throw new \LogicException("'$class' is neither a class nor a table name");
            }
            $class = $potential;
        }

        return DataObject::get_by_id($class, $id);
    }
248940
public function find($identity)
    {
        if( !$this->primaryKey ) {
            throw new LogicException('No primary key!');
        }
        return $this->select()
                ->where($this->primaryKey, $identity)
                ->limit(1)
                ->query()
                ->fetchRow();
    }
706469
public function toModel()
    {
        $nodeClass = $this->getElement()->NodeClass;
        if ($nodeClass === 'Node') {
            throw new LogicException('You must set a custom node in <node_class/> for element: ' . $this->getElement()->getSlug());
        } else {
            throw new LogicException('You must create a toModel method in: ' . $nodeClass);
        }
    }
1360335
public function beforeCompile(): void
	{
		$builder = $this->getContainerBuilder();

		if ($builder->getByType(User::class) === null) {
			throw new LogicException(sprintf('Service of type "%s" is needed. Please register it.', User::class));
		}

		if ($builder->getByType(EventDispatcherInterface::class) === null) {
			throw new LogicException(sprintf('Service of type "%s" is needed. Please register it.', EventDispatcherInterface::class));
		}

		$user = $builder->getDefinition($builder->getByType(User::class));
		$dispatcher = $builder->getDefinition($builder->getByType(EventDispatcherInterface::class));

		$user->addSetup('?->onLoggedIn[] = function() {?->dispatch(?, new ?(...func_get_args()));}', [
			'@self',
			$dispatcher,
			SecurityEvents::ON_LOGGED_IN,
			new PhpLiteral(LoggedInEvent::class),
		]);
		$user->addSetup('?->onLoggedOut[] = function() {?->dispatch(?, new ?(...func_get_args()));}', [
			'@self',
			$dispatcher,
			SecurityEvents::ON_LOGGED_OUT,
			new PhpLiteral(LoggedOutEvent::class),
		]);
	}
1002400
public function force($request_controller, $request_action = 'index') {
        $this->controller = $request_controller;
        $this->action = $request_action;
        
        $handler = $this->loadController();
        
        if ( !$handler ) {
            throw new LogicException(sprintf('No se existe la clase del controlador (%s)', $this->controller));
        }
        
        if ( !method_exists($handler, $this->action) ) {
            $reflection = new \ReflectionClass($handler);

            throw new LogicException(sprintf('No existe el m&eacute;todo (%s) del controlador (%s)', 
                    $this->action, $reflection->getName()), ['controller' => $handler]);
        }
        
        return $handler;
    }
902635
public function renameTable($oldTableName, $newTableName)
    {
        if (!$this->hasTable($oldTableName)) {
            throw new LogicException('Table ' . $oldTableName . ' does not exist.');
        }

        return $this->query("ALTER TABLE \"$oldTableName\" RENAME \"$newTableName\"");
    }
944549
public function save()
    {
        if (!$this->path)
        {
            return;
        }
        while (count($this->actionQueue))
        {
            $action = array_shift($this->actionQueue);
            $methodName = 'action' . $action['action'];
            if (!method_exists($this, $methodName))
            {
                throw new LogicException('Unknown action: ' . $action['action']);
            }
            call_user_func_array(array($this, $methodName), $action['args']);
        }
        if ($this->phpThumb)
        {
            $this->phpThumb->save($this->path);
        }
    }
623363
public function process(
        ObjectInterface $object,
        ResolvedFixtureSet $fixtureSet,
        GenerationContext $context,
        MethodCallInterface $methodCall
    ): ResolvedFixtureSet {
        /** @var StaticReference $reference */
        $reference = $methodCall->getCaller();

        if (false === ($reference instanceof StaticReference)) {
            throw new \LogicException('TODO');
        }

        $result = $reference->getId()::{$methodCall->getMethod()}(...$methodCall->getArguments());

        if ($context->needsCallResult()) {
            $object = $object->withInstance($result);
        }

        return $fixtureSet->withObjects(
            $fixtureSet->getObjects()->with($object)
        );
    }
256093
public function insert()
    {
        if( !$this->tableName ) {
            throw new LogicException('No table name specified');
        }
        return $this->database->insert()
                ->table($this->tableName);
    }
1153794
public function update(DataAbstract $data)
    {
        if (!$data->isUpdated()) {
            return false;
        }

        //~ Reset binded fields
        $this->binds = array();

        foreach ($this->primaryKeys as $key) {
            $this->addWhere($key, $this->getDataValue($data, $key));
        }

        $set = $this->getQueryFieldsSet($data);
        if (empty($set)) {
            return false;
        }

        $where = $this->getQueryWhere();
        if (empty($where)) {
            throw new \LogicException(__METHOD__ . '|Where clause is empty!');
        }

        $query     = 'UPDATE ' . $this->getTable() . ' ' . $set . ' ' . $where;
        $statement = $this->db->prepare($query);
        $statement->execute($this->binds);

        //~ Reset some data
        $data->resetUpdated();

        //~ Clear
        $this->clear();
        $this->deleteCache($data);

        return true;
    }
1022500
public function serialize()
    {
        if ($this->getHandler() instanceof Closure) {
            throw new LogicException('Cannot serialize handler.');
        }

        return serialize(array_combine(static::$keys, array_map(function ($key) {
            return call_user_func([$this, 'get'.ucfirst($key)]);
        }, static::$keys)));
    }