sentence1
stringlengths
52
3.87M
sentence2
stringlengths
1
47.2k
label
stringclasses
1 value
public function extract($file, $params = array(), $document = null, $mimetype = 'application/octet-stream') { // check if $params is an array (allow null for default empty array) if (!is_null($params)) { if (!is_array($params)) { throw new Apache_Solr_InvalidArgumentException("\$params must be a valid ...
Use Solr Cell to extract document contents. See {@link http://wiki.apache.org/solr/ExtractingRequestHandler} for information on how to use Solr Cell and what parameters are available. NOTE: when passing an Apache_Solr_Document instance, field names and boosts will automatically be prepended by "literal." and "boost." ...
entailment
public function extractFromString($data, $params = array(), $document = null, $mimetype = 'application/octet-stream') { // check if $params is an array (allow null for default empty array) if (!is_null($params)) { if (!is_array($params)) { throw new Apache_Solr_InvalidArgumentException("\$params must b...
Use Solr Cell to extract document contents. See {@link http://wiki.apache.org/solr/ExtractingRequestHandler} for information on how to use Solr Cell and what parameters are available. NOTE: when passing an Apache_Solr_Document instance, field names and boosts will automatically be prepended by "literal." and "boost." ...
entailment
public function extractFromUrl($url, $params = array(), $document = null, $mimetype = 'application/octet-stream') { // check if $params is an array (allow null for default empty array) if (!is_null($params)) { if (!is_array($params)) { throw new Apache_Solr_InvalidArgumentException("\$params must be a ...
Use Solr Cell to extract document contents. See {@link http://wiki.apache.org/solr/ExtractingRequestHandler} for information on how to use Solr Cell and what parameters are available. NOTE: when passing an Apache_Solr_Document instance, field names and boosts will automatically be prepended by "literal." and "boost." ...
entailment
public function optimize($waitFlush = true, $waitSearcher = true, $timeout = 3600) { $rawPost = $this->getCompatibilityLayer()->createOptimizeXml( $waitFlush, $waitSearcher, $timeout ); return $this->_sendRawPost($this->_updateUrl, $rawPost, $timeout); }
Send an optimize command. Will be synchronous unless both wait parameters are set to false. @param boolean $waitFlush @param boolean $waitSearcher @param float $timeout Maximum expected duration of the commit operation on the server (otherwise, will throw a communication exception) @return Apache_Solr_Response @thro...
entailment
public function search($query, $offset = 0, $limit = 10, $params = array(), $method = self::METHOD_GET) { // ensure params is an array if (!is_null($params)) { if (!is_array($params)) { // params was specified but was not an array - invalid throw new Apache_Solr_InvalidArgumentException("\$params m...
Simple Search interface @param string $query The raw query string @param int $offset The starting offset for result documents @param int $limit The maximum number of result documents to return @param array $params key / value pairs for other query parameters (see Solr documentation), use arrays for parameter keys used...
entailment
private static function getHttpTransportAdapter($serverConfig) { switch ($serverConfig->getHttpTransportMethod()) { case HttpTransportMethod::HTTP_TRANSPORT_METHOD_CURL: $adapter = new Apache_Solr_HttpTransport_Curl(); break; default: $...
Create HttpTransportAdapter based on configuration @param $serverConfig @return Apache_Solr_HttpTransport_Abstract
entailment
public function parseDateTime($rawValue) { if (null === $rawValue) return null; try { return DateUtils::createDateTimeFromFormat(OracleDateTimeColumn::generateFormatBuildRawValue( OracleDateTimeColumn::FORMAT_BUILD_TYPE_PARSE, true, true), $rawValue); } catch (\n2n\util\DateParseException $e) { ...
/* (non-PHPdoc) @see n2n\persistence\meta.OrmDialectConfig::parseDateTime()
entailment
public function buildDateTimeRawValue(\DateTime $dateTime = null) { if (null === $dateTime) return null; return DateUtils::formatDateTime($dateTime, OracleDateTimeColumn::generateFormatBuildRawValue( OracleDateTimeColumn::FORMAT_BUILD_TYPE_RAW_VALUE, true, true)); }
/* (non-PHPdoc) @see n2n\persistence\meta.OrmDialectConfig::buildRawValue()
entailment
public function absStartLevel(int $absStartLevelNo = null) { if ($this->relStartLevelNo !== null) { throw new IllegalStateException('Relative start level already defined.'); } $this->absStartlevelNo = $absStartLevelNo; return $this; }
Specifies the first navigation level absolute to the root page (e.g. <code>Nav::root()->absStartLevel(2)</code>). @param int $absStartLevelNo @return \page\ui\nav\NavComposer
entailment
public function relStartLevel(int $relStartLevel = null) { if ($this->absStartlevelNo !== null) { throw new IllegalStateException('Absolute start level already defined.'); } $this->relStartLevelNo = $relStartLevel; return $this; }
Specifies the first navigation level relative to the base page (e.g. <code>Nav::current()->relStartLevel(-1)</code>). @param int $relStartLevelNo @return \page\ui\nav\NavComposer
entailment
public function builder($navItemBuilder) { ArgUtils::valType($navItemBuilder, array(NavItemBuilder::class, 'string')); $this->navItemBuilder = $navItemBuilder; return $this; }
Specifies the {@link NavItemBuilder} for this navigation. If you want to build a custom navigation, create your own NavItemBuilder that inherits from {@see NavItemBuilderAdapter} @param mixed $navItemBuilder object of {@link NavItemBuilder} or its lookup id as string. @return \page\ui\nav\NavComposer
entailment
public function build(HtmlView $view, array $attrs = null, array $ulAttrs = null, array $liAttrs = null, array $aAttrs = null) { $pageState = $view->lookup(PageState::class); CastUtils::assertTrue($pageState instanceof PageState); $navItemBuilder = null; if ($this->navItemBuilder === null) { $navIte...
Usally invoked by {@link \page\ui\PageHtmlBuilder::navigation()} to build an UiComponent of the described navigation. @param HtmlView $view @param array $attrs @param array $ulAttrs @param array $liAttrs @throws UiException @return UiComponent
entailment
public function createBackuper(array $metaEnities = null): Backuper { return new SqliteBackuper($this->dbh, $this->createDatabase(), $metaEnities); }
{@inheritDoc} @see \n2n\persistence\meta\Database::createBackuper() @return Backuper
entailment
protected function buildDatabase(): DatabaseAdapter { $database = new SqliteDatabase($this->determineDbCharset(), $this->getPersistedMetaEntities(), $this->determineDbAttrs()); foreach ($database->getMetaEntities() as $metaEntity) { if (!$metaEntity instanceof Table) continue; $this->metaEn...
{@inheritDoc} @see \n2n\persistence\meta\structure\common\MetaManagerAdapter::buildDatabase() @return DatabaseAdapter
entailment
public function applyIdentifierGeneratorToColumn(Pdo $dbh, Column $column, string $sequenceName) { $dbh = N2N::getPdoPool()->getPdo(); $statement = $dbh->prepare('SELECT COUNT(SEQUENCE_NAME) as NUM_SEQUENCES FROM USER_SEQUENCES WHERE SEQUENCE_NAME = :SEQUENCE_NAME'); $statement->execute(array(':SEQUENCE_NAME' ...
{@inheritDoc} @see \n2n\persistence\meta\Dialect::applyIdentifierGeneratorToColumn()
entailment
public function createBackuper(array $metaEnities = null): Backuper { return new OracleBackuper($this->dbh, $this->createDatabase(), $metaEnities); }
{@inheritDoc} @see \n2n\persistence\meta\Database::createBackuper() @return Backuper
entailment
public function createLeafContent(N2nContext $n2nContext, Path $cmdPath, Path $cmdContextPath): LeafContent { $pageContent = $this->lookupPageContent($n2nContext); $pageController = $pageContent->getPageController(); $analyzer = new PageControllerAnalyzer(new \ReflectionClass($pageController)); $leafCon...
{@inheritDoc} @see \page\model\nav\Leaf::createLeafContent($n2nContext, $cmdPath, $cmdContextPath)
entailment
public function getContentItemsByPanelName(string $panelName): array { if (!$this->containsContentItemPanelName($panelName)) { $pageController = $this->getControllerContext()->getController(); throw new UnknownContentItemPanelException('Undefined ContentItem panel \'' . $panelName . '\' for ' . TypeUt...
{@inheritDoc} @see \page\model\nav\impl\CommonLeafContent::getContentItemsByPanelName()
entailment
public function createMetaEntityFactory(): MetaEntityFactory { if (null === $this->metaEntityFactory) { $this->metaEntityFactory = new MysqlMetaEntityFactory($this); } return $this->metaEntityFactory; }
{@inheritDoc} @see \n2n\persistence\meta\Database::createMetaEntityFactory() @return MetaEntityFactory
entailment
public function toUrl(N2nContext $n2nContext, ControllerContext $controllerContext = null, string &$suggestedLabel = null): Url { if ($this->type == self::TYPE_EXTERNAL) { $suggestedLabel = $this->label; return Url::create($this->url); } $url = MurlPage::obj($this->linkedPage)->toUrl($n2nC...
{@inheritDoc} @see \n2n\web\http\nav\UrlComposer::toUrl()
entailment
public function toUrl(N2nContext $n2nContext, ControllerContext $controllerContext = null, string &$suggestedLabel = null): Url { $pageState = $n2nContext->lookup(PageState::class); CastUtils::assertTrue($pageState instanceof PageState); $n2nLocale = $this->n2nLocale; if ($n2nLocale === null){ $n...
{@inheritDoc} @see \n2n\web\http\nav\UrlComposer::toUrl($n2nContext, $controllerContext)
entailment
public function getLinkOptions(N2nLocale $n2nLocale): array { $options = array(); $this->buildLinkOptions($this->pageState->getNavTree()->getRootNavBranches(), $options); return $options; }
{@inheritDoc} @see \rocket\impl\ei\component\prop\string\cke\model\CkeLinkProvider::getLinkUrls()
entailment
public function buildUrl(string $key, View $view, N2nLocale $n2nLocale) { return $view->buildUrlStr(MurlPage::id($key)->locale($n2nLocale)); }
{@inheritDoc} @see \rocket\impl\ei\component\prop\string\cke\model\CkeLinkProviderAdapter::buildUrl()
entailment
public function createBinaryColumn(string $name, int $size): BinaryColumn { $binaryColumn = new CommonBinaryColumn($name, $size); $this->table->addColumn($binaryColumn); return $binaryColumn; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createBinaryColumn() @return BinaryColumn
entailment
public function createIntegerColumn(string $name, int $size, bool $signed = true): IntegerColumn { $integerColumn = new PgsqlIntegerColumn($name, $size, $signed); $this->table->addColumn($integerColumn); return $integerColumn; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createIntegerColumn() @return IntegerColumn
entailment
public function createFixedPointColumn(string $name, int $numIntegerDigits, int $numDecimalDigits): FixedPointColumn { $fixedPointColumn = new CommonFixedPointColumn($name, $numIntegerDigits, $numDecimalDigits); $this->table->addColumn($fixedPointColumn); return $fixedPointColumn; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createFixedPointColumn() @return FixedPointColumn
entailment
public function createFloatingPointColumn(string $name, int $size): FloatingPointColumn { $floatingPointColumn = new CommonFloatingPointColumn($name, $size); $this->table->addColumn($floatingPointColumn); return $floatingPointColumn; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createFloatingPointColumn() @return FloatingPointColumn
entailment
public function createDateTimeColumn(string $name, bool $dateAvailable = true, bool $timeAvailable = true): DateTimeColumn { $dateTimeColumn = new PgsqlDateTimeColumn($name, $dateAvailable, $timeAvailable); $this->table->addColumn($dateTimeColumn); return $dateTimeColumn; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createDateTimeColumn() @return DateTimeColumn
entailment
public function createEnumColumn(string $name, array $values): EnumColumn { $enumColumn = new CommonEnumColumn($name, $values); $this->table->addColumn($enumColumn); return $enumColumn; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createEnumColumn() @return EnumColumn
entailment
public function createColumnFactory(): ColumnFactory { if (!($this->columnFactory)) { $this->columnFactory = new SqliteColumnFactory($this); } return $this->columnFactory; }
{@inheritDoc} @see \n2n\persistence\meta\structure\Table::createColumnFactory() @return ColumnFactory
entailment
public function createTable(string $name): Table { $metaEntity = new MssqlTable($name); $this->database->addMetaEntity($metaEntity); return $metaEntity; }
{@inheritDoc} @see \n2n\persistence\meta\structure\MetaEntityFactory::createTable() @return Table
entailment
public function createView($name, $query): View { $metaEntity = new CommonView($name, $query); $this->database->addMetaEntity($metaEntity); return $metaEntity; }
{@inheritDoc} @see \n2n\persistence\meta\structure\MetaEntityFactory::createView() @return View
entailment
public function parseDateTime($rawValue) { if (null === $rawValue) return null; try { return DateUtils::createDateTimeFromFormat(MssqlDateTimeColumn::generateFormatBuildRawValue( MssqlDateTimeColumn::FORMAT_BUILD_TYPE_PARSE, true, true, self::COLUMN_TYPE_PRECISION, false), $rawValue); } c...
/* (non-PHPdoc) @see \n2n\persistence\meta\OrmDialectConfig::parseDateTime()
entailment
public function buildDateTimeRawValue(\DateTime $dateTime = null) { if (null === $dateTime) return null; return DateUtils::formatDateTime($dateTime, MssqlDateTimeColumn::generateFormatBuildRawValue( MssqlDateTimeColumn::FORMAT_BUILD_TYPE_RAW_VALUE, true, true, self::COLUMN_TYPE_PRECISION, false)); }
/* (non-PHPdoc) @see \n2n\persistence\meta\OrmDialectConfig::buildDateTimeRawValue()
entailment
public function createMetaEntityFactory(): MetaEntityFactory { if (null === $this->metaEntityFactory) { $this->metaEntityFactory = new SqliteMetaEntityFactory($this); } return $this->metaEntityFactory; }
{@inheritDoc} @see \n2n\persistence\meta\Database::createMetaEntityFactory() @return MetaEntityFactory
entailment
public function createIntegerColumn(string $name, int $size, bool $signed = true): IntegerColumn { $column = new SqliteIntegerColumn($name); $this->table->addColumn($column); return $column; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createIntegerColumn() @return IntegerColumn
entailment
public function createTextColumn(string $name, int $size, string $charset = null): TextColumn { throw new UnavailableTypeException('Sqlite does not support Text columns'); }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createTextColumn() @return TextColumn
entailment
public function createFloatingPointColumn(string $name, int $size): FloatingPointColumn { $column = new SqliteFloatingPointColumn($name); $this->table->addColumn($column); return $column; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createFloatingPointColumn() @return FloatingPointColumn
entailment
public function getTitle() { if ($this->pageState->hasCurrent()) { return $this->pageState->getCurrentLeaf()->getTitle(); } return $this->view->lookup(GeneralConfig::class)->getPageName(); }
Returns the title of the current page or the page name specified in app.ini if there is no current page. @return string
entailment
public function applyMeta(string $seTitle = null, string $titleSeparator = self::DEFAULT_TITLE_SEPARATOR) { $this->applySeMeta($seTitle, $titleSeparator); $this->applyN2nLocaleMeta(); }
Combines {@link self::applySeMeta()} and {@link self::applyN2nLocaleMeta()} @param string $seTitle See {@link self::applySeMeta()} @param string $titleSeparator See {@link self::applySeMeta()}
entailment
public function applySeMeta(string $seTitle = null, string $titleSeparator = self::DEFAULT_TITLE_SEPARATOR) { if (!$this->pageState->hasCurrent()) return; $leafContent = $this->pageState->getCurrentLeafContent(); $leaf = $leafContent->getLeaf(); $htmlMeta = $this->view->getHtmlBuilder()->meta(); if ...
<p>Applies meta information specified for the current page to the html header (e. g. <code>&lt;title&gt;</code> or <code>&lt;meta name=&quot;description&quot; content=&quot;..&quot; /&gt;</code>) </p> <p>If there is no current page nothing happens.</p> @param string $seTitle If you want to overwrite the title for the...
entailment
public function applyN2nLocaleMeta() { if (!$this->pageState->hasCurrent()) return; $navBranch = $this->pageState->getCurrentNavBranch(); $leafs = $navBranch->getLeafs(); if (count($leafs) <= 1) return; $htmlMeta = $this->view->getHtmlBuilder()->meta(); foreach ($leafs as $leaf) { $n2n...
Applies a <code>&lt;link rel=&quot;alternate&quot; hreflang=&quot;de&quot; href=&quot;..&quot; /&gt;</code> element to the html header for every translation available for current page.
entailment
public function getN2nLocaleSwitchUrls() { if (!$this->pageState->hasCurrent()) return array(); $pageMurl = MurlPage::obj($this->pageState->getCurrentNavBranch())->fallback(); $urls = array(); foreach ($this->view->getHttpContext()->getAvailableN2nLocales() as $n2nLocale) { if (null !== ($url = ...
<p>Returns the Urls to every translation of the current page. If it is no translation available for a locale, a translation of its ancestors will be used. If they don't have a translation for this locale, the locale will be skiped.</p> <p>If there is no current page, an empty array will be returned.</p> <p>You can us...
entailment
public function getBreadcrumbNavBranches() { if (!$this->pageState->hasCurrent()) return array(); $navBranches = array(); $navBranch = $this->pageState->getCurrentNavBranch(); do { $navBranches[] = $navBranch; } while (null !== ($navBranch = $navBranch->getParent())); return $navBranches; }
<p>Returns the {@link NavBranch}es of the current page and all its ancestors. You can use this method to build a customized breadcrumb navigation. <pre> &lt;ul&gt; &lt;?php foreach ($pageHtml-&gt;meta()-&gt;getBreadcrumbNavBranches() as $navBranch): ?&gt; &lt;li&gt;&lt;?php $html-&gt;link(MurlPage::obj($navBranch)) ?&...
entailment
public function parseDateTime($rawValue) { if (null === $rawValue) return null; try { return DateUtils::createDateTimeFromFormat(SqliteDateTimeColumn::FORMAT_DATE_TIME, $rawValue); } catch (\n2n\util\DateParseException $e) { throw new \InvalidArgumentException($e->getMessage(), 0, $e); } }
/* (non-PHPdoc) @see n2n\persistence\meta.OrmDialectConfig::parseDateTime()
entailment
public function buildDateTimeRawValue(\DateTime $dateTime = null) { if (null === $dateTime) return null; return DateUtils::formatDateTime($dateTime, SqliteDateTimeColumn::FORMAT_DATE_TIME); }
/* (non-PHPdoc) @see n2n\persistence\meta.OrmDialectConfig::buildDateTimeRawValue()
entailment
public function createLeafContent(N2nContext $n2nContext, Path $cmdPath, Path $cmdContextPath): LeafContent { return new CommonLeafContent($this, $cmdPath, $cmdContextPath, new EmptyController()); }
{@inheritDoc} @see \page\model\nav\Leaf::createLeafContent($n2nContext, $cmdPath, $cmdContextPath)
entailment
public function createMetaEntityFactory(): MetaEntityFactory { if (!isset($this->metaEntityFactory)) { $this->metaEntityFactory = new PgsqlMetaEntityFactory($this); } return $this->metaEntityFactory; }
{@inheritDoc} @see \n2n\persistence\meta\Database::createMetaEntityFactory() @return MetaEntityFactory
entailment
public function copy(string $newTableName = null): Table { if (null === $newTableName) { $newTableName = $this->getName(); } $newTable = new MysqlTable($newTableName); $newTable->applyColumnsFrom($this); $newTable->applyIndexesFrom($this); return $newTable; }
{@inheritDoc} @see \n2n\persistence\meta\structure\Table::copy() @return Table
entailment
public function createColumnFactory(): ColumnFactory { if (!($this->columnFactory)) { $this->columnFactory = new MysqlColumnFactory($this); } return $this->columnFactory; }
{@inheritDoc} @see \n2n\persistence\meta\structure\Table::createColumnFactory() @return ColumnFactory
entailment
public function escapeLikePattern(string $pattern): string { $esc = $this->getLikeEscapeCharacter(); return str_replace(array($esc, QueryComparator::LIKE_WILDCARD_MANY_CHARS, QueryComparator::LIKE_WILDCARD_ONE_CHAR), array($esc . $esc, $esc . QueryComparator::LIKE_WILDCARD_MANY_CHARS, $esc . Que...
Quotes the like wildcard chars @param string $pattern
entailment
public function createStringColumn(string $name, int $length, string $charset = null): StringColumn { $column = new CommonStringColumn($name, $length, $charset); $this->table->addColumn($column); return $column; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createStringColumn() @return StringColumn
entailment
public function createTextColumn(string $name, int $size, string $charset = null): TextColumn { $column = new CommonTextColumn($name, $size, $charset); $this->table->addColumn($column); return $column; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createTextColumn() @return TextColumn
entailment
public function createBinaryColumn(string $name, int $size): BinaryColumn { $column = new CommonBinaryColumn($name, $size); $this->table->addColumn($column); return $column; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createBinaryColumn() @return BinaryColumn
entailment
public function createDateTimeColumn(string $name, bool $dateAvailable = true, bool $timeAvailable = true): DateTimeColumn { $column = new MssqlDateTimeColumn($name, $dateAvailable, $timeAvailable); $this->table->addColumn($column); return $column; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createDateTimeColumn() @return DateTimeColumn
entailment
public function createMetaEntityFactory(): MetaEntityFactory { if (!$this->metaEntityFactory) { $this->metaEntityFactory = new MssqlMetaEntityFactory($this); } return $this->metaEntityFactory; }
{@inheritDoc} @see \n2n\persistence\meta\Database::createMetaEntityFactory() @return MetaEntityFactory
entailment
public function createLeafContent(N2nContext $n2nContext, Path $cmdPath, Path $cmdContextPath): LeafContent { return new CommonLeafContent($this, $cmdPath, $cmdContextPath, new ExternalController($this->httpLocation, $n2nContext)); }
{@inheritDoc} @see \page\model\nav\Leaf::createLeafContent($n2nContext, $cmdPath, $cmdContextPath)
entailment
public function execute(ControllerContext $controllerContext): bool { if (!$controllerContext->getCmdPath()->isEmpty()) { throw new PageNotFoundException(); } $this->n2nContext->getHttpContext()->getResponse()->send( new Redirect($this->httpLocation, Response::STATUS_301_MOVED_PERMANENTLY)); re...
{@inheritDoc} @see \n2n\web\http\controller\Controller::execute($controllerContext)
entailment
public function buildCustomConfig() { $attributes = $this->readCustomAttributes(); $pageConfig = new PageConfig(); $pageConfig->setN2nLocaleUrlsActive($attributes->optBool(self::ATTR_LOCALES_ACTIVE_KEY, self::ATTR_LOCALES_ACTIVE_DEFAULT)); $pageConfig->setAutoN2nLocaleRedirectAllowed($attributes->...
{@inheritDoc} @see \n2n\core\module\ConfigDescriber::buildCustomConfig()
entailment
public function parseDateTime($rawValue) { if (null === $rawValue) { return null; } try { $dateTime = DateUtils::createDateTimeFromFormat(MysqlDateTimeColumn::FORMAT_DATE_TIME, $rawValue); if ($dateTime->getTimestamp() === false) { throw new DateParseException('Invalid datetime raw value: ...
/* (non-PHPdoc) @see n2n\persistence\meta.OrmDialectConfig::parseDateTime()
entailment
public function buildDateTimeRawValue(\DateTime $dateTime = null) { if (null === $dateTime) { return null; } return DateUtils::formatDateTime($dateTime, MysqlDateTimeColumn::FORMAT_DATE_TIME); }
/* (non-PHPdoc) @see n2n\persistence\meta.OrmDialectConfig::buildRawValue()
entailment
public function createBackuper(array $metaEnities = null): Backuper { return new MssqlBackuper($this->dbh, $this->createDatabase(), $metaEnities); }
{@inheritDoc} @see \n2n\persistence\meta\Database::createBackuper() @return Backuper
entailment
public function createColumnFactory(): ColumnFactory { if (!($this->columnFactory)) { $this->columnFactory = new PgsqlColumnFactory($this); } return $this->columnFactory; }
{@inheritDoc} @see \n2n\persistence\meta\structure\Table::createColumnFactory() @return ColumnFactory
entailment
public function copy(string $newTableName = null): Table { if (is_null($newTableName)) { $newTableName = $this->getName(); } $newTable = new PgsqlTable($newTableName); $newTable->applyColumnsFrom($this); $newTable->applyIndexesFrom($this); return $newTable; }
{@inheritDoc} @see \n2n\persistence\meta\structure\Table::copy() @return Table
entailment
public function createMetaEntityFactory(): MetaEntityFactory { if (!(isset($this->metaEntityFactory))) { $this->metaEntityFactory = new OracleMetaEntityFactory($this); } return $this->metaEntityFactory; }
{@inheritDoc} @see \n2n\persistence\meta\Database::createMetaEntityFactory() @return MetaEntityFactory
entailment
public function createTable(string $name): Table { $newTable = new PgsqlTable($name); $this->database->addMetaEntity($newTable); return $newTable; }
{@inheritDoc} @see \n2n\persistence\meta\structure\MetaEntityFactory::createTable() @return Table
entailment
public function createView(string $name, string $query): View { $newView = new CommonView($name, $query); $this->database->addMetaEntity($newView); return $newView; }
{@inheritDoc} @see \n2n\persistence\meta\structure\MetaEntityFactory::createView() @return View
entailment
public function getTitle($overwriteTitle = null) { if (null !== $overwriteTitle) { return $this->view->getHtmlBuilder()->getOut($overwriteTitle); } return $this->view->getHtmlBuilder()->getEsc($this->meta->getTitle()); }
Same as {@link PageHtmlBuilder::title()} but returns the output. @return \n2n\web\ui\UiComponent
entailment
public function contentItems(string $panelName) { foreach ($this->meta()->getContentItems($panelName) as $contentItem) { $this->view->out($contentItem->createUiComponent($this->view)); } }
<p>Prints the content items of the current page which are assigned to the panel with passed name.</p> <pre> &lt;div&gt;&lt;?php $pageHtml-&gt;contentItems('main') ?&gt;&lt;/div&gt; </pre> @see PageHtmlBuilderMeta::getContentItems() @param string $panelName
entailment
public function getContentItems(string $panelName) { $contentItems = $this->meta()->getContentItems($panelName); if (empty($contentItems)) return null; $htmlSnippet = new HtmlSnippet(); foreach ($contentItems as $contentItem) { $htmlSnippet->appendLn($contentItem->createUiComponent($this->view)); ...
Same as {@link PageHtmlBuilder::contentItems()} but returns the output. @return \n2n\web\ui\UiComponent|null
entailment
public function navigation(NavComposer $navComposer = null, array $attrs = null, array $ulAttrs = null, array $liAttrs = null, array $aAttrs = null) { $this->view->out($this->getNavigation($navComposer, $attrs, $ulAttrs, $liAttrs, $aAttrs)); }
<p>Prints a customized navigation.</p> <p> <strong>Usage example</strong> <pre> &lt;?php $pageHtml-&gt;navigation(Nav::root()-&gt;levels(2), array('id' =&gt; 'main-navigation')) ?&gt; </pre> </p> @param NavComposer $navComposer <p>Use {@link \page\ui\nav\Nav} to build a suitable {@link NavComposer}. If you pass null,...
entailment
public function getNavigation(NavComposer $navComposer = null, array $attrs = null, array $ulAttrs = null, array $liAttrs = null, array $aAttrs = null) { if ($navComposer === null) { $navComposer = Nav::root(); } return $navComposer->build($this->view, $attrs, $ulAttrs, $liAttrs, $aAttrs); }
Same as {@link PageHtmlBuilder::navigation()} but returns the output. @return \n2n\web\ui\UiComponent
entailment
public function breadcrumbs(array $attrs = null, array $liAttrs = null, array $aAttrs = null, $divider = null) { $this->view->out($this->getBreadcrumbs($attrs, $liAttrs, $aAttrs, $divider)); }
<p>Prints a breadcrumb navigation of the current page in form of a ul-/li-list.</p> <p>Also see {@link PageHtmlBuilderMeta::getBreadcrumbNavBranches()} to find out how to build a breadcrumb navigation.</p> @param array $attrs Html attributes of the ul element. @param array $liAttrs Html attributes of each li element ...
entailment
public function getBreadcrumbs(array $attrs = null, array $liAttrs = null, array $aAttrs = null, $divider = null) { $navBranches = $this->meta->getBreadcrumbNavBranches(); if (empty($navBranches)) return null; $html = $this->view->getHtmlBuilder(); $lis = array(); $lastNavBranch = array_pop($navB...
Same as {@link PageHtmlBuilder::breadcrumbs()} but returns the output. @return \n2n\web\ui\UiComponent
entailment
public function localeSwitch(array $ulAttrs = null, array $liAttrs = null, array $aAttrs = null) { $this->view->out($this->getN2nLocaleSwitch($ulAttrs, $liAttrs, $aAttrs)); }
<p>Prints a locale switch navigation of the current page.</p> <p>Also see {@link PageHtmlBuilderMeta::getN2nLocaleSwitchUrls()} to find out how to customize the output.</p> @param array $ulAttrs @param array $liAttrs
entailment
public function getN2nLocaleSwitch(array $ulAttrs = null, array $liAttrs = null, array $aAttrs = null) { $urls = $this->meta->getN2nLocaleSwitchUrls(); if (empty($urls)) { return null; } $n2nLocales = array(); $langUsages = array(); foreach (array_keys($urls) as $n2nLocaleId) { $n2nLocale ...
Same as {@link PageHtmlBuilder::breadcrumbs()} but returns the output. @return \n2n\web\ui\UiComponent
entailment
private function parseViewCreateStatement($createStatement) { $matches = preg_split('/AS/i', $createStatement); if (isset($matches[1])) { return trim($matches[1]); } return $createStatement; }
Parse the given create statement and extract the query @param string $createStatement
entailment
public function createBackuper(array $metaEnities = null): Backuper { return new PgsqlBackuper($this->dbh, $this->createDatabase(), $metaEnities); }
{@inheritDoc} @see \n2n\persistence\meta\Database::createBackuper() @return Backuper
entailment
protected function buildDatabase(): DatabaseAdapter { $dbName = $this->determineDbName(); $database = new PgsqlDatabase($dbName, $this->determineDbCharset($dbName), $this->getPersistedMetaEntities($dbName), $this->determineDbAttrs($dbName)); foreach ($database->getMetaEntities() as $metaEntity) { ...
{@inheritDoc} @see \n2n\persistence\meta\structure\common\MetaManagerAdapter::buildDatabase() @return DatabaseAdapter
entailment
public function createColumnFactory(): ColumnFactory { if (!($this->columnFactory)) { $this->columnFactory = new OracleColumnFactory($this); } return $this->columnFactory; }
{@inheritDoc} @see \n2n\persistence\meta\structure\Table::createColumnFactory() @return ColumnFactory
entailment
public static function hook(string ...$hookKeys): NavComposer { return new NavComposer(NavBranchCriteria::create(null, null, $hookKeys)); }
Uses page as base which is marked with passed hooks. See {@link https://support.n2n.rocks/de/page/docs/navigieren#hooks hooks article} for further information about hooks. @param string ...$hookKeys keys of hooks @return \page\ui\nav\NavComposer
entailment
public function createBackuper(array $metaEnities = null): Backuper { return new MysqlBackuper($this->dbh, $this->createDatabase(), $metaEnities); }
{@inheritDoc} @see \n2n\persistence\meta\Database::createBackuper() @return Backuper
entailment
public function createEnumColumn(string $name, array $values): EnumColumn { $column = new CommonEnumColumn($name, $values); $this->table->addColumn($column); return $column; }
{@inheritDoc} @see \n2n\persistence\meta\structure\ColumnFactory::createEnumColumn() @return EnumColumn
entailment
public function createRecord($tableName, array $recordData = []) { if (!$this->isNoneSystemTableNameAllowed($tableName)) { throw new \InvalidArgumentException('The table name "' . $tableName . '" is not allowed.', 1334438817); } if (isset($recordData['uid'])) { throw ...
Creates a new dummy record for unit tests. If no record data for the new array is given, an empty record will be created. It will only contain a valid UID and the "is_dummy_record" flag will be set to 1. Should there be any problem creating the record (wrong table name or a problem with the database), 0 instead of a ...
entailment
protected function createRecordWithoutTableNameChecks($tableName, array $recordData) { $dummyColumnName = $this->getDummyColumnName($tableName); $recordData[$dummyColumnName] = 1; $uid = \Tx_Phpunit_Service_Database::insert($tableName, $recordData); $this->markTableAsDirty($tableNam...
Creates a new dummy record for unit tests without checks for the table name. If no record data for the new array is given, an empty record will be created. It will only contain a valid UID and the "is_dummy_record" flag will be set to 1. Should there be any problem creating the record (wrong table name or a problem w...
entailment
protected function createGeneralPageRecord($documentType, $parentId, array $recordData) { if (isset($recordData['uid'])) { throw new \InvalidArgumentException('The column "uid" must not be set in $recordData.', 1334438971); } if (isset($recordData['pid'])) { throw new...
Creates a page record with the document type given by the first parameter $documentType. The record will be created on the page with the UID given by the second parameter $parentId. @param int $documentType document type of the record to create, must be > 0 @param int $parentId UID of the page on which the record sho...
entailment
public function createContentElement($pageId = 0, array $recordData = []) { if (isset($recordData['uid'])) { throw new \InvalidArgumentException('The column "uid" must not be set in $recordData.', 1334439000); } if (isset($recordData['pid'])) { throw new \InvalidArgum...
Creates a FE content element on the page with the UID given by the first parameter $pageId. Created content elements are text elements by default, but the content element's type can be overwritten by setting the key 'CType' in the parameter $recordData. @param int $pageId UID of the page on which the content element ...
entailment
public function createTemplate($pageId, array $recordData = []) { if ($pageId <= 0) { throw new \InvalidArgumentException('$pageId must be > 0.', 1334439016); } if (isset($recordData['uid'])) { throw new \InvalidArgumentException('The column "uid" must not be set in $...
Creates a template on the page with the UID given by the first parameter $pageId. @param int $pageId UID of the page on which the template should be created, must be > 0 @param array $recordData associative array that contains the data to save in the new template, may be empty, but must not contain the keys "uid" or "...
entailment
public function createFrontEndUser( $frontEndUserGroups = '', array $recordData = [] ) { $frontEndUserGroupsWithoutSpaces = str_replace(' ', '', $frontEndUserGroups); if ($frontEndUserGroupsWithoutSpaces === '') { $frontEndUserGroupsWithoutSpaces = $this->createFrontEndU...
Creates a FE user record. @param string $frontEndUserGroups comma-separated list of UIDs of the user groups to which the new user belongs, each must be > 0, may contain spaces, if empty a new FE user group will be created @param array $recordData associative array that contains the data to save in the new user record,...
entailment
public function createAndLoginFrontEndUser($frontEndUserGroups = '', array $recordData = []) { $frontEndUserUid = $this->createFrontEndUser($frontEndUserGroups, $recordData); $this->loginFrontEndUser($frontEndUserUid); return $frontEndUserUid; }
Creates and logs in an FE user. @param string $frontEndUserGroups comma-separated list of UIDs of the user groups to which the new user belongs, each must be > 0, may contain spaces; if empty a new front-end user group is created @param array $recordData associative array that contains the data to save in the new user...
entailment
public function changeRecord($tableName, $uid, array $recordData) { $dummyColumnName = $this->getDummyColumnName($tableName); if (!$this->isTableNameAllowed($tableName)) { throw new \InvalidArgumentException( 'The table "' . $tableName . '" is not on the lists with allow...
Changes an existing dummy record and stores the new data for this record. Only fields that get new values in $recordData will be changed, everything else will stay untouched. The array with the new recordData must contain at least one entry, but must not contain a new UID for the record. If you need to change the UID,...
entailment
public function deleteRecord($tableName, $uid) { if (!$this->isNoneSystemTableNameAllowed($tableName)) { throw new \InvalidArgumentException('The table name "' . $tableName . '" is not allowed.', 1334439187); } \Tx_Phpunit_Service_Database::delete( $tableName, ...
Deletes a dummy record from the database. Important: Only dummy records from non-system tables can be deleted with this method. Should there for any reason exist a real record with that UID, it would not be deleted. @param string $tableName name of the table from which the record should be deleted, must not be empty ...
entailment
public function createRelation($tableName, $uidLocal, $uidForeign, $sorting = 0) { if (!$this->isNoneSystemTableNameAllowed($tableName)) { throw new \InvalidArgumentException('The table name "' . $tableName . '" is not allowed.', 1334439196); } // Checks that the two given UIDs ...
Creates a relation between two records on different tables (so called m:n relation). @param string $tableName name of the m:n table to which the record should be added, must not be empty @param int $uidLocal UID of the local table, must be > 0 @param int $uidForeign UID of the foreign table, must be > 0 @param int $so...
entailment
public function createRelationAndUpdateCounter( $tableName, $uidLocal, $uidForeign, $columnName ) { if (!$this->isTableNameAllowed($tableName)) { throw new \InvalidArgumentException('The table name "' . $tableName . '" is not allowed.'); } if ($ui...
Creates a relation between two records based on the rules defined in TCA regarding the relation. @param string $tableName name of the table from which a relation should be created, must not be empty @param int $uidLocal UID of the record in the local table, must be > 0 @param int $uidForeign UID of the record in the f...
entailment
public function removeRelation($tableName, $uidLocal, $uidForeign) { if (!$this->isNoneSystemTableNameAllowed($tableName)) { throw new \InvalidArgumentException('The table name "' . $tableName . '" is not allowed.', 1334439276); } \Tx_Phpunit_Service_Database::delete( ...
Deletes a dummy relation from an m:n table in the database. Important: Only dummy records can be deleted with this method. Should there for any reason exist a real record with that combination of local and foreign UID, it would not be deleted! @param string $tableName name of the table from which the record should be...
entailment
public function cleanUp($performDeepCleanUp = false) { $this->cleanUpTableSet(false, $performDeepCleanUp); $this->cleanUpTableSet(true, $performDeepCleanUp); $this->deleteAllDummyFoldersAndFiles(); $this->discardFakeFrontEnd(); foreach ($this->getHooks() as $hook) { ...
Deletes all dummy records that have been added through this framework. For this, all records with the "is_dummy_record" flag set to 1 will be deleted from all tables that have been used within this instance of the testing framework. If you set $performDeepCleanUp to TRUE, it will go through ALL tables to which the cur...
entailment
protected function cleanUpTableSet($useSystemTables, $performDeepCleanUp) { if ($useSystemTables) { $tablesToCleanUp = $performDeepCleanUp ? $this->allowedSystemTables : $this->dirtySystemTables; } else { $tablesToCleanUp = $performDeepCleanUp ? $this->ownAllowedTables : $thi...
Deletes a set of records that have been added through this framework for a set of tables (either the test tables or the allowed system tables). For this, all records with the "is_dummy_record" flag set to 1 will be deleted from all tables that have been used within this instance of the testing framework. If you set $p...
entailment
protected function deleteAllDummyFoldersAndFiles() { // If the upload folder was created by the testing framework, it can be // removed at once. if (isset($this->dummyFolders['uploadFolder'])) { GeneralUtility::rmdir($this->getUploadFolderPath(), true); $this->dummyFo...
Deletes all dummy files and folders. @return void
entailment
public function createDummyFile($fileName = 'test.txt', $content = '') { $this->createDummyUploadFolder(); $uniqueFileName = $this->getUniqueFileOrFolderPath($fileName); if (!GeneralUtility::writeFile($uniqueFileName, $content)) { throw new Exception('The file ' . $uniqueFileNam...
Creates an empty dummy file with a unique file name in the calling extension's upload directory. @param string $fileName path of the dummy file to create, relative to the calling extension's upload directory, must not be empty @param string $content string content for the file to create, may be empty @return string t...
entailment
public function createDummyZipArchive($fileName = 'test.zip', array $filesToAddToArchive = []) { $this->checkForZipArchive(); $this->createDummyUploadFolder(); $uniqueFileName = $this->getUniqueFileOrFolderPath($fileName); $zip = new ZipArchive(); if ($zip->open($uniqueFile...
Creates a dummy ZIP archive with a unique file name in the calling extension's upload directory. @param string $fileName path of the dummy ZIP archive to create, relative to the calling extension's upload directory, must not be empty @param string[] $filesToAddToArchive Absolute paths of the files to add to the ZIP ar...
entailment