コード例 #1
0
ファイル: Addressable.php プロジェクト: 8secs/cocina
 public function __construct()
 {
     $this->allowedStates = self::$allowed_states;
     $this->allowedCountries = self::$allowed_countries;
     $this->postcodeRegex = self::$postcode_regex;
     parent::__construct();
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct();
     // This may get called before the schema is created.
     if (!DB::getConn()->isSchemaUpdating()) {
         HtmlEditorConfig::get('cms')->setOption('viewtemplate', ViewTemplate::get()->map('Title')->toArray());
     }
 }
 /**
  * @param $allowed
  */
 public function __construct($allowed)
 {
     parent::__construct();
     if (!is_array($allowed)) {
         $allowed = func_get_args();
     }
     $this->allowed = $allowed;
 }
 /**
  * @param Config_ForClass $config
  */
 public function __construct(Config_ForClass $config = null)
 {
     parent::__construct();
     $this->config = $config ?: Config::inst()->forClass(__CLASS__);
     if ($memLimit = $this->config->get('memory')) {
         increase_memory_limit_to($memLimit);
     }
 }
コード例 #5
0
 public function __construct()
 {
     // TODO Re-enable before we release 3.0 beta, for now it "breaks" too many modules
     // user_error(
     // 	'DataObjectDecorator is deprecated, please use DataExtension instead.',
     // 	E_USER_NOTICE
     // );
     parent::__construct();
 }
コード例 #6
0
 /**
  * @param Array|String $searchFields Comma-separated list (or array) of database column names
  *  that can be searched on. Used for generation of the database index defintions.
  */
 function __construct($searchFields = array())
 {
     if (is_array($searchFields)) {
         $this->searchFields = implode(',', $searchFields);
     } else {
         $this->searchFields = $searchFields;
     }
     parent::__construct();
 }
コード例 #7
0
 /**
  * @param Array|String $searchFields Comma-separated list (or array) of database column names
  *  that can be searched on. Used for generation of the database index defintions.
  */
 public function __construct($searchFields = array())
 {
     if (is_array($searchFields)) {
         $this->searchFields = '"' . implode('","', $searchFields) . '"';
     } else {
         $this->searchFields = $searchFields;
     }
     parent::__construct();
 }
コード例 #8
0
 public function __construct($tab = '', $useCMSFieldsAlways = false, $profileRelation = '')
 {
     parent::__construct();
     $this->tab = $tab;
     $this->useCMSFieldsAlways = $useCMSFieldsAlways;
     if ($profileRelation) {
         static::$connected_relations[] = $profileRelation;
         $this->hasSetRelationForHidingFromFieldLists = true;
     }
 }
コード例 #9
0
 public function __construct()
 {
     $this->allowedStates = self::$allowed_states;
     $this->allowedCountries = self::$allowed_countries;
     if (!empty($customRegex = Config::inst()->get('Addressable', 'set_postcode_regex'))) {
         self::set_postcode_regex($customRegex);
     }
     $this->postcodeRegex = self::$postcode_regex;
     parent::__construct();
 }
コード例 #10
0
 /**
  * Construct a new Versioned object.
  * @var array $stages The different stages the versioned object can be.
  * The first stage is consiedered the 'default' stage, the last stage is
  * considered the 'live' stage.
  */
 function __construct($stages)
 {
     parent::__construct();
     if (!is_array($stages)) {
         $stages = func_get_args();
     }
     $this->stages = $stages;
     $this->defaultStage = reset($stages);
     $this->liveStage = array_pop($stages);
 }
コード例 #11
0
 public function __construct($name = 'Title', $parentRel = null, $enforceParity = false)
 {
     parent::__construct();
     if (!empty($parentRel)) {
         $this->parentRel = $parentRel;
     }
     if (!empty($name)) {
         $this->name = $name;
     }
     $this->enforceParity = $enforceParity;
 }
コード例 #12
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct();
     $appId = Config::inst()->get('VkControllerExtension', 'app_id');
     $secret = Config::inst()->get('VkControllerExtension', 'api_secret');
     if (!$appId || !$secret) {
         return null;
     }
     if (session_status() !== PHP_SESSION_ACTIVE) {
         Session::start();
     }
 }
 /**
  * @param $destFolder The folder to save the cached site into.
  *   This needs to be set in framework/static-main.php as well through the {@link $cacheBaseDir} variable.
  * @param $fileExtension  The file extension to use, e.g 'html'.  
  *   If omitted, then each page will be placed in its own directory, 
  *   with the filename 'index.html'.  If you set the extension to PHP, then a simple PHP script will
  *   be generated that can do appropriate cache & redirect header negotation.
  */
 public function __construct($destFolder = 'cache', $fileExtension = null)
 {
     // Remove trailing slash from folder
     if (substr($destFolder, -1) == '/') {
         $destFolder = substr($destFolder, 0, -1);
     }
     $this->destFolder = $destFolder;
     if ($fileExtension) {
         $this->fileExtension = $fileExtension;
     }
     parent::__construct();
 }
コード例 #14
0
 public function __construct()
 {
     parent::__construct();
     DataObject::set_validation_enabled(true);
 }
コード例 #15
0
 public function __construct(ContentService $service)
 {
     $this->service = $service;
     parent::__construct();
 }
コード例 #16
0
 public function __construct(ElasticaService $service)
 {
     $this->service = $service;
     parent::__construct();
 }
コード例 #17
0
	/**
	 * @param Array|String $searchFields Comma-separated list (or array) of database column names
	 *  that can be searched on. Used for generation of the database index defintions.
	 */
	function __construct($searchFields) {
		if(is_array($searchFields)) $this->searchFields = implode(',', $searchFields);
		else $this->searchFields = $searchFields;
		
		parent::__construct();
	}
 function __construct()
 {
     $self = $this;
     parent::__construct();
     Requirements::css("https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css");
 }
コード例 #19
0
 /**
  * Called by the system when initialising each instance of the decorated 
  * class.  The argument comes from the Object::add_extension call in the 
  * project's _config.php file.
  *
  * Field configuration can simply be a comma-separated list of fieldnames to scan,
  * or alternatively can be a json-encoded string containing extended config 
  * information.  Or you can leave it blank.
  * 
  * All keys are optional for each fieldname.  The format for $fieldConfig is:
  *
  * <code>
  * array(
  *    'FieldName' => array(
  *        'name' => 'StoredName',
  *        'type' => 'keyword|unindexed|unstored|text',
  *        'content_filter' => [callback]|false
  *     ),
  *     [...]
  * )
  * </code>
  * 
  * FieldName - the name of the field on the decorated class
  *
  * name - the name to store this as in the document.  Default is the same as
  * the FieldName.  The FieldName of 'ID' is a special case, this will always 
  * use a name of 'ObjectID' as this is used internally.
  * 
  * type - the type of indexing to use.  Default is 'text'.
  * 
  * content_filter - a callback that should be used to transform the field value
  * prior to being indexed.  The callback will be called with one argument, 
  * the field value as a string, and should return the transformed field value
  * also as a string.  Could be useful for eg. turning date strings into unix 
  * timestamps prior to indexing.  A value of false will indicate that there
  * should be no content filtering, which is the default.
  * 
  * Class-level configuration should be a json-encoded string containing 
  * key-value pairs for the class-level config options.  The format for 
  * $classConfig is:
  *
  * <code>
  * array(
  *     'index_filter' => 'WHERE clause'
  * )
  * </code>
  * 
  * index_filter - a string to be used as the second argument to 
  * DataObject::get().  An example of how this might be used in a complex 
  * situation:
  *
  * '"ID" IN ( SELECT "ID" FROM "This" LEFT JOIN "Other" ON "This"."ID" = "Other"."ThisID" WHERE "Other"."ThisID" IS NOT NULL )'
  */
 public function __construct($fieldConfig = null, $classConfig = null)
 {
     parent::__construct();
     $this->_fieldConfig = $fieldConfig;
     $this->_classConfig = $classConfig;
 }
 public function __construct($relationName)
 {
     parent::__construct();
     $this->permissionSourceRelation = $relationName;
 }
コード例 #21
0
 /**
  * Construct a new Translatable object.
  * @var array $translatableFields The different fields of the object that can be translated.
  * This is currently not implemented, all fields are marked translatable (see {@link setOwner()}).
  */
 public function __construct($translatableFields = null)
 {
     parent::__construct();
     // @todo Disabled selection of translatable fields - we're setting all fields as
     // translatable in setOwner()
     /*
     if(!is_array($translatableFields)) {
         $translatableFields = func_get_args();
     }
     $this->translatableFields = $translatableFields;
     */
     // workaround for extending a method on another decorator (Hierarchy):
     // split the method into two calls, and overwrite the wrapper AllChildrenIncludingDeleted()
     // Has to be executed even with Translatable disabled, as it overwrites the method with same name
     // on Hierarchy class, and routes through to Hierarchy->doAllChildrenIncludingDeleted() instead.
     // Caution: There's an additional method for augmentAllChildrenIncludingDeleted()
 }
コード例 #22
0
 public function __construct()
 {
     parent::__construct();
 }
コード例 #23
0
 /**
  * Load the prefix map before anything else happens
  */
 public function __construct()
 {
     parent::__construct();
     self::load_prefix_map();
     // If duplicate URLSegments make Translatable allow that
     $enabled = Config::inst()->get('prefixconfig', 'enable_duplicate_urlsegments');
     if ($enabled) {
         Config::inst()->update('Translatable', 'enforce_global_unique_urls', false);
     }
 }
コード例 #24
0
 public function __construct()
 {
     Deprecation::notice('3.0', 'DataObjectDecorator is deprecated. Use DataExtension instead.', Deprecation::SCOPE_CLASS);
     parent::__construct();
 }
 /**
  * @param string $relationClass
  */
 public function __construct($relationClass)
 {
     $this->relationClass = $relationClass;
     parent::__construct();
 }
コード例 #26
0
	public function __construct() {
		Deprecation::notice('3.0', 'Use DataExtension instead.');
		parent::__construct();
	}
コード例 #27
0
 /**
  * @param ElasticaService $service
  * @param LoggerInterface $logger
  */
 public function __construct(ElasticaService $service, LoggerInterface $logger = null)
 {
     $this->service = $service;
     $this->logger = $logger;
     parent::__construct();
 }
コード例 #28
0
 function __construct($scope = null, $titleField = "Title")
 {
     $this->Scope = $scope;
     $this->TitleField = $titleField;
     parent::__construct();
 }