@since  1.0

{@inheritDoc}
490205
public function contains( $id ) {

		foreach ( $this->caches as $cache ) {
			if ( $cache->contains( $id ) ) {
				return true;
			}
		}

		return false;
	}
1071971
public function execute($request): void
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $request->setResult([
            Constants::FIELD_PAID => false,
        ]);
    }
73808
public function refresh()
    {
        $operationContext = $this->getCreationContext();

        $objectData = $this->getSession()->getBinding()->getObjectService()->getObject(
            $this->getRepositoryId(),
            $this->getId(),
            $operationContext->getQueryFilterString(),
            $operationContext->isIncludeAllowableActions(),
            $operationContext->getIncludeRelationships(),
            $operationContext->getRenditionFilterString(),
            $operationContext->isIncludePolicies(),
            $operationContext->isIncludeAcls(),
            null
        );

        $this->initialize(
            $this->getSession(),
            $this->getSession()->getTypeDefinition($this->getObjectType()->getId()),
            $this->creationContext,
            $objectData
        );
    }
1318578
public function find($id = NULL)
    {
        if ($id !== NULL)
        {
            $data             = $this->getData();
            $this->currentId  = $id;
            $this->currentKey = $this->getRowKey($id);
            foreach ($data[$this->currentKey] as $field => $value)
            {
                $this->setField($field, $value);
            }
        }
        else
        {
            $this->limit(1)->findAll();
            $data = $this->data;
            if (count($data))
            {
                foreach ($data[0] as $field => $value)
                {
                    $this->setField($field, $value);
                }

                $this->currentId  = $this->getField('id');
                $this->currentKey = $this->getRowKey($this->currentId);
            }
        }
        return clone $this;
    }
192738
public function execute(&$rootDoc)
    {
        $docletFile = $this->fixPath($this->_docletPath).$this->_doclet.'/'.$this->_doclet.'.php';
        if (is_file($docletFile)) { // load doclet
            $this->message('Loading doclet "'.$this->_doclet.'"');
            require_once($this->fixPath($this->_docletPath).'/doclet.php');
            require_once($docletFile);
            $doclet =& new $this->_doclet($rootDoc, $this->getFormatter());
        } else {
            $this->error('Could not find doclet "'.$docletFile.'"');
        }
        $this->message('Done ('.round($this->_getTime() - $this->_startTime, 2).' seconds)');
    }
906555
public function offset( $offset ) {
		$this->offset = $offset;
		if ( false === starts_with( $offset . '', ':' ) ) {
			$this->offset = (int) $offset;
		}
	}
539929
public function where() {
        $this->logic('AND');
        $args = func_get_args();
        switch (count($args)) {
        case 1:
            if (is_array($args[0])) {
                $args[0] = $this->whereArray($args[0]);
            }
            $this->build()->bindExpression('where', $args[0]);
            break;
        case 2:
            $this->build()->bindExpression('where', "{$args[0]} = ?");
            $this->build()->bindParams('where', $args[1]);
            break;
        case 3:
            $this->build()->bindExpression('where', "{$args[0]} {$args[1]} ?");
            $this->build()->bindParams('where', $args[2]);
            break;
        }

        return $this->connection;
    }
1348885
public static function bind($key, $object = null)
    {
        if(is_array($key))
        {
            foreach($key as $key => $object)
            {
                self::$bindings[$key] = $object;
            }
        }
        else
        {
            self::$bindings[$key] = $object;
        }
    }
1152353
public function _resolve($value) {
        if ($this->state === self::PENDING) {
            $this->value = $value;
            for ($i = 0; $i < count($this->success_pending); $i++) {
                $callback = $this->success_pending[$i];
                $callback($value);
            }
            $this->state = self::RESOLVED;
        }
    }
151136
public function methodDoc(&$methods)
    {
        $this->depth++;
        if ($methods) {
            foreach ($methods as $method) {
                $type = $method->returnType();
                echo $this->showDepth(), '- ', $method->modifiers();
                if ($type) {
                    echo $type->toString(), ' ';
                } else {
                    echo 'void ';
                }
                echo $method->packageName(), '\\', $method->name(), $method->flatSignature();
                echo ' [', $method->location(), ']';
                echo "\n";
                $this->fieldDoc($method->parameters());
                $this->methodDoc($method->functions());
                $exceptions =& $method->thrownExceptions();
                if ($exceptions) {
                    foreach ($exceptions as $exception) {
                        echo $this->showDepth(), '|- throws ';
                        if (is_object($exception)) {
                            echo $exception->packageName(), '\\', $exception->name(), "\n";
                        } else {
                            echo $exception, "\n";
                        }
                    }
                }
                $this->docComment($method);
            }
        }
        $this->depth--;
    }
705595
public function execute()
    {

        $this->query("DELETE FROM `{{NAILS_DB_PREFIX}}app_setting` WHERE `grouping` = 'email' and `key` != 'from_name' and `key` != 'from_email';");
        /**
         * Convert admin changelog data into JSON strings rather than use serialize
         */

        $oResult = $this->query('SELECT id, email_vars FROM {{NAILS_DB_PREFIX}}email_archive');
        while ($oRow = $oResult->fetch(\PDO::FETCH_OBJ)) {

            $mOldValue = unserialize($oRow->email_vars);
            $sNewValue = json_encode($mOldValue);

            //  Update the record
            $sQuery = '
                UPDATE `{{NAILS_DB_PREFIX}}email_archive`
                SET
                    `email_vars` = :newValue
                WHERE
                    `id` = :id
            ';

            $oSth = $this->prepare($sQuery);

            $oSth->bindParam(':newValue', $sNewValue, \PDO::PARAM_STR);
            $oSth->bindParam(':id', $oRow->id, \PDO::PARAM_INT);

            $oSth->execute();
        }
    }
544316
protected function initDoctrine()
	{
		try {
			$this->doctrine = $this->db->getDoctrineSchemaManager();
			
			$platform = $this->doctrine->getDatabasePlatform();
			$platform->registerDoctrineTypeMapping('enum', 'string');
			$platform->registerDoctrineTypeMapping('json', 'json_array');
			
			$this->connection = true;
		} catch (PDOException $e) {
			$this->connection = false;
		}
	}
1366779
public function init()
    {
        //obiekt
        $this->addElement((new Element\Select('object'))
                ->setLabel('form.stat.statObject.object.label')
                ->setValue($this->getOption('object'))
                ->setMultioptions([null => '---'] + (new \Cms\Orm\CmsStatLabelQuery)->orderAsc('label')->findPairs('object', 'label')));

        //rok
        $this->addElement((new Element\Select('year'))
                ->setLabel('form.stat.statObject.year.label')
                ->setValue($this->getOption('year'))
                ->setMultioptions([date('Y') - 1 => date('Y') - 1, date('Y') => date('Y')]));

        //miesiąc
        $this->addElement((new Element\Select('month'))
                ->setLabel('form.stat.statObject.month.label')
                ->setValue($this->getOption('month'))
                ->setMultioptions($this->_getMonthMultioptions()));
    }
898114
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PaymentInterface $payment */
        $payment = $request->getModel();

        if (in_array($payment->getState(), array(PaymentInterface::STATE_APPROVED, PaymentInterface::STATE_DEPOSITED))) {
            $request->markCaptured();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_DEPOSITING))) {
            $request->markPending();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_CANCELED))) {
            $request->markCanceled();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_EXPIRED))) {
            $request->markExpired();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_FAILED))) {
            $request->markFailed();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_NEW, PaymentInterface::STATE_APPROVING))) {
            $request->markNew();

            return;
        }

        $request->markUnknown();
    }
1156020
public function handle($object, $fromDatabase = true)
    {
        if (!$this->entityStates->contains($object)) {
            $this->createState($object, $fromDatabase);
        }

        return $object;
    }
805615
protected function init(bool $hasChanged = false): void
    {
        parent::init($hasChanged);

        $originalData = $this->data;

        if ($this->isRaw) {
            $this->useFileReference = true;
            $this->data = new Data;
        } else {
            /** @var InternetMediaTypeInterface $internetMediaType */
            $internetMediaType = $this->analyzer->detectFromFilename($this->file);

            if ($internetMediaType &&
                ('text' === $internetMediaType->getType() ||
                $this->applicationXmlType->equals($internetMediaType))) {
                // Only text files can be processed by Sculpin and since we
                // have to read them here we are going to ensure that we use
                // the content we read here instead of having someone else
                // read the file again later.
                $this->useFileReference = false;

                // Additionally, any text file is a candidate for formatting.
                $this->canBeFormatted = true;

                $content = file_get_contents((string)$this->file);

                if (preg_match('/^\s*(?:---[\s]*[\r\n]+)(.*?)(?:---[\s]*[\r\n]+)(.*?)$/s', $content, $matches)) {
                    $this->content = $matches[2];
                    if (preg_match('/^(\s*[-]+\s*|\s*)$/', $matches[1])) {
                        // There is nothing useful in the YAML front matter.
                        $this->data = new Data;
                    } else {
                        // There may be YAML frontmatter
                        try {
                            $builder = new YamlDataBuilder($matches[1]);
                            $this->data = $builder->build();
                        } catch (\InvalidArgumentException $e) {
                            // Likely not actually YAML front matter available,
                            // treat the entire file as pure content.
                            echo ' ! ' . $this->sourceId() . ' ' . $e->getMessage() . ' !' . PHP_EOL;
                            $this->content = $content;
                            $this->data = new Data;
                        }
                    }
                } else {
                    $this->content = $content;
                    $this->data = new Data;
                    $this->canBeFormatted = false;
                }
            } else {
                $this->useFileReference = true;
                $this->data = new Data;
            }
        }

        if ($this->data->get('date')) {
            if (! is_numeric($this->data->get('date'))) {
                $this->data->set('date', strtotime($this->data->get('date')));
            }

            $this->data->set('calculated_date', $this->data->get('date'));
        }

        if ($originalData) {
            $this->data->import($originalData, false);
        }
    }
496443
public function setActiveContext($context)
    {
        $oldLocale = isset($this->activeContext) ? $this->contextLocales[$this->activeContext] : null;
        $this->activeContext = $context;
        if (!isset($this->contextLocales[$context])) {
            $this->setContextLocale($context, static::BASE_LOCALE);
        }
        $newLocale = $this->contextLocales[$context];
        if ($newLocale !== $oldLocale) {
            $this->currentLocaleChanged($newLocale);
        }
    }