You are here

private function InstapageCmsPluginDrupal7Connector::isProhibitedPostSlug in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/connectors/InstapageCmsPluginDrupal7Connector.php \InstapageCmsPluginDrupal7Connector::isProhibitedPostSlug()

Checks if given slug is prohibited in terms of publishing a landing page. If it's free - will return false. Otherwise an array with slug details will be returned

@uses self::getSiteURL() @uses self::getDBPrefix() @uses self::getResults()

Parameters

string $slug Slug to be checked:

Return value

bool|array

1 call to InstapageCmsPluginDrupal7Connector::isProhibitedPostSlug()
InstapageCmsPluginDrupal7Connector::isProhibitedSlug in core/connectors/InstapageCmsPluginDrupal7Connector.php
Checks if given slug is prohibited in terms of publishing a landing page. If it's free - will return false. Otherwise an array with slug details will be returned

File

core/connectors/InstapageCmsPluginDrupal7Connector.php, line 896

Class

InstapageCmsPluginDrupal7Connector
Class that utilizes native Drupal 7 functions to perform actions like remote requests and DB operations.

Code

private function isProhibitedPostSlug($slug) {
  $editUrl = $this
    ->getSiteURL();
  $dbPrefix = $this
    ->getDBPrefix();
  $sql = 'SELECT pid AS id, SUBSTRING(alias, 2) AS slug, CONCAT(\'' . $editUrl . '\', source, \'/edit\') AS editUrl FROM ' . $dbPrefix . 'url_alias WHERE SUBSTRING(alias, 2) = \'%s\' LIMIT 1';
  $results = $this
    ->getResults($sql, $slug);
  return $results;
}