@param \Interpro\Core\Contracts\Executor\CUpdateExecutor

@return void
768601
public function registerCUpdateExecutor(CUpdateExecutor $updateExecutor)
    {
        $family = $updateExecutor->getFamily();

        if(array_key_exists($family, $this->updateExecutorsC))
        {
            throw new CoreException('Исполнитель изменений (update executor) простых(С) типов пакета '.$family.' уже зарегестрирована в медиаторе!');
        }

        $this->updateExecutorsC[$family] = $updateExecutor;
    }
931568
public function execute()
	{
		$this->connect();

		if (!is_object($this->connection))
		{
			$this->log(
				Log\LogLevel::ERROR,
				'Database query failed (error #{code}): {message}',
				array('code' => $this->errorNum, 'message' => $this->errorMsg)
			);
			throw new \RuntimeException($this->errorMsg, $this->errorNum);
		}

		// Take a local copy so that we don't modify the original query and cause issues later
		$sql = $this->replacePrefix((string) $this->sql);

		if ($this->limit > 0 || $this->offset > 0)
		{
			// @TODO
			$sql .= ' LIMIT ' . $this->offset . ', ' . $this->limit;
		}

		// Increment the query counter.
		$this->count++;

		// If debugging is enabled then let's log the query.
		if ($this->debug)
		{
			// Add the query to the object queue.
			$this->log(
				Log\LogLevel::DEBUG,
				'{sql}',
				array('sql' => $sql, 'category' => 'databasequery', 'trace' => debug_backtrace())
			);
		}

		// Reset the error values.
		$this->errorNum = 0;
		$this->errorMsg = '';

		// Execute the query.
		$this->executed = false;

		if ($this->prepared instanceof \PDOStatement)
		{
			// Bind the variables:
			if ($this->sql instanceof PreparableInterface)
			{
				$bounded =& $this->sql->getBounded();

				foreach ($bounded as $key => $obj)
				{
					$this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions);
				}
			}

			$this->executed = $this->prepared->execute();
		}

		// If an error occurred handle it.
		if (!$this->executed)
		{
			// Get the error number and message before we execute any more queries.
			$errorNum = (int) $this->connection->errorCode();
			$errorMsg = (string) 'SQL: ' . implode(", ", $this->connection->errorInfo());

			// Check if the server was disconnected.
			if (!$this->connected())
			{
				try
				{
					// Attempt to reconnect.
					$this->connection = null;
					$this->connect();
				}
				catch (\RuntimeException $e)
				// If connect fails, ignore that exception and throw the normal exception.
				{
					// Get the error number and message.
					$this->errorNum = (int) $this->connection->errorCode();
					$this->errorMsg = (string) 'SQL: ' . implode(", ", $this->connection->errorInfo());

					// Throw the normal query exception.
					$this->log(
						Log\LogLevel::ERROR,
						'Database query failed (error #{code}): {message}',
						array('code' => $this->errorNum, 'message' => $this->errorMsg)
					);
					throw new \RuntimeException($this->errorMsg, $this->errorNum);
				}

				// Since we were able to reconnect, run the query again.
				return $this->execute();
			}
			else
			// The server was not disconnected.
			{
				// Get the error number and message from before we tried to reconnect.
				$this->errorNum = $errorNum;
				$this->errorMsg = $errorMsg;

				// Throw the normal query exception.
				$this->log(
					Log\LogLevel::ERROR,
					'Database query failed (error #{code}): {message}',
					array('code' => $this->errorNum, 'message' => $this->errorMsg)
				);
				throw new \RuntimeException($this->errorMsg, $this->errorNum);
			}
		}

		return $this->prepared;
	}
173096
private function setValue(\DateTimeImmutable $value = null): void
    {
        if ($value === null) {
            $this->value = null;

            return;
        }

        $this->value = $value->setTime(0, 0, 0);
    }
473708
public function run()
	{
		$context = $this->getContext();
		$config = $context->getConfig();
		$logger = $context->getLogger();

		$names = (array) $config->get( 'controller/common/subscription/process/processors', [] );

		$date = date( 'Y-m-d' );
		$processors = $this->getProcessors( $names );
		$manager = \Aimeos\MShop::create( $context, 'subscription' );

		$search = $manager->createSearch( true );
		$expr = [
			$search->compare( '<=', 'subscription.datenext', $date ),
			$search->combine( '||', [
				$search->compare( '==', 'subscription.dateend', null ),
				$search->compare( '>', 'subscription.dateend', $date ),
			] ),
			$search->getConditions(),
		];
		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSortations( [$search->sort( '+', 'subscription.id' )] );

		$start = 0;

		do
		{
			$search->setSlice( $start, 100 );
			$items = $manager->searchItems( $search );

			foreach( $items as $item )
			{
				try
				{
					$context = $this->createContext( $item->getOrderBaseId() );
					$newOrder = $this->createOrderBase( $context, $item );
					$newInvoice = $this->createOrderInvoice( $context, $newOrder );

					try
					{
						$this->createPayment( $context, $newOrder, $newInvoice );

						$interval = new \DateInterval( $item->getInterval() );
						$item->setDateNext( date_create()->add( $interval )->format( 'Y-m-d' ) );
					}
					catch( \Exception $e )
					{
						$item->setReason( \Aimeos\MShop\Subscription\Item\Iface::REASON_PAYMENT );
						$item->setDateEnd( date_create()->format( 'Y-m-d' ) );
						$manager->saveItem( $item );

						throw $e;
					}

					$manager->saveItem( $item );

					foreach( $processors as $processor ) {
						$processor->renew( $item, $newInvoice );
					}
				}
				catch( \Exception $e )
				{
					$msg = 'Unable to process subscription with ID "%1$s": %2$s';
					$logger->log( sprintf( $msg, $item->getId(), $e->getMessage() ) );
					$logger->log( $e->getTraceAsString() );
				}
			}

			$count = count( $items );
			$start += $count;
		}
		while( $count === $search->getSliceSize() );
	}
1260956
public function onBeforePublish()
    {
        /**
         * @var DBDatetime $publishDate
         */
        $publishDate = $this->dbObject('PublishDate');
        if (!$publishDate->getValue()) {
            $this->PublishDate = DBDatetime::now()->getValue();
            $this->write();
        }

        $this->Summary = trim($this->Summary);

        $this->extend('onBeforePublish');
    }
1214260
public function populateDefaults()
    {
        if (!isset($this->Date) || $this->Date === null) {
            $this->Date = DBDatetime::now()->Format('y-MM-dd');
        }

        if (!isset($this->StartTime) || $this->StartTime === null) {
            $this->StartTime = '09:00:00';
        }

        if (!isset($this->EndTime) || $this->EndTime === null) {
            $this->EndTime = '17:00:00';
        }

        parent::populateDefaults();
    }
875886
public function execute(array $rule, $groupOperator = 'OR')
    {
        $queryBuilder = $this->grid->getQueryBuilder();
        $date = \DateTime::createFromFormat($this->grid->getDatePickerPhpFormat(), $rule['data']);

        $queryBuilder
                ->andWhere(
                        $queryBuilder->expr()->gte($this->column->getFieldIndex(), ":{$this->column->getFieldName()}_1"))
                ->setParameter("{$this->column->getFieldName()}_1", $date->format('Y-m-d 00:00:00'));

        $queryBuilder
                ->andWhere(
                        $queryBuilder->expr()->lte($this->column->getFieldIndex(), ":{$this->column->getFieldName()}_2"))
                ->setParameter("{$this->column->getFieldName()}_2", $date->format('Y-m-d 23:59:59'));
    }
417854
protected function updateTimestamps() {
        $time = $this->freshTimestamp();
        if ($this->isEmpty(static::UPDATED_AT)
            && $this->hasColumn(static::UPDATED_AT)) {
            $this->setUpdatedAt($time);
        }

        if ($this->isNewRecord
            && $this->isEmpty(static::CREATED_AT)
            && $this->hasColumn(static::CREATED_AT)) {
            $this->setCreatedAt($time);
        }
    }
505820
public function onBeforePublish()
    {
        /**
         * @var DBDatetime $publishDate
         */
        $publishDate = $this->dbObject('PublishDate');

        if (!$publishDate->getValue()) {
            $this->PublishDate = DBDatetime::now()->getValue();
            $this->write();
        }
    }
1311371
public function findActionAfterDate(
        $action,
        $date,
        $doerId = null,
        $resourceId = null,
        $workspaceId = null,
        $receiverId = null,
        $roleId = null,
        $groupId = null,
        $toolName = null,
        $userType = null
    ) {
        $queryBuilder = $this
            ->createQueryBuilder('log')
            ->orderBy('log.dateLog', 'DESC')

            ->andWhere('log.action = :action')
            ->setParameter('action', $action)

            ->andWhere('log.dateLog >= :date')
            ->setParameter('date', $date);

        if (null !== $doerId) {
            $queryBuilder
                ->leftJoin('log.doer', 'doer')
                ->andWhere('doer.id = :doerId')
                ->setParameter('doerId', $doerId);
        }

        if (null !== $resourceId) {
            $queryBuilder
                ->leftJoin('log.resource', 'resource')
                ->andWhere('resource.id = :resourceId')
                ->setParameter('resourceId', $resourceId);
        }

        if (null !== $workspaceId) {
            $queryBuilder
                ->leftJoin('log.workspace', 'workspace')
                ->andWhere('workspace.id = :workspaceId')
                ->setParameter('workspaceId', $workspaceId);
        }

        if (null !== $receiverId) {
            $queryBuilder
                ->leftJoin('log.receiver', 'receiver')
                ->andWhere('receiver.id = :receiverId')
                ->setParameter('receiverId', $receiverId);
        }

        if (null !== $roleId) {
            $queryBuilder
                ->leftJoin('log.role', 'role')
                ->andWhere('role.id = :roleId')
                ->setParameter('roleId', $roleId);
        }

        if (null !== $groupId) {
            $queryBuilder
                ->leftJoin('log.receiverGroup', 'receiverGroup')
                ->andWhere('receiverGroup.id = :groupId')
                ->setParameter('groupId', $groupId);
        }

        if (null !== $toolName) {
            $queryBuilder
                ->andWhere('log.toolName = :toolName')
                ->setParameter('toolName', $toolName);
        }

        $q = $queryBuilder->getQuery();
        $logs = $q->getResult();

        return $logs;
    }
345086
protected function decodeIntervalSpec(): void
    {
        $this->di = new DateInterval($this->expression);
        $this->time = (new DateTime('@0'))
            ->add($this->di)
            ->getTimestamp();
    }
133728
public function run($sTimestamp = null, OutputInterface $oOutput = null)
    {
        if (null === $sTimestamp) {
            $sTimestamp = AbstractQuery::getCurrentTimestamp();
        }

        foreach ($this->getQueries() as $oQuery) {
            $oQuery->getTimestamp() < $sTimestamp
                ? $this->_goUp($oQuery, $oOutput)
                : $this->_goDown($oQuery, $oOutput);
        }
    }
265938
public function update(ScopeInterface $scope): void
    {
        try {
            $now    = $this->ignoreException(function (): DateTimeImmutable {
                return new DateTimeImmutable();
            });
            $schema = $this->getDatabaseSchema();
            $this->updateResource($scope->getIdentifier(), [
                $schema->getScopesDescriptionColumn() => $scope->getDescription(),
                $schema->getScopesUpdatedAtColumn()   => $now,
            ]);
            $scope->setUpdatedAt($now);
        } catch (RepositoryException $exception) {
            $message = 'Scope update failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
114630
public function execute($value)
    {
        if (!is_array($value) || count($value) != 2) {
            throw new \Exception('Value for number range comparison should have to values');
        }

        $queryBuilder = $this->getQueryBuilder();

        if (!empty($value[0])) {
            $queryBuilder->andHaving(
                $queryBuilder->expr()->gte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_1"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_1",
                    (float) $value[0]
                );
        }

        if (!empty($value[1])) {
            $queryBuilder->andHaving(
                $queryBuilder->expr()->lte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_2"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_2",
                    (float) $value[1]
                );
        }
    }
908206
public function checkDate($value, ExecutionContextInterface $context)
    {
        $format = self::PHP_DATE_FORMAT;

        if (! empty($value) && false === \DateTime::createFromFormat($format, $value)) {
            $context->addViolation(Translator::getInstance()->trans("Date '%date' is invalid, please enter a valid date using %fmt format", [
                        '%fmt' => self::MOMENT_JS_DATE_FORMAT,
                        '%date' => $value
                    ]));
        }
    }
370311
@SuppressWarnings("unchecked")
	private void startScheduler(){

		scheduledExecutorService.scheduleAtFixedRate(new Runnable() {

			@Override
			@SuppressWarnings("rawtypes")
			public void run()  {

				Iterator<Entry<String, Long>> it = transactionCallbackTime.entrySet().iterator();
				while (it.hasNext()) {
					Map.Entry pair = (Map.Entry)it.next();
					if ((System.currentTimeMillis() - (Long)pair.getValue()) > 5000 ){
						final String xferId = (String)pair.getKey();
						it.remove();
						status.put(xferId, "ERROR");
						ascpCount -= numberOfSessionsInTransaction(xferId);
						removeAllTransactionSessions(xferId);
						removeTransactionProgressData(xferId);
						log.error("Status marked as [ERROR] for xferId [" + xferId + "] after not reporting for over 5 seconds");
					}
				}
			}
		},5,5,TimeUnit.SECONDS);
	}
64388
public function setOnUpdateCurrentTimestamp($onUpdateCurrentTimestamp)
    {
        if (!empty($onUpdateCurrentTimestamp) && !($this->dataType instanceof TimeTypeInterface)) {
            throw new LogicException(
                sprintf(
                    'Data type "%s" for column "%s" does not support setting current time on update.',
                    $this->dataType->getType(),
                    $this->name
                )
            );
        }

        $this->onUpdateCurrentTimestamp = $onUpdateCurrentTimestamp;
    }