repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
symphonycms/symphony-2
symphony/lib/toolkit/class.entry.php
Entry.getData
public function getData($field_id = null, $asObject = false) { $fieldData = isset($this->_data[$field_id]) ? $this->_data[$field_id] : array(); if (!$field_id) { return $this->_data; } return ($asObject ? (object)$fieldData : $fieldData); }
php
public function getData($field_id = null, $asObject = false) { $fieldData = isset($this->_data[$field_id]) ? $this->_data[$field_id] : array(); if (!$field_id) { return $this->_data; } return ($asObject ? (object)$fieldData : $fieldData); }
[ "public", "function", "getData", "(", "$", "field_id", "=", "null", ",", "$", "asObject", "=", "false", ")", "{", "$", "fieldData", "=", "isset", "(", "$", "this", "->", "_data", "[", "$", "field_id", "]", ")", "?", "$", "this", "->", "_data", "[",...
Accessor function to return data from this Entry for a particular field. Optional parameter to return this data as an object instead of an array. If a Field is not provided, an associative array of all data assigned to this Entry will be returned. @param integer $field_id The ID of the Field whose data you want @param...
[ "Accessor", "function", "to", "return", "data", "from", "this", "Entry", "for", "a", "particular", "field", ".", "Optional", "parameter", "to", "return", "this", "data", "as", "an", "object", "instead", "of", "an", "array", ".", "If", "a", "Field", "is", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.entry.php#L218-L229
symphonycms/symphony-2
symphony/lib/toolkit/class.entry.php
Entry.checkPostData
public function checkPostData($data, &$errors = null, $ignore_missing_fields = false) { $status = Entry::__ENTRY_OK__; $section = SectionManager::fetch($this->get('section_id')); $schema = $section->fetchFieldsSchema(); foreach ($schema as $info) { $message = null; ...
php
public function checkPostData($data, &$errors = null, $ignore_missing_fields = false) { $status = Entry::__ENTRY_OK__; $section = SectionManager::fetch($this->get('section_id')); $schema = $section->fetchFieldsSchema(); foreach ($schema as $info) { $message = null; ...
[ "public", "function", "checkPostData", "(", "$", "data", ",", "&", "$", "errors", "=", "null", ",", "$", "ignore_missing_fields", "=", "false", ")", "{", "$", "status", "=", "Entry", "::", "__ENTRY_OK__", ";", "$", "section", "=", "SectionManager", "::", ...
Given a array of data from a form, this function will iterate over all the fields in this Entry's Section and call their `checkPostFieldData()` function. @param array $data An associative array of the data for this entry where they key is the Field's handle for this Section and the value is the data from the form @par...
[ "Given", "a", "array", "of", "data", "from", "a", "form", "this", "function", "will", "iterate", "over", "all", "the", "fields", "in", "this", "Entry", "s", "Section", "and", "call", "their", "checkPostFieldData", "()", "function", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.entry.php#L250-L298
symphonycms/symphony-2
symphony/lib/toolkit/class.entry.php
Entry.findDefaultData
public function findDefaultData() { $section = SectionManager::fetch($this->get('section_id')); $schema = $section->fetchFields(); foreach ($schema as $field) { $field_id = $field->get('field_id'); if (empty($field_id) || isset($this->_data[$field_id])) { ...
php
public function findDefaultData() { $section = SectionManager::fetch($this->get('section_id')); $schema = $section->fetchFields(); foreach ($schema as $field) { $field_id = $field->get('field_id'); if (empty($field_id) || isset($this->_data[$field_id])) { ...
[ "public", "function", "findDefaultData", "(", ")", "{", "$", "section", "=", "SectionManager", "::", "fetch", "(", "$", "this", "->", "get", "(", "'section_id'", ")", ")", ";", "$", "schema", "=", "$", "section", "->", "fetchFields", "(", ")", ";", "fo...
Iterates over all the Fields in this Entry calling their `processRawFieldData()` function to set default values for this Entry. @see toolkit.Field#processRawFieldData()
[ "Iterates", "over", "all", "the", "Fields", "in", "this", "Entry", "calling", "their", "processRawFieldData", "()", "function", "to", "set", "default", "values", "for", "this", "Entry", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.entry.php#L306-L339
symphonycms/symphony-2
symphony/lib/toolkit/class.entry.php
Entry.commit
public function commit() { $this->findDefaultData(); return ($this->get('id') ? EntryManager::edit($this) : EntryManager::add($this)); }
php
public function commit() { $this->findDefaultData(); return ($this->get('id') ? EntryManager::edit($this) : EntryManager::add($this)); }
[ "public", "function", "commit", "(", ")", "{", "$", "this", "->", "findDefaultData", "(", ")", ";", "return", "(", "$", "this", "->", "get", "(", "'id'", ")", "?", "EntryManager", "::", "edit", "(", "$", "this", ")", ":", "EntryManager", "::", "add",...
Commits this Entry's data to the database, by first finding the default data for this `Entry` and then utilising the `EntryManager`'s add or edit function. The `EntryManager::edit` function is used if the current `Entry` object has an ID, otherwise `EntryManager::add` is used. @see toolkit.Entry#findDefaultData() @thr...
[ "Commits", "this", "Entry", "s", "data", "to", "the", "database", "by", "first", "finding", "the", "default", "data", "for", "this", "Entry", "and", "then", "utilising", "the", "EntryManager", "s", "add", "or", "edit", "function", ".", "The", "EntryManager",...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.entry.php#L353-L358
symphonycms/symphony-2
symphony/lib/toolkit/class.entry.php
Entry.fetchAllAssociatedEntryCounts
public function fetchAllAssociatedEntryCounts($associated_sections = null) { if (is_null($this->get('section_id'))) { return null; } if (is_null($associated_sections)) { $section = SectionManager::fetch($this->get('section_id')); $associated_sections = $s...
php
public function fetchAllAssociatedEntryCounts($associated_sections = null) { if (is_null($this->get('section_id'))) { return null; } if (is_null($associated_sections)) { $section = SectionManager::fetch($this->get('section_id')); $associated_sections = $s...
[ "public", "function", "fetchAllAssociatedEntryCounts", "(", "$", "associated_sections", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "get", "(", "'section_id'", ")", ")", ")", "{", "return", "null", ";", "}", "if", "(", "is_null", ...
Entries may link to other Entries through fields. This function will return the number of entries that are associated with the current entry as an associative array. If there are no associated entries, null will be returned. @param array $associated_sections An associative array of sections to return the Entry counts ...
[ "Entries", "may", "link", "to", "other", "Entries", "through", "fields", ".", "This", "function", "will", "return", "the", "number", "of", "entries", "that", "are", "associated", "with", "the", "current", "entry", "as", "an", "associative", "array", ".", "If...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.entry.php#L373-L408
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.setFromPOST
public function setFromPOST(array $settings = array()) { $settings['location'] = (isset($settings['location']) ? $settings['location'] : 'main'); $settings['required'] = (isset($settings['required']) && $settings['required'] === 'yes' ? 'yes' : 'no'); $settings['show_column'] = (isset($setti...
php
public function setFromPOST(array $settings = array()) { $settings['location'] = (isset($settings['location']) ? $settings['location'] : 'main'); $settings['required'] = (isset($settings['required']) && $settings['required'] === 'yes' ? 'yes' : 'no'); $settings['show_column'] = (isset($setti...
[ "public", "function", "setFromPOST", "(", "array", "$", "settings", "=", "array", "(", ")", ")", "{", "$", "settings", "[", "'location'", "]", "=", "(", "isset", "(", "$", "settings", "[", "'location'", "]", ")", "?", "$", "settings", "[", "'location'"...
Fill the input data array with default values for known keys provided these settings are not already set. The input array is then used to set the values of the corresponding settings for this field. This function is called when a section is saved. @param array $settings the data array to initialize if necessary.
[ "Fill", "the", "input", "data", "array", "with", "default", "values", "for", "known", "keys", "provided", "these", "settings", "are", "not", "already", "set", ".", "The", "input", "array", "is", "then", "used", "to", "set", "the", "values", "of", "the", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L394-L401
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.get
public function get($setting = null) { if (is_null($setting)) { return $this->_settings; } if (!isset($this->_settings[$setting])) { return null; } return $this->_settings[$setting]; }
php
public function get($setting = null) { if (is_null($setting)) { return $this->_settings; } if (!isset($this->_settings[$setting])) { return null; } return $this->_settings[$setting]; }
[ "public", "function", "get", "(", "$", "setting", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "setting", ")", ")", "{", "return", "$", "this", "->", "_settings", ";", "}", "if", "(", "!", "isset", "(", "$", "this", "->", "_settings", "...
Accessor to the a setting by name. If no setting is provided all the settings of this `Field` instance are returned. @param string $setting (optional) the name of the setting to access the value for. This is optional and defaults to null in which case all settings are returned. @return null|mixed|array the value of th...
[ "Accessor", "to", "the", "a", "setting", "by", "name", ".", "If", "no", "setting", "is", "provided", "all", "the", "settings", "of", "this", "Field", "instance", "are", "returned", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L415-L426
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.displaySettingsPanel
public function displaySettingsPanel(XMLElement &$wrapper, $errors = null) { // Create header $location = ($this->get('location') ? $this->get('location') : 'main'); $header = new XMLElement('header', null, array( 'class' => 'frame-header ' . $location, 'data-name' =>...
php
public function displaySettingsPanel(XMLElement &$wrapper, $errors = null) { // Create header $location = ($this->get('location') ? $this->get('location') : 'main'); $header = new XMLElement('header', null, array( 'class' => 'frame-header ' . $location, 'data-name' =>...
[ "public", "function", "displaySettingsPanel", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "errors", "=", "null", ")", "{", "// Create header", "$", "location", "=", "(", "$", "this", "->", "get", "(", "'location'", ")", "?", "$", "this", "->", "get...
Display the default settings panel, calls the `buildSummaryBlock` function after basic field settings are added to the wrapper. @see buildSummaryBlock() @param XMLElement $wrapper the input XMLElement to which the display of this will be appended. @param mixed $errors the input error collection. this defaults to null....
[ "Display", "the", "default", "settings", "panel", "calls", "the", "buildSummaryBlock", "function", "after", "basic", "field", "settings", "are", "added", "to", "the", "wrapper", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L474-L495
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.buildSummaryBlock
public function buildSummaryBlock($errors = null) { $div = new XMLElement('div'); // Publish label $label = Widget::Label(__('Label')); $label->appendChild( Widget::Input('fields['.$this->get('sortorder').'][label]', $this->get('label')) ); if (isset($err...
php
public function buildSummaryBlock($errors = null) { $div = new XMLElement('div'); // Publish label $label = Widget::Label(__('Label')); $label->appendChild( Widget::Input('fields['.$this->get('sortorder').'][label]', $this->get('label')) ); if (isset($err...
[ "public", "function", "buildSummaryBlock", "(", "$", "errors", "=", "null", ")", "{", "$", "div", "=", "new", "XMLElement", "(", "'div'", ")", ";", "// Publish label", "$", "label", "=", "Widget", "::", "Label", "(", "__", "(", "'Label'", ")", ")", ";"...
Construct the html block to display a summary of this field, which is the field Label and it's location within the section. Any error messages generated are appended to the optional input error array. This function calls `buildLocationSelect` once it is completed @see buildLocationSelect() @param array $errors (option...
[ "Construct", "the", "html", "block", "to", "display", "a", "summary", "of", "this", "field", "which", "is", "the", "field", "Label", "and", "it", "s", "location", "within", "the", "section", ".", "Any", "error", "messages", "generated", "are", "appended", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L510-L546
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.buildLocationSelect
public function buildLocationSelect($selected = null, $name = 'fields[location]', $label_value = null) { if (!$label_value) { $label_value = __('Placement'); } $label = Widget::Label($label_value); $label->setAttribute('class', 'column'); $options = array( ...
php
public function buildLocationSelect($selected = null, $name = 'fields[location]', $label_value = null) { if (!$label_value) { $label_value = __('Placement'); } $label = Widget::Label($label_value); $label->setAttribute('class', 'column'); $options = array( ...
[ "public", "function", "buildLocationSelect", "(", "$", "selected", "=", "null", ",", "$", "name", "=", "'fields[location]'", ",", "$", "label_value", "=", "null", ")", "{", "if", "(", "!", "$", "label_value", ")", "{", "$", "label_value", "=", "__", "(",...
Build the location select widget. This widget allows users to select whether this field will appear in the main content column or in the sidebar when creating a new entry. @param string|null $selected (optional) the currently selected location, if there is one. this defaults to null. @param string $name (optional) the...
[ "Build", "the", "location", "select", "widget", ".", "This", "widget", "allows", "users", "to", "select", "whether", "this", "field", "will", "appear", "in", "the", "main", "content", "column", "or", "in", "the", "sidebar", "when", "creating", "a", "new", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L564-L580
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.buildFormatterSelect
public function buildFormatterSelect($selected = null, $name = 'fields[format]', $label_value) { $formatters = TextformatterManager::listAll(); if (!$label_value) { $label_value = __('Formatting'); } $label = Widget::Label($label_value); $label->setAttribute('cl...
php
public function buildFormatterSelect($selected = null, $name = 'fields[format]', $label_value) { $formatters = TextformatterManager::listAll(); if (!$label_value) { $label_value = __('Formatting'); } $label = Widget::Label($label_value); $label->setAttribute('cl...
[ "public", "function", "buildFormatterSelect", "(", "$", "selected", "=", "null", ",", "$", "name", "=", "'fields[format]'", ",", "$", "label_value", ")", "{", "$", "formatters", "=", "TextformatterManager", "::", "listAll", "(", ")", ";", "if", "(", "!", "...
Construct the html widget for selecting a text formatter for this field. @param string $selected (optional) the currently selected text formatter name if there is one. this defaults to null. @param string $name (optional) the name of this field in the form. this is optional and defaults to "fields[format]". @param str...
[ "Construct", "the", "html", "widget", "for", "selecting", "a", "text", "formatter", "for", "this", "field", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L598-L622
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.buildValidationSelect
public function buildValidationSelect(XMLElement &$wrapper, $selected = null, $name = 'fields[validator]', $type = 'input', array $errors = null) { include TOOLKIT . '/util.validators.php'; $rules = ($type == 'upload' ? $upload : $validators); $label = Widget::Label(__('Validation Rule'));...
php
public function buildValidationSelect(XMLElement &$wrapper, $selected = null, $name = 'fields[validator]', $type = 'input', array $errors = null) { include TOOLKIT . '/util.validators.php'; $rules = ($type == 'upload' ? $upload : $validators); $label = Widget::Label(__('Validation Rule'));...
[ "public", "function", "buildValidationSelect", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "selected", "=", "null", ",", "$", "name", "=", "'fields[validator]'", ",", "$", "type", "=", "'input'", ",", "array", "$", "errors", "=", "null", ")", "{", ...
Append a validator selector to a given `XMLElement`. Note that this function differs from the other two similarly named build functions in that it takes an `XMLElement` to append the Validator to as a parameter, and does not return anything. @param XMLElement $wrapper the parent element to append the XMLElement of the...
[ "Append", "a", "validator", "selector", "to", "a", "given", "XMLElement", ".", "Note", "that", "this", "function", "differs", "from", "the", "other", "two", "similarly", "named", "build", "functions", "in", "that", "it", "takes", "an", "XMLElement", "to", "a...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L645-L671
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.appendAssociationInterfaceSelect
public function appendAssociationInterfaceSelect(XMLElement &$wrapper) { $wrapper->setAttribute('data-condition', 'associative'); $interfaces = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIATION_UI); $editors = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIA...
php
public function appendAssociationInterfaceSelect(XMLElement &$wrapper) { $wrapper->setAttribute('data-condition', 'associative'); $interfaces = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIATION_UI); $editors = Symphony::ExtensionManager()->getProvidersOf(iProvider::ASSOCIA...
[ "public", "function", "appendAssociationInterfaceSelect", "(", "XMLElement", "&", "$", "wrapper", ")", "{", "$", "wrapper", "->", "setAttribute", "(", "'data-condition'", ",", "'associative'", ")", ";", "$", "interfaces", "=", "Symphony", "::", "ExtensionManager", ...
Append the html widget for selecting an association interface and editor for this field. @param XMLElement $wrapper the parent XML element to append the association interface selection to, if either interfaces or editors are provided to the system. @since Symphony 2.5.0
[ "Append", "the", "html", "widget", "for", "selecting", "an", "association", "interface", "and", "editor", "for", "this", "field", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L682-L733
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.getAssociationContext
public function getAssociationContext() { $context = Symphony::Engine()->Page->getContext(); $associations = $context['associations']['parent']; $field_association = array(); $count = 0; if (!empty($associations)) { $associationsCount = count($associations); ...
php
public function getAssociationContext() { $context = Symphony::Engine()->Page->getContext(); $associations = $context['associations']['parent']; $field_association = array(); $count = 0; if (!empty($associations)) { $associationsCount = count($associations); ...
[ "public", "function", "getAssociationContext", "(", ")", "{", "$", "context", "=", "Symphony", "::", "Engine", "(", ")", "->", "Page", "->", "getContext", "(", ")", ";", "$", "associations", "=", "$", "context", "[", "'associations'", "]", "[", "'parent'",...
Get association data of the current field from the page context. @since Symphony 2.5.0 @return array
[ "Get", "association", "data", "of", "the", "current", "field", "from", "the", "page", "context", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L741-L764
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.setAssociationContext
public function setAssociationContext(XMLElement &$wrapper) { $association_context = $this->getAssociationContext(); if (!empty($association_context)) { $wrapper->setAttributeArray(array( 'data-parent-section-id' => $association_context['parent_section_id'], ...
php
public function setAssociationContext(XMLElement &$wrapper) { $association_context = $this->getAssociationContext(); if (!empty($association_context)) { $wrapper->setAttributeArray(array( 'data-parent-section-id' => $association_context['parent_section_id'], ...
[ "public", "function", "setAssociationContext", "(", "XMLElement", "&", "$", "wrapper", ")", "{", "$", "association_context", "=", "$", "this", "->", "getAssociationContext", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "association_context", ")", ")", "...
Set association data for the current field. @since Symphony 2.5.0 @param XMLElement $wrapper
[ "Set", "association", "data", "for", "the", "current", "field", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L772-L786
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.appendShowAssociationCheckbox
public function appendShowAssociationCheckbox(XMLElement &$wrapper, $help = null) { if (!$this->_showassociation) { return; } $label = $this->createCheckboxSetting($wrapper, 'show_association', __('Display associations in entries table'), $help); $label->setAttribute('da...
php
public function appendShowAssociationCheckbox(XMLElement &$wrapper, $help = null) { if (!$this->_showassociation) { return; } $label = $this->createCheckboxSetting($wrapper, 'show_association', __('Display associations in entries table'), $help); $label->setAttribute('da...
[ "public", "function", "appendShowAssociationCheckbox", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "help", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "_showassociation", ")", "{", "return", ";", "}", "$", "label", "=", "$", "this", ...
Append the show association html widget to the input parent XML element. This widget allows fields that provide linking to hide or show the column in the linked section, similar to how the Show Column functionality works, but for the linked section. @param XMLElement $wrapper the parent XML element to append the check...
[ "Append", "the", "show", "association", "html", "widget", "to", "the", "input", "parent", "XML", "element", ".", "This", "widget", "allows", "fields", "that", "provide", "linking", "to", "hide", "or", "show", "the", "column", "in", "the", "linked", "section"...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L835-L843
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.createCheckboxSetting
public function createCheckboxSetting(XMLElement &$wrapper, $setting, $label_description, $help = null) { $order = $this->get('sortorder'); $name = "fields[$order][$setting]"; $label = Widget::Checkbox($name, $this->get($setting), $label_description, $wrapper, $help); $label->addCla...
php
public function createCheckboxSetting(XMLElement &$wrapper, $setting, $label_description, $help = null) { $order = $this->get('sortorder'); $name = "fields[$order][$setting]"; $label = Widget::Checkbox($name, $this->get($setting), $label_description, $wrapper, $help); $label->addCla...
[ "public", "function", "createCheckboxSetting", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "setting", ",", "$", "label_description", ",", "$", "help", "=", "null", ")", "{", "$", "order", "=", "$", "this", "->", "get", "(", "'sortorder'", ")", ";",...
Given the setting name and the label, this helper method will add the required markup for a checkbox to the given `$wrapper`. @since Symphony 2.5.2 @param XMLElement $wrapper Passed by reference, this will have the resulting markup appended to it @param string $setting This will be used with $this->get() to get the ex...
[ "Given", "the", "setting", "name", "and", "the", "label", "this", "helper", "method", "will", "add", "the", "required", "markup", "for", "a", "checkbox", "to", "the", "given", "$wrapper", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L862-L871
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.appendStatusFooter
public function appendStatusFooter(XMLElement &$wrapper) { $fieldset = new XMLElement('fieldset'); $div = new XMLElement('div', null, array('class' => 'two columns')); $this->appendRequiredCheckbox($div); $this->appendShowColumnCheckbox($div); $fieldset->appendChild($div); ...
php
public function appendStatusFooter(XMLElement &$wrapper) { $fieldset = new XMLElement('fieldset'); $div = new XMLElement('div', null, array('class' => 'two columns')); $this->appendRequiredCheckbox($div); $this->appendShowColumnCheckbox($div); $fieldset->appendChild($div); ...
[ "public", "function", "appendStatusFooter", "(", "XMLElement", "&", "$", "wrapper", ")", "{", "$", "fieldset", "=", "new", "XMLElement", "(", "'fieldset'", ")", ";", "$", "div", "=", "new", "XMLElement", "(", "'div'", ",", "null", ",", "array", "(", "'cl...
Append the default status footer to the field settings panel. Displays the required and show column checkboxes. @param XMLElement $wrapper the parent XML element to append the checkbox to. @throws InvalidArgumentException
[ "Append", "the", "default", "status", "footer", "to", "the", "field", "settings", "panel", ".", "Displays", "the", "required", "and", "show", "column", "checkboxes", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L881-L891
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.checkFields
public function checkFields(array &$errors, $checkForDuplicates = true) { $parent_section = $this->get('parent_section'); $label = $this->get('label'); $element_name = $this->get('element_name'); if (Lang::isUnicodeCompiled()) { $valid_name = preg_match('/^[\p{L}]([0-9\p...
php
public function checkFields(array &$errors, $checkForDuplicates = true) { $parent_section = $this->get('parent_section'); $label = $this->get('label'); $element_name = $this->get('element_name'); if (Lang::isUnicodeCompiled()) { $valid_name = preg_match('/^[\p{L}]([0-9\p...
[ "public", "function", "checkFields", "(", "array", "&", "$", "errors", ",", "$", "checkForDuplicates", "=", "true", ")", "{", "$", "parent_section", "=", "$", "this", "->", "get", "(", "'parent_section'", ")", ";", "$", "label", "=", "$", "this", "->", ...
Check the field's settings to ensure they are valid on the section editor @param array $errors the array to populate with the errors found. @param boolean $checkForDuplicates (optional) if set to true, duplicate Field name's in the same section will be flagged as errors. Defaults to true. @return integer returns the s...
[ "Check", "the", "field", "s", "settings", "to", "ensure", "they", "are", "valid", "on", "the", "section", "editor" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L906-L944
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.prepareTableValue
public function prepareTableValue($data, XMLElement $link = null, $entry_id = null) { $value = $this->prepareReadableValue($data, $entry_id, true, __('None')); if ($link) { $link->setValue($value); return $link->generate(); } return $value; }
php
public function prepareTableValue($data, XMLElement $link = null, $entry_id = null) { $value = $this->prepareReadableValue($data, $entry_id, true, __('None')); if ($link) { $link->setValue($value); return $link->generate(); } return $value; }
[ "public", "function", "prepareTableValue", "(", "$", "data", ",", "XMLElement", "$", "link", "=", "null", ",", "$", "entry_id", "=", "null", ")", "{", "$", "value", "=", "$", "this", "->", "prepareReadableValue", "(", "$", "data", ",", "$", "entry_id", ...
Format this field value for display in the publish index tables. Since Symphony 2.5.0, this function will call `Field::prepareReadableValue` in order to get the field's human readable value. @param array $data an associative array of data for this string. At minimum this requires a key of 'value'. @param XMLElement $...
[ "Format", "this", "field", "value", "for", "display", "in", "the", "publish", "index", "tables", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L963-L974
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.prepareReadableValue
public function prepareReadableValue($data, $entry_id = null, $truncate = false, $defaultValue = null) { $value = $this->prepareTextValue($data, $entry_id); if ($truncate) { $max_length = Symphony::Configuration()->get('cell_truncation_length', 'symphony'); $max_length = ($m...
php
public function prepareReadableValue($data, $entry_id = null, $truncate = false, $defaultValue = null) { $value = $this->prepareTextValue($data, $entry_id); if ($truncate) { $max_length = Symphony::Configuration()->get('cell_truncation_length', 'symphony'); $max_length = ($m...
[ "public", "function", "prepareReadableValue", "(", "$", "data", ",", "$", "entry_id", "=", "null", ",", "$", "truncate", "=", "false", ",", "$", "defaultValue", "=", "null", ")", "{", "$", "value", "=", "$", "this", "->", "prepareTextValue", "(", "$", ...
Format this field value for display as readable text value. By default, it will call `Field::prepareTextValue` to get the raw text value of this field. If $truncate is set to true, Symphony will truncate the value to the configuration setting `cell_truncation_length`. @since Symphony 2.5.0 @param array $data an asso...
[ "Format", "this", "field", "value", "for", "display", "as", "readable", "text", "value", ".", "By", "default", "it", "will", "call", "Field", "::", "prepareTextValue", "to", "get", "the", "raw", "text", "value", "of", "this", "field", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L995-L1011
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.createAssociationsDrawerXMLElement
public static function createAssociationsDrawerXMLElement($value, Entry $e, array $parent_association, $prepopulate = '') { $li = new XMLElement('li'); $a = new XMLElement('a', $value); $a->setAttribute('href', SYMPHONY_URL . '/publish/' . $parent_association['handle'] . '/edit/' . $e->get('...
php
public static function createAssociationsDrawerXMLElement($value, Entry $e, array $parent_association, $prepopulate = '') { $li = new XMLElement('li'); $a = new XMLElement('a', $value); $a->setAttribute('href', SYMPHONY_URL . '/publish/' . $parent_association['handle'] . '/edit/' . $e->get('...
[ "public", "static", "function", "createAssociationsDrawerXMLElement", "(", "$", "value", ",", "Entry", "$", "e", ",", "array", "$", "parent_association", ",", "$", "prepopulate", "=", "''", ")", "{", "$", "li", "=", "new", "XMLElement", "(", "'li'", ")", "...
This is general purpose factory method that makes it easier to create the markup needed in order to create an Associations Drawer XMLElement. @since Symphony 2.5.0 @param string $value The value to display in the link @param Entry $e The associated entry @param array $parent_association An array containing informatio...
[ "This", "is", "general", "purpose", "factory", "method", "that", "makes", "it", "easier", "to", "create", "the", "markup", "needed", "in", "order", "to", "create", "an", "Associations", "Drawer", "XMLElement", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1049-L1056
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.prepareAssociationsDrawerXMLElement
public function prepareAssociationsDrawerXMLElement(Entry $e, array $parent_association, $prepopulate = '') { $value = $this->prepareReadableValue($e->getData($this->get('id')), $e->get('id')); // fallback for compatibility since the default // `preparePlainTextValue` is not compatible with...
php
public function prepareAssociationsDrawerXMLElement(Entry $e, array $parent_association, $prepopulate = '') { $value = $this->prepareReadableValue($e->getData($this->get('id')), $e->get('id')); // fallback for compatibility since the default // `preparePlainTextValue` is not compatible with...
[ "public", "function", "prepareAssociationsDrawerXMLElement", "(", "Entry", "$", "e", ",", "array", "$", "parent_association", ",", "$", "prepopulate", "=", "''", ")", "{", "$", "value", "=", "$", "this", "->", "prepareReadableValue", "(", "$", "e", "->", "ge...
Format this field value for display in the Associations Drawer publish index. By default, Symphony will use the return value of the `prepareReadableValue` function. @since Symphony 2.4 @since Symphony 2.5.0 The prepopulate parameter was added. @param Entry $e The associated entry @param array $parent_association An a...
[ "Format", "this", "field", "value", "for", "display", "in", "the", "Associations", "Drawer", "publish", "index", ".", "By", "default", "Symphony", "will", "use", "the", "return", "value", "of", "the", "prepareReadableValue", "function", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1075-L1092
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.displayPublishPanel
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null) { }
php
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null) { }
[ "public", "function", "displayPublishPanel", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "data", "=", "null", ",", "$", "flagWithError", "=", "null", ",", "$", "fieldnamePrefix", "=", "null", ",", "$", "fieldnamePostfix", "=", "null", ",", "$", "entr...
Display the publish panel for this field. The display panel is the interface shown to Authors that allow them to input data into this field for an `Entry`. @param XMLElement $wrapper the XML element to append the html defined user interface to this field. @param array $data (optional) any existing data that has been s...
[ "Display", "the", "publish", "panel", "for", "this", "field", ".", "The", "display", "panel", "is", "the", "interface", "shown", "to", "Authors", "that", "allow", "them", "to", "input", "data", "into", "this", "field", "for", "an", "Entry", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1118-L1120
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.checkPostFieldData
public function checkPostFieldData($data, &$message, $entry_id = null) { $message = null; $has_no_value = is_array($data) ? empty($data) : strlen(trim($data)) == 0; if ($this->get('required') === 'yes' && $has_no_value) { $message = __('‘%s’ is a required field.', array($this->...
php
public function checkPostFieldData($data, &$message, $entry_id = null) { $message = null; $has_no_value = is_array($data) ? empty($data) : strlen(trim($data)) == 0; if ($this->get('required') === 'yes' && $has_no_value) { $message = __('‘%s’ is a required field.', array($this->...
[ "public", "function", "checkPostFieldData", "(", "$", "data", ",", "&", "$", "message", ",", "$", "entry_id", "=", "null", ")", "{", "$", "message", "=", "null", ";", "$", "has_no_value", "=", "is_array", "(", "$", "data", ")", "?", "empty", "(", "$"...
Check the field data that has been posted from a form. This will set the input message to the error message or to null if there is none. Any existing message value will be overwritten. @param array $data the input data to check. @param string $message the place to set any generated error message. any previous value fo...
[ "Check", "the", "field", "data", "that", "has", "been", "posted", "from", "a", "form", ".", "This", "will", "set", "the", "input", "message", "to", "the", "error", "message", "or", "to", "null", "if", "there", "is", "none", ".", "Any", "existing", "mes...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1138-L1151
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.processRawFieldData
public function processRawFieldData($data, &$status, &$message = null, $simulate = false, $entry_id = null) { $status = self::__OK__; return array( 'value' => $data, ); }
php
public function processRawFieldData($data, &$status, &$message = null, $simulate = false, $entry_id = null) { $status = self::__OK__; return array( 'value' => $data, ); }
[ "public", "function", "processRawFieldData", "(", "$", "data", ",", "&", "$", "status", ",", "&", "$", "message", "=", "null", ",", "$", "simulate", "=", "false", ",", "$", "entry_id", "=", "null", ")", "{", "$", "status", "=", "self", "::", "__OK__"...
Process the raw field data. @param mixed $data post data from the entry form @param integer $status the status code resultant from processing the data. @param string $message the place to set any generated error message. any previous value for this variable will be overwritten. @param boolean $simulate (optional) true...
[ "Process", "the", "raw", "field", "data", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1173-L1180
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.displayDatasourceFilterPanel
public function displayDatasourceFilterPanel(XMLElement &$wrapper, $data = null, $errors = null, $fieldnamePrefix = null, $fieldnamePostfix = null) { $wrapper->appendChild(new XMLElement('header', '<h4>' . $this->get('label') . '</h4> <span>' . $this->name() . '</span>', array( 'data-name' => $t...
php
public function displayDatasourceFilterPanel(XMLElement &$wrapper, $data = null, $errors = null, $fieldnamePrefix = null, $fieldnamePostfix = null) { $wrapper->appendChild(new XMLElement('header', '<h4>' . $this->get('label') . '</h4> <span>' . $this->name() . '</span>', array( 'data-name' => $t...
[ "public", "function", "displayDatasourceFilterPanel", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "data", "=", "null", ",", "$", "errors", "=", "null", ",", "$", "fieldnamePrefix", "=", "null", ",", "$", "fieldnamePostfix", "=", "null", ")", "{", "$"...
Display the default data source filter panel. @param XMLElement $wrapper the input XMLElement to which the display of this will be appended. @param mixed $data (optional) the input data. this defaults to null. @param null $errors the input error collection. this defaults to null. @param string $fieldnamePrefix the pre...
[ "Display", "the", "default", "data", "source", "filter", "panel", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1259-L1274
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.displayFilteringOptions
public function displayFilteringOptions(XMLElement &$wrapper) { // Add filter tags $filterTags = new XMLElement('ul'); $filterTags->setAttribute('class', 'tags singular'); $filterTags->setAttribute('data-interactive', 'data-interactive'); $filters = $this->fetchFilterableOpe...
php
public function displayFilteringOptions(XMLElement &$wrapper) { // Add filter tags $filterTags = new XMLElement('ul'); $filterTags->setAttribute('class', 'tags singular'); $filterTags->setAttribute('data-interactive', 'data-interactive'); $filters = $this->fetchFilterableOpe...
[ "public", "function", "displayFilteringOptions", "(", "XMLElement", "&", "$", "wrapper", ")", "{", "// Add filter tags", "$", "filterTags", "=", "new", "XMLElement", "(", "'ul'", ")", ";", "$", "filterTags", "->", "setAttribute", "(", "'class'", ",", "'tags sing...
Inserts tags at the bottom of the filter panel @since Symphony 2.6.0 @param XMLElement $wrapper
[ "Inserts", "tags", "at", "the", "bottom", "of", "the", "filter", "panel" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1282-L1307
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.buildRegexSQL
public function buildRegexSQL($filter, array $columns, &$joins, &$where) { $this->_key++; $field_id = $this->get('id'); $filter = $this->cleanValue($filter); $op = ''; if (preg_match('/^regexp:\s*/i', $filter)) { $pattern = preg_replace('/^regexp:\s*/i', null, $f...
php
public function buildRegexSQL($filter, array $columns, &$joins, &$where) { $this->_key++; $field_id = $this->get('id'); $filter = $this->cleanValue($filter); $op = ''; if (preg_match('/^regexp:\s*/i', $filter)) { $pattern = preg_replace('/^regexp:\s*/i', null, $f...
[ "public", "function", "buildRegexSQL", "(", "$", "filter", ",", "array", "$", "columns", ",", "&", "$", "joins", ",", "&", "$", "where", ")", "{", "$", "this", "->", "_key", "++", ";", "$", "field_id", "=", "$", "this", "->", "get", "(", "'id'", ...
Builds a basic REGEXP statement given a `$filter`. This function supports `regexp:` or `not-regexp:`. Users should keep in mind this function uses MySQL patterns, not the usual PHP patterns, the syntax between these flavours differs at times. @since Symphony 2.3 @link https://dev.mysql.com/doc/refman/en/regexp.html @p...
[ "Builds", "a", "basic", "REGEXP", "statement", "given", "a", "$filter", ".", "This", "function", "supports", "regexp", ":", "or", "not", "-", "regexp", ":", ".", "Users", "should", "keep", "in", "mind", "this", "function", "uses", "MySQL", "patterns", "not...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1363-L1402
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.buildFilterSQL
public function buildFilterSQL($filter, array $columns, &$joins, &$where) { $this->_key++; $field_id = $this->get('id'); $filter = $this->cleanValue($filter); $pattern = ''; if (preg_match('/^sql:\s*NOT NULL$/i', $filter)) { $pattern = 'NOT NULL'; } elsei...
php
public function buildFilterSQL($filter, array $columns, &$joins, &$where) { $this->_key++; $field_id = $this->get('id'); $filter = $this->cleanValue($filter); $pattern = ''; if (preg_match('/^sql:\s*NOT NULL$/i', $filter)) { $pattern = 'NOT NULL'; } elsei...
[ "public", "function", "buildFilterSQL", "(", "$", "filter", ",", "array", "$", "columns", ",", "&", "$", "joins", ",", "&", "$", "where", ")", "{", "$", "this", "->", "_key", "++", ";", "$", "field_id", "=", "$", "this", "->", "get", "(", "'id'", ...
Builds a basic NULL/NOT NULL SQL statement given a `$filter`. This function supports `sql: NULL` or `sql: NOT NULL`. @since Symphony 2.7.0 @link https://dev.mysql.com/doc/refman/en/regexp.html @param string $filter The full filter, eg. `sql: NULL` @param array $columns The array of columns that need the given `$filter...
[ "Builds", "a", "basic", "NULL", "/", "NOT", "NULL", "SQL", "statement", "given", "a", "$filter", ".", "This", "function", "supports", "sql", ":", "NULL", "or", "sql", ":", "NOT", "NULL", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1441-L1473
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.buildSortingSelectSQL
public function buildSortingSelectSQL($sort, $order = 'ASC') { if ($this->isRandomOrder($order)) { return null; } // @deprecated This check should be removed in Symphony 3.0.0 if (strpos($sort, '`ed`.`value`') === false) { return null; } return...
php
public function buildSortingSelectSQL($sort, $order = 'ASC') { if ($this->isRandomOrder($order)) { return null; } // @deprecated This check should be removed in Symphony 3.0.0 if (strpos($sort, '`ed`.`value`') === false) { return null; } return...
[ "public", "function", "buildSortingSelectSQL", "(", "$", "sort", ",", "$", "order", "=", "'ASC'", ")", "{", "if", "(", "$", "this", "->", "isRandomOrder", "(", "$", "order", ")", ")", "{", "return", "null", ";", "}", "// @deprecated This check should be remo...
Build the needed SQL clause command to make `buildSortingSQL()` work on MySQL 5.7 in strict mode, which requires all columns in the ORDER BY clause to be included in the SELECT's projection. If no new projection is needed (like if the order is made via a sub-query), simply return null. For backward compatibility, thi...
[ "Build", "the", "needed", "SQL", "clause", "command", "to", "make", "buildSortingSQL", "()", "work", "on", "MySQL", "5", ".", "7", "in", "strict", "mode", "which", "requires", "all", "columns", "in", "the", "ORDER", "BY", "clause", "to", "be", "included", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1622-L1632
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.appendFormattedElement
public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null) { $wrapper->appendChild(new XMLElement($this->get('element_name'), ($encode ? General::sanitize($this->prepareReadableValue($data, $entry_id)) : ...
php
public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null) { $wrapper->appendChild(new XMLElement($this->get('element_name'), ($encode ? General::sanitize($this->prepareReadableValue($data, $entry_id)) : ...
[ "public", "function", "appendFormattedElement", "(", "XMLElement", "&", "$", "wrapper", ",", "$", "data", ",", "$", "encode", "=", "false", ",", "$", "mode", "=", "null", ",", "$", "entry_id", "=", "null", ")", "{", "$", "wrapper", "->", "appendChild", ...
Append the formatted XML output of this field as utilized as a data source. Since Symphony 2.5.0, it will defaults to `prepareReadableValue` return value. @param XMLElement $wrapper the XML element to append the XML representation of this to. @param array $data the current set of values for this field. the values are...
[ "Append", "the", "formatted", "XML", "output", "of", "this", "field", "as", "utilized", "as", "a", "data", "source", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1691-L1696
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.commit
public function commit() { $fields = array(); $fields['label'] = General::sanitize($this->get('label')); $fields['element_name'] = ($this->get('element_name') ? $this->get('element_name') : Lang::createHandle($this->get('label'))); $fields['parent_section'] = $this->get('parent_sect...
php
public function commit() { $fields = array(); $fields['label'] = General::sanitize($this->get('label')); $fields['element_name'] = ($this->get('element_name') ? $this->get('element_name') : Lang::createHandle($this->get('label'))); $fields['parent_section'] = $this->get('parent_sect...
[ "public", "function", "commit", "(", ")", "{", "$", "fields", "=", "array", "(", ")", ";", "$", "fields", "[", "'label'", "]", "=", "General", "::", "sanitize", "(", "$", "this", "->", "get", "(", "'label'", ")", ")", ";", "$", "fields", "[", "'e...
Commit the settings of this field from the section editor to create an instance of this field in a section. @return boolean true if the commit was successful, false otherwise.
[ "Commit", "the", "settings", "of", "this", "field", "from", "the", "section", "editor", "to", "create", "an", "instance", "of", "this", "field", "in", "a", "section", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1723-L1747
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.exists
public function exists() { if (!$this->get('id') || !$this->_handle) { return false; } $row = Symphony::Database()->fetch(sprintf( 'SELECT `id` FROM `tbl_fields_%s` WHERE `field_id` = %d', $this->_handle, General::intval($this->get('id')) ...
php
public function exists() { if (!$this->get('id') || !$this->_handle) { return false; } $row = Symphony::Database()->fetch(sprintf( 'SELECT `id` FROM `tbl_fields_%s` WHERE `field_id` = %d', $this->_handle, General::intval($this->get('id')) ...
[ "public", "function", "exists", "(", ")", "{", "if", "(", "!", "$", "this", "->", "get", "(", "'id'", ")", "||", "!", "$", "this", "->", "_handle", ")", "{", "return", "false", ";", "}", "$", "row", "=", "Symphony", "::", "Database", "(", ")", ...
Checks that we are working with a valid field handle and field id, and checks that the field record exists in the settings table. @since Symphony 2.7.1 It does check if the settings table only contains default columns and assume those fields do not require a record in the settings table. When this situation is detecte...
[ "Checks", "that", "we", "are", "working", "with", "a", "valid", "field", "handle", "and", "field", "id", "and", "checks", "that", "the", "field", "record", "exists", "in", "the", "settings", "table", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1822-L1863
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.entryDataCleanup
public function entryDataCleanup($entry_id, $data = null) { $where = is_array($entry_id) ? " `entry_id` IN (" . implode(',', $entry_id) . ") " : " `entry_id` = '$entry_id' "; Symphony::Database()->delete('tbl_entries_data_' . $this->get('id'), $where); return true; ...
php
public function entryDataCleanup($entry_id, $data = null) { $where = is_array($entry_id) ? " `entry_id` IN (" . implode(',', $entry_id) . ") " : " `entry_id` = '$entry_id' "; Symphony::Database()->delete('tbl_entries_data_' . $this->get('id'), $where); return true; ...
[ "public", "function", "entryDataCleanup", "(", "$", "entry_id", ",", "$", "data", "=", "null", ")", "{", "$", "where", "=", "is_array", "(", "$", "entry_id", ")", "?", "\" `entry_id` IN (\"", ".", "implode", "(", "','", ",", "$", "entry_id", ")", ".", ...
Remove the entry data of this field from the database. @param integer|array $entry_id the ID of the entry, or an array of entry ID's to delete. @param array $data (optional) The entry data provided for fields to do additional cleanup This is an optional argument and defaults to null. @throws DatabaseException @return ...
[ "Remove", "the", "entry", "data", "of", "this", "field", "from", "the", "database", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1877-L1886
symphonycms/symphony-2
symphony/lib/toolkit/class.field.php
Field.findRelatedEntries
public function findRelatedEntries($entry_id, $parent_field_id) { try { $ids = Symphony::Database()->fetchCol('entry_id', sprintf(" SELECT `entry_id` FROM `tbl_entries_data_%d` WHERE `relation_id` = %d AND `entry_id` IS NOT NULL ...
php
public function findRelatedEntries($entry_id, $parent_field_id) { try { $ids = Symphony::Database()->fetchCol('entry_id', sprintf(" SELECT `entry_id` FROM `tbl_entries_data_%d` WHERE `relation_id` = %d AND `entry_id` IS NOT NULL ...
[ "public", "function", "findRelatedEntries", "(", "$", "entry_id", ",", "$", "parent_field_id", ")", "{", "try", "{", "$", "ids", "=", "Symphony", "::", "Database", "(", ")", "->", "fetchCol", "(", "'entry_id'", ",", "sprintf", "(", "\"\n SELECT ...
Find related entries from a linking field's data table. Default implementation uses column names `entry_id` and `relation_id` as with the Select Box Link @since Symphony 2.5.0 @param integer $entry_id @param integer $parent_field_id @return array
[ "Find", "related", "entries", "from", "a", "linking", "field", "s", "data", "table", ".", "Default", "implementation", "uses", "column", "names", "entry_id", "and", "relation_id", "as", "with", "the", "Select", "Box", "Link" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.field.php#L1954-L1968
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.add
public static function add(array $fields) { if (!isset($fields['sortorder'])) { $fields['sortorder'] = self::fetchNextSortOrder(); } if (!Symphony::Database()->insert($fields, 'tbl_pages')) { return false; } return Symphony::Database()->getInsertID()...
php
public static function add(array $fields) { if (!isset($fields['sortorder'])) { $fields['sortorder'] = self::fetchNextSortOrder(); } if (!Symphony::Database()->insert($fields, 'tbl_pages')) { return false; } return Symphony::Database()->getInsertID()...
[ "public", "static", "function", "add", "(", "array", "$", "fields", ")", "{", "if", "(", "!", "isset", "(", "$", "fields", "[", "'sortorder'", "]", ")", ")", "{", "$", "fields", "[", "'sortorder'", "]", "=", "self", "::", "fetchNextSortOrder", "(", "...
Given an associative array of data, where the key is the column name in `tbl_pages` and the value is the data, this function will create a new Page and return a Page ID on success. @param array $fields Associative array of field names => values for the Page @throws DatabaseException @return integer|boolean Returns the...
[ "Given", "an", "associative", "array", "of", "data", "where", "the", "key", "is", "the", "column", "name", "in", "tbl_pages", "and", "the", "value", "is", "the", "data", "this", "function", "will", "create", "a", "new", "Page", "and", "return", "a", "Pag...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L28-L39
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchTitleFromHandle
public static function fetchTitleFromHandle($handle) { return Symphony::Database()->fetchVar('title', 0, sprintf( "SELECT `title` FROM `tbl_pages` WHERE `handle` = '%s' LIMIT 1", Symphony::Database()->cleanValue($handle) )); }
php
public static function fetchTitleFromHandle($handle) { return Symphony::Database()->fetchVar('title', 0, sprintf( "SELECT `title` FROM `tbl_pages` WHERE `handle` = '%s' LIMIT 1", Symphony::Database()->cleanValue($handle) )); }
[ "public", "static", "function", "fetchTitleFromHandle", "(", "$", "handle", ")", "{", "return", "Symphony", "::", "Database", "(", ")", "->", "fetchVar", "(", "'title'", ",", "0", ",", "sprintf", "(", "\"SELECT `title`\n FROM `tbl_pages`\n WHERE ...
Return a Page title by the handle @param string $handle The handle of the page @return integer The Page title
[ "Return", "a", "Page", "title", "by", "the", "handle" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L49-L58
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchIDFromHandle
public static function fetchIDFromHandle($handle) { return Symphony::Database()->fetchVar('id', 0, sprintf( "SELECT `id` FROM `tbl_pages` WHERE `handle` = '%s' LIMIT 1", Symphony::Database()->cleanValue($handle) )); }
php
public static function fetchIDFromHandle($handle) { return Symphony::Database()->fetchVar('id', 0, sprintf( "SELECT `id` FROM `tbl_pages` WHERE `handle` = '%s' LIMIT 1", Symphony::Database()->cleanValue($handle) )); }
[ "public", "static", "function", "fetchIDFromHandle", "(", "$", "handle", ")", "{", "return", "Symphony", "::", "Database", "(", ")", "->", "fetchVar", "(", "'id'", ",", "0", ",", "sprintf", "(", "\"SELECT `id`\n FROM `tbl_pages`\n WHERE `handle` ...
Return a Page ID by the handle @param string $handle The handle of the page @return integer The Page ID
[ "Return", "a", "Page", "ID", "by", "the", "handle" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L68-L77
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.addPageTypesToPage
public static function addPageTypesToPage($page_id = null, array $types) { if (is_null($page_id)) { return false; } PageManager::deletePageTypes($page_id); foreach ($types as $type) { Symphony::Database()->insert( array( '...
php
public static function addPageTypesToPage($page_id = null, array $types) { if (is_null($page_id)) { return false; } PageManager::deletePageTypes($page_id); foreach ($types as $type) { Symphony::Database()->insert( array( '...
[ "public", "static", "function", "addPageTypesToPage", "(", "$", "page_id", "=", "null", ",", "array", "$", "types", ")", "{", "if", "(", "is_null", "(", "$", "page_id", ")", ")", "{", "return", "false", ";", "}", "PageManager", "::", "deletePageTypes", "...
Given a Page ID and an array of types, this function will add Page types to that Page. If a Page types are stored in `tbl_pages_types`. @param integer $page_id The Page ID to add the Types to @param array $types An array of page types @throws DatabaseException @return boolean
[ "Given", "a", "Page", "ID", "and", "an", "array", "of", "types", "this", "function", "will", "add", "Page", "types", "to", "that", "Page", ".", "If", "a", "Page", "types", "are", "stored", "in", "tbl_pages_types", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L90-L109
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.createPageFiles
public static function createPageFiles($new_path, $new_handle, $old_path = null, $old_handle = null) { $new = PageManager::resolvePageFileLocation($new_path, $new_handle); $old = PageManager::resolvePageFileLocation($old_path, $old_handle); // Nothing to do: if (file_exists($new) &&...
php
public static function createPageFiles($new_path, $new_handle, $old_path = null, $old_handle = null) { $new = PageManager::resolvePageFileLocation($new_path, $new_handle); $old = PageManager::resolvePageFileLocation($old_path, $old_handle); // Nothing to do: if (file_exists($new) &&...
[ "public", "static", "function", "createPageFiles", "(", "$", "new_path", ",", "$", "new_handle", ",", "$", "old_path", "=", "null", ",", "$", "old_handle", "=", "null", ")", "{", "$", "new", "=", "PageManager", "::", "resolvePageFileLocation", "(", "$", "n...
This function creates the initial `.xsl` template for the page, whether that be from the `TEMPLATES/blueprints.page.xsl` file, or from an existing template with the same name. This function will handle the renaming of a page by creating the new files using the old files as the templates then removing the old template. ...
[ "This", "function", "creates", "the", "initial", ".", "xsl", "template", "for", "the", "page", "whether", "that", "be", "from", "the", "TEMPLATES", "/", "blueprints", ".", "page", ".", "xsl", "file", "or", "from", "an", "existing", "template", "with", "the...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L163-L214
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.writePageFiles
public static function writePageFiles($path, $data) { return General::writeFile($path, $data, Symphony::Configuration()->get('write_mode', 'file')); }
php
public static function writePageFiles($path, $data) { return General::writeFile($path, $data, Symphony::Configuration()->get('write_mode', 'file')); }
[ "public", "static", "function", "writePageFiles", "(", "$", "path", ",", "$", "data", ")", "{", "return", "General", "::", "writeFile", "(", "$", "path", ",", "$", "data", ",", "Symphony", "::", "Configuration", "(", ")", "->", "get", "(", "'write_mode'"...
A wrapper for `General::writeFile`, this function takes a `$path` and a `$data` and writes the new template to disk. @param string $path The path to write the template to @param string $data The contents of the template @return boolean true when written successfully, false otherwise
[ "A", "wrapper", "for", "General", "::", "writeFile", "this", "function", "takes", "a", "$path", "and", "a", "$data", "and", "writes", "the", "new", "template", "to", "disk", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L227-L230
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.edit
public static function edit($page_id, array $fields, $delete_types = false) { if (!is_numeric($page_id)) { return false; } if (isset($fields['id'])) { unset($fields['id']); } if (Symphony::Database()->update($fields, 'tbl_pages', sprintf("`id` = %d",...
php
public static function edit($page_id, array $fields, $delete_types = false) { if (!is_numeric($page_id)) { return false; } if (isset($fields['id'])) { unset($fields['id']); } if (Symphony::Database()->update($fields, 'tbl_pages', sprintf("`id` = %d",...
[ "public", "static", "function", "edit", "(", "$", "page_id", ",", "array", "$", "fields", ",", "$", "delete_types", "=", "false", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "page_id", ")", ")", "{", "return", "false", ";", "}", "if", "(", "i...
This function will update a Page in `tbl_pages` given a `$page_id` and an associative array of `$fields`. A third parameter, `$delete_types` will also delete the Page's associated Page Types if passed true. @see toolkit.PageManager#addPageTypesToPage() @param integer $page_id The ID of the Page that should be updated ...
[ "This", "function", "will", "update", "a", "Page", "in", "tbl_pages", "given", "a", "$page_id", "and", "an", "associative", "array", "of", "$fields", ".", "A", "third", "parameter", "$delete_types", "will", "also", "delete", "the", "Page", "s", "associated", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L249-L269
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.editPageChildren
public static function editPageChildren($page_id = null, $page_path = null) { if (!is_int($page_id)) { return false; } $page_path = trim($page_path, '/'); $children = PageManager::fetchChildPages($page_id); foreach ($children as $child) { $child_id =...
php
public static function editPageChildren($page_id = null, $page_path = null) { if (!is_int($page_id)) { return false; } $page_path = trim($page_path, '/'); $children = PageManager::fetchChildPages($page_id); foreach ($children as $child) { $child_id =...
[ "public", "static", "function", "editPageChildren", "(", "$", "page_id", "=", "null", ",", "$", "page_path", "=", "null", ")", "{", "if", "(", "!", "is_int", "(", "$", "page_id", ")", ")", "{", "return", "false", ";", "}", "$", "page_path", "=", "tri...
This function will update all children of a particular page (if any) by renaming/moving all related files to their new path and updating their database information. This is a recursive function and will work to any depth. @param integer $page_id The ID of the Page whose children need to be updated @param string $page_...
[ "This", "function", "will", "update", "all", "children", "of", "a", "particular", "page", "(", "if", "any", ")", "by", "renaming", "/", "moving", "all", "related", "files", "to", "their", "new", "path", "and", "updating", "their", "database", "information", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L286-L313
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.delete
public static function delete($page_id = null, $delete_files = true) { if (!is_int($page_id)) { return false; } $can_proceed = true; // Delete Files (if told to) if ($delete_files) { $page = PageManager::fetchPageByID($page_id, array('path', 'handle'...
php
public static function delete($page_id = null, $delete_files = true) { if (!is_int($page_id)) { return false; } $can_proceed = true; // Delete Files (if told to) if ($delete_files) { $page = PageManager::fetchPageByID($page_id, array('path', 'handle'...
[ "public", "static", "function", "delete", "(", "$", "page_id", "=", "null", ",", "$", "delete_files", "=", "true", ")", "{", "if", "(", "!", "is_int", "(", "$", "page_id", ")", ")", "{", "return", "false", ";", "}", "$", "can_proceed", "=", "true", ...
This function takes a Page ID and removes the Page from the database in `tbl_pages` and it's associated Page Types in `tbl_pages_types`. This function does not delete any of the Page's children. @see toolkit.PageManager#deletePageTypes @see toolkit.PageManager#deletePageFiles @param integer $page_id The ID of the Page...
[ "This", "function", "takes", "a", "Page", "ID", "and", "removes", "the", "Page", "from", "the", "database", "in", "tbl_pages", "and", "it", "s", "associated", "Page", "Types", "in", "tbl_pages_types", ".", "This", "function", "does", "not", "delete", "any", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L331-L366
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.deletePageTypes
public static function deletePageTypes($page_id = null) { if (is_null($page_id)) { return false; } return Symphony::Database()->delete('tbl_pages_types', sprintf(" `page_id` = %d ", $page_id)); }
php
public static function deletePageTypes($page_id = null) { if (is_null($page_id)) { return false; } return Symphony::Database()->delete('tbl_pages_types', sprintf(" `page_id` = %d ", $page_id)); }
[ "public", "static", "function", "deletePageTypes", "(", "$", "page_id", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "page_id", ")", ")", "{", "return", "false", ";", "}", "return", "Symphony", "::", "Database", "(", ")", "->", "delete", "(",...
Given a `$page_id`, this function will remove all associated Page Types from `tbl_pages_types`. @param integer $page_id The ID of the Page that should be deleted. @throws DatabaseException @return boolean
[ "Given", "a", "$page_id", "this", "function", "will", "remove", "all", "associated", "Page", "Types", "from", "tbl_pages_types", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L377-L384
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.deletePageFiles
public static function deletePageFiles($page_path, $handle) { $file = PageManager::resolvePageFileLocation($page_path, $handle); // Nothing to do: if (!file_exists($file)) { return true; } // Delete it: if (General::deleteFile($file)) { retur...
php
public static function deletePageFiles($page_path, $handle) { $file = PageManager::resolvePageFileLocation($page_path, $handle); // Nothing to do: if (!file_exists($file)) { return true; } // Delete it: if (General::deleteFile($file)) { retur...
[ "public", "static", "function", "deletePageFiles", "(", "$", "page_path", ",", "$", "handle", ")", "{", "$", "file", "=", "PageManager", "::", "resolvePageFileLocation", "(", "$", "page_path", ",", "$", "handle", ")", ";", "// Nothing to do:", "if", "(", "!"...
Given a Page's `$path` and `$handle`, this function will remove it's templates from the `PAGES` directory returning boolean on completion @param string $page_path The path of the Page, which is the handles of the Page parents. If the page has multiple parents, they will be separated by a forward slash. eg. article/rea...
[ "Given", "a", "Page", "s", "$path", "and", "$handle", "this", "function", "will", "remove", "it", "s", "templates", "from", "the", "PAGES", "directory", "returning", "boolean", "on", "completion" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L400-L415
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetch
public static function fetch($include_types = true, array $select = array(), array $where = array(), $order_by = null, $hierarchical = false) { if ($hierarchical) { $select = array_merge($select, array('id', 'parent')); } if (empty($select)) { $select = array('*'); ...
php
public static function fetch($include_types = true, array $select = array(), array $where = array(), $order_by = null, $hierarchical = false) { if ($hierarchical) { $select = array_merge($select, array('id', 'parent')); } if (empty($select)) { $select = array('*'); ...
[ "public", "static", "function", "fetch", "(", "$", "include_types", "=", "true", ",", "array", "$", "select", "=", "array", "(", ")", ",", "array", "$", "where", "=", "array", "(", ")", ",", "$", "order_by", "=", "null", ",", "$", "hierarchical", "="...
This function will return an associative array of Page information. The information returned is defined by the `$include_types` and `$select` parameters, which will return the Page Types for the Page and allow a developer to restrict what information is returned about the Page. Optionally, `$where` and `$order_by` para...
[ "This", "function", "will", "return", "an", "associative", "array", "of", "Page", "information", ".", "The", "information", "returned", "is", "defined", "by", "the", "$include_types", "and", "$select", "parameters", "which", "will", "return", "the", "Page", "Typ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L447-L490
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchPageByID
public static function fetchPageByID($page_id = null, array $select = array()) { if (is_null($page_id)) { return null; } if (!is_array($page_id)) { $page_id = array( Symphony::Database()->cleanValue($page_id) ); } if (empt...
php
public static function fetchPageByID($page_id = null, array $select = array()) { if (is_null($page_id)) { return null; } if (!is_array($page_id)) { $page_id = array( Symphony::Database()->cleanValue($page_id) ); } if (empt...
[ "public", "static", "function", "fetchPageByID", "(", "$", "page_id", "=", "null", ",", "array", "$", "select", "=", "array", "(", ")", ")", "{", "if", "(", "is_null", "(", "$", "page_id", ")", ")", "{", "return", "null", ";", "}", "if", "(", "!", ...
Returns Pages that match the given `$page_id`. Developers can optionally choose to specify what Page information is returned using the `$select` parameter. @param integer|array $page_id The ID of the Page, or an array of ID's @param array $select (optional) Accepts an array of columns to return from `tbl_pages`. If om...
[ "Returns", "Pages", "that", "match", "the", "given", "$page_id", ".", "Developers", "can", "optionally", "choose", "to", "specify", "what", "Page", "information", "is", "returned", "using", "the", "$select", "parameter", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L523-L544
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchPageByType
public static function fetchPageByType($type = null) { if (is_null($type)) { return PageManager::fetch(); } $pages = Symphony::Database()->fetch(sprintf( "SELECT `p`.* FROM `tbl_pages` AS `p` LEFT JOIN ...
php
public static function fetchPageByType($type = null) { if (is_null($type)) { return PageManager::fetch(); } $pages = Symphony::Database()->fetch(sprintf( "SELECT `p`.* FROM `tbl_pages` AS `p` LEFT JOIN ...
[ "public", "static", "function", "fetchPageByType", "(", "$", "type", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "type", ")", ")", "{", "return", "PageManager", "::", "fetch", "(", ")", ";", "}", "$", "pages", "=", "Symphony", "::", "Datab...
Returns Pages that match the given `$type`. If no `$type` is provided the function returns the result of `PageManager::fetch`. @param string $type Where the type is one of the available Page Types. @return array|null An associative array of Page information with the key being the column name from `tbl_pages` and the v...
[ "Returns", "Pages", "that", "match", "the", "given", "$type", ".", "If", "no", "$type", "is", "provided", "the", "function", "returns", "the", "result", "of", "PageManager", "::", "fetch", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L558-L577
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchChildPages
public static function fetchChildPages($page_id = null, array $select = array()) { if (is_null($page_id)) { return null; } if (empty($select)) { $select = array('*'); } return PageManager::fetch(false, $select, array( sprintf('id != %d', ...
php
public static function fetchChildPages($page_id = null, array $select = array()) { if (is_null($page_id)) { return null; } if (empty($select)) { $select = array('*'); } return PageManager::fetch(false, $select, array( sprintf('id != %d', ...
[ "public", "static", "function", "fetchChildPages", "(", "$", "page_id", "=", "null", ",", "array", "$", "select", "=", "array", "(", ")", ")", "{", "if", "(", "is_null", "(", "$", "page_id", ")", ")", "{", "return", "null", ";", "}", "if", "(", "em...
Returns the child Pages (if any) of the given `$page_id`. @param integer $page_id The ID of the Page. @param array $select (optional) Accepts an array of columns to return from `tbl_pages`. If omitted, all columns from the table will be returned. @return array|null An associative array of Page information with the key...
[ "Returns", "the", "child", "Pages", "(", "if", "any", ")", "of", "the", "given", "$page_id", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L593-L607
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchPageTypes
public static function fetchPageTypes($page_id = null) { return Symphony::Database()->fetchCol('type', sprintf( "SELECT type FROM `tbl_pages_types` AS pt WHERE %s GROUP BY pt.type ORDE...
php
public static function fetchPageTypes($page_id = null) { return Symphony::Database()->fetchCol('type', sprintf( "SELECT type FROM `tbl_pages_types` AS pt WHERE %s GROUP BY pt.type ORDE...
[ "public", "static", "function", "fetchPageTypes", "(", "$", "page_id", "=", "null", ")", "{", "return", "Symphony", "::", "Database", "(", ")", "->", "fetchCol", "(", "'type'", ",", "sprintf", "(", "\"SELECT\n type\n FROM\n `tb...
This function returns a Page's Page Types. If the `$page_id` parameter is given, the types returned will be for that Page. @param integer $page_id The ID of the Page. @return array An array of the Page Types
[ "This", "function", "returns", "a", "Page", "s", "Page", "Types", ".", "If", "the", "$page_id", "parameter", "is", "given", "the", "types", "returned", "will", "be", "for", "that", "Page", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L618-L633
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchAvailablePageTypes
public static function fetchAvailablePageTypes() { $system_types = array('index', 'XML', 'JSON', 'admin', '404', '403'); $types = PageManager::fetchPageTypes(); return (!empty($types) ? General::array_remove_duplicates(array_merge($system_types, $types)) : $system_types); }
php
public static function fetchAvailablePageTypes() { $system_types = array('index', 'XML', 'JSON', 'admin', '404', '403'); $types = PageManager::fetchPageTypes(); return (!empty($types) ? General::array_remove_duplicates(array_merge($system_types, $types)) : $system_types); }
[ "public", "static", "function", "fetchAvailablePageTypes", "(", ")", "{", "$", "system_types", "=", "array", "(", "'index'", ",", "'XML'", ",", "'JSON'", ",", "'admin'", ",", "'404'", ",", "'403'", ")", ";", "$", "types", "=", "PageManager", "::", "fetchPa...
Returns all the page types that exist in this Symphony install. There are 6 default system page types, and new types can be added by Developers via the Page Editor. @since Symphony 2.3 introduced the JSON type. @return array An array of strings of the page types used in this Symphony install. At the minimum, this will...
[ "Returns", "all", "the", "page", "types", "that", "exist", "in", "this", "Symphony", "install", ".", "There", "are", "6", "default", "system", "page", "types", "and", "new", "types", "can", "be", "added", "by", "Developers", "via", "the", "Page", "Editor",...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L646-L653
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.fetchAllPagesPageTypes
public static function fetchAllPagesPageTypes() { $types = Symphony::Database()->fetch("SELECT `page_id`,`type` FROM `tbl_pages_types`"); $page_types = array(); if (is_array($types)) { foreach ($types as $type) { $page_types[$type['page_id']][] = $type['type']; ...
php
public static function fetchAllPagesPageTypes() { $types = Symphony::Database()->fetch("SELECT `page_id`,`type` FROM `tbl_pages_types`"); $page_types = array(); if (is_array($types)) { foreach ($types as $type) { $page_types[$type['page_id']][] = $type['type']; ...
[ "public", "static", "function", "fetchAllPagesPageTypes", "(", ")", "{", "$", "types", "=", "Symphony", "::", "Database", "(", ")", "->", "fetch", "(", "\"SELECT `page_id`,`type` FROM `tbl_pages_types`\"", ")", ";", "$", "page_types", "=", "array", "(", ")", ";"...
Fetch an associated array with Page ID's and the types they're using. @throws DatabaseException @return array A 2-dimensional associated array where the key is the page ID.
[ "Fetch", "an", "associated", "array", "with", "Page", "ID", "s", "and", "the", "types", "they", "re", "using", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L683-L695
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.getChildPagesCount
public static function getChildPagesCount($page_id = null) { if (is_null($page_id)) { return null; } $children = PageManager::fetch(false, array('id'), array( sprintf('parent = %d', $page_id) )); $count = count($children); if ($count > 0) { ...
php
public static function getChildPagesCount($page_id = null) { if (is_null($page_id)) { return null; } $children = PageManager::fetch(false, array('id'), array( sprintf('parent = %d', $page_id) )); $count = count($children); if ($count > 0) { ...
[ "public", "static", "function", "getChildPagesCount", "(", "$", "page_id", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "page_id", ")", ")", "{", "return", "null", ";", "}", "$", "children", "=", "PageManager", "::", "fetch", "(", "false", ",...
This function will return the number of child pages for a given `$page_id`. This is a recursive function and will return the absolute count. @param integer $page_id The ID of the Page. @return integer The number of child pages for the given `$page_id`
[ "This", "function", "will", "return", "the", "number", "of", "child", "pages", "for", "a", "given", "$page_id", ".", "This", "is", "a", "recursive", "function", "and", "will", "return", "the", "absolute", "count", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L740-L758
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.hasPageTypeBeenUsed
public static function hasPageTypeBeenUsed($page_id = null, $type) { return (boolean)Symphony::Database()->fetchRow(0, sprintf( "SELECT pt.id FROM `tbl_pages_types` AS pt WHERE pt.page_id != %d AND pt.type = ...
php
public static function hasPageTypeBeenUsed($page_id = null, $type) { return (boolean)Symphony::Database()->fetchRow(0, sprintf( "SELECT pt.id FROM `tbl_pages_types` AS pt WHERE pt.page_id != %d AND pt.type = ...
[ "public", "static", "function", "hasPageTypeBeenUsed", "(", "$", "page_id", "=", "null", ",", "$", "type", ")", "{", "return", "(", "boolean", ")", "Symphony", "::", "Database", "(", ")", "->", "fetchRow", "(", "0", ",", "sprintf", "(", "\"SELECT\n ...
Returns boolean if a the given `$type` has been used by Symphony for a Page that is not `$page_id`. @param integer $page_id The ID of the Page to exclude from the query. @param string $type The Page Type to look for in `tbl_page_types`. @return boolean true if the type is used, false otherwise
[ "Returns", "boolean", "if", "a", "the", "given", "$type", "has", "been", "used", "by", "Symphony", "for", "a", "Page", "that", "is", "not", "$page_id", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L771-L785
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.resolvePage
public static function resolvePage($page_id, $column) { $page = Symphony::Database()->fetchRow(0, sprintf( "SELECT p.%s, p.parent FROM `tbl_pages` AS p WHERE p.id = %d OR p.handle = '%s' ...
php
public static function resolvePage($page_id, $column) { $page = Symphony::Database()->fetchRow(0, sprintf( "SELECT p.%s, p.parent FROM `tbl_pages` AS p WHERE p.id = %d OR p.handle = '%s' ...
[ "public", "static", "function", "resolvePage", "(", "$", "page_id", ",", "$", "column", ")", "{", "$", "page", "=", "Symphony", "::", "Database", "(", ")", "->", "fetchRow", "(", "0", ",", "sprintf", "(", "\"SELECT\n p.%s,\n p.paren...
Given the `$page_id` and a `$column`, this function will return an array of the given `$column` for the Page, including all parents. @param mixed $page_id The ID of the Page that currently being viewed, or the handle of the current Page @param string $column @return array An array of the current Page, containing the `...
[ "Given", "the", "$page_id", "and", "a", "$column", "this", "function", "will", "return", "an", "array", "of", "the", "given", "$column", "for", "the", "Page", "including", "all", "parents", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L843-L888
symphonycms/symphony-2
symphony/lib/toolkit/class.pagemanager.php
PageManager.resolvePageByPath
public static function resolvePageByPath($handle, $path = false) { return Symphony::Database()->fetchRow(0, sprintf( "SELECT * FROM `tbl_pages` WHERE `path` %s AND `handle` = '%s' LIMIT 1", ($path ? " = '".Symphony::Database()->cleanValue($path)."'" : 'IS NULL'), Symphony...
php
public static function resolvePageByPath($handle, $path = false) { return Symphony::Database()->fetchRow(0, sprintf( "SELECT * FROM `tbl_pages` WHERE `path` %s AND `handle` = '%s' LIMIT 1", ($path ? " = '".Symphony::Database()->cleanValue($path)."'" : 'IS NULL'), Symphony...
[ "public", "static", "function", "resolvePageByPath", "(", "$", "handle", ",", "$", "path", "=", "false", ")", "{", "return", "Symphony", "::", "Database", "(", ")", "->", "fetchRow", "(", "0", ",", "sprintf", "(", "\"SELECT * FROM `tbl_pages` WHERE `path` %s AND...
Resolve a page by it's handle and path @param $handle The handle of the page @param boolean $path The path to the page @return mixed Array if found, false if not
[ "Resolve", "a", "page", "by", "it", "s", "handle", "and", "path" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.pagemanager.php#L938-L945
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.generate
public function generate($page = null) { $full_generate = true; $devkit = null; $output = null; $this->addHeaderToPage('Cache-Control', 'no-cache, must-revalidate, max-age=0'); $this->addHeaderToPage('Expires', 'Mon, 12 Dec 1982 06:14:00 GMT'); $this->addHeaderToPage...
php
public function generate($page = null) { $full_generate = true; $devkit = null; $output = null; $this->addHeaderToPage('Cache-Control', 'no-cache, must-revalidate, max-age=0'); $this->addHeaderToPage('Expires', 'Mon, 12 Dec 1982 06:14:00 GMT'); $this->addHeaderToPage...
[ "public", "function", "generate", "(", "$", "page", "=", "null", ")", "{", "$", "full_generate", "=", "true", ";", "$", "devkit", "=", "null", ";", "$", "output", "=", "null", ";", "$", "this", "->", "addHeaderToPage", "(", "'Cache-Control'", ",", "'no...
This function is called immediately from the Frontend class passing the current URL for generation. Generate will resolve the URL to the specific page in the Symphony and then execute all events and datasources registered to this page so that it can be rendered. A number of delegates are fired during stages of executio...
[ "This", "function", "is", "called", "immediately", "from", "the", "Frontend", "class", "passing", "the", "current", "URL", "for", "generation", ".", "Generate", "will", "resolve", "the", "URL", "to", "the", "specific", "page", "in", "the", "Symphony", "and", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L161-L305
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.__buildPage
private function __buildPage() { $start = precision_timer(); if (!$page = $this->resolvePage()) { throw new FrontendPageNotFoundException; } /** * Just after having resolved the page, but prior to any commencement of output creation * @delegate Fronten...
php
private function __buildPage() { $start = precision_timer(); if (!$page = $this->resolvePage()) { throw new FrontendPageNotFoundException; } /** * Just after having resolved the page, but prior to any commencement of output creation * @delegate Fronten...
[ "private", "function", "__buildPage", "(", ")", "{", "$", "start", "=", "precision_timer", "(", ")", ";", "if", "(", "!", "$", "page", "=", "$", "this", "->", "resolvePage", "(", ")", ")", "{", "throw", "new", "FrontendPageNotFoundException", ";", "}", ...
This function sets the page's parameters, processes the Datasources and Events and sets the `$xml` and `$xsl` variables. This functions resolves the `$page` by calling the `resolvePage()` function. If a page is not found, it attempts to locate the Symphony 404 page set in the backend otherwise it throws the default Sym...
[ "This", "function", "sets", "the", "page", "s", "parameters", "processes", "the", "Datasources", "and", "Events", "and", "sets", "the", "$xml", "and", "$xsl", "variables", ".", "This", "functions", "resolves", "the", "$page", "by", "calling", "the", "resolvePa...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L325-L546
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.resolvePage
public function resolvePage($page = null) { if ($page) { $this->_page = $page; } $row = null; /** * Before page resolve. Allows manipulation of page without redirection * @delegate FrontendPrePageResolve * @param string $context * '/fr...
php
public function resolvePage($page = null) { if ($page) { $this->_page = $page; } $row = null; /** * Before page resolve. Allows manipulation of page without redirection * @delegate FrontendPrePageResolve * @param string $context * '/fr...
[ "public", "function", "resolvePage", "(", "$", "page", "=", "null", ")", "{", "if", "(", "$", "page", ")", "{", "$", "this", "->", "_page", "=", "$", "page", ";", "}", "$", "row", "=", "null", ";", "/**\n * Before page resolve. Allows manipulation ...
This function attempts to resolve the given page in to it's Symphony page. If no page is given, it is assumed the 'index' is being requested. Before a page row is returned, it is checked to see that if it has the 'admin' type, that the requesting user is authenticated as a Symphony author. If they are not, the Symphony...
[ "This", "function", "attempts", "to", "resolve", "the", "given", "page", "in", "to", "it", "s", "Symphony", "page", ".", "If", "no", "page", "is", "given", "it", "is", "assumed", "the", "index", "is", "being", "requested", ".", "Before", "a", "page", "...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L568-L671
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.__isSchemaValid
private function __isSchemaValid($schema, array $bits) { $schema_arr = preg_split('/\//', $schema, -1, PREG_SPLIT_NO_EMPTY); return (count($schema_arr) >= count($bits)); }
php
private function __isSchemaValid($schema, array $bits) { $schema_arr = preg_split('/\//', $schema, -1, PREG_SPLIT_NO_EMPTY); return (count($schema_arr) >= count($bits)); }
[ "private", "function", "__isSchemaValid", "(", "$", "schema", ",", "array", "$", "bits", ")", "{", "$", "schema_arr", "=", "preg_split", "(", "'/\\//'", ",", "$", "schema", ",", "-", "1", ",", "PREG_SPLIT_NO_EMPTY", ")", ";", "return", "(", "count", "(",...
Given the allowed params for the resolved page, compare it to params provided in the URL. If the number of params provided is less than or equal to the number of URL parameters set for a page, the Schema is considered valid, otherwise, it's considered to be false a 404 page will result. @param string $schema The URL s...
[ "Given", "the", "allowed", "params", "for", "the", "resolved", "page", "compare", "it", "to", "params", "provided", "in", "the", "URL", ".", "If", "the", "number", "of", "params", "provided", "is", "less", "than", "or", "equal", "to", "the", "number", "o...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L689-L694
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.processEvents
private function processEvents($events, XMLElement &$wrapper) { /** * Manipulate the events array and event element wrapper * @delegate FrontendProcessEvents * @param string $context * '/frontend/' * @param array $env * @param string $events * ...
php
private function processEvents($events, XMLElement &$wrapper) { /** * Manipulate the events array and event element wrapper * @delegate FrontendProcessEvents * @param string $context * '/frontend/' * @param array $env * @param string $events * ...
[ "private", "function", "processEvents", "(", "$", "events", ",", "XMLElement", "&", "$", "wrapper", ")", "{", "/**\n * Manipulate the events array and event element wrapper\n * @delegate FrontendProcessEvents\n * @param string $context\n * '/frontend/'\n ...
The processEvents function executes all Events attached to the resolved page in the correct order determined by `__findEventOrder()`. The results from the Events are appended to the page's XML. Events execute first, before Datasources. @uses FrontendProcessEvents @uses FrontendEventPostProcess @param string $events A ...
[ "The", "processEvents", "function", "executes", "all", "Events", "attached", "to", "the", "resolved", "page", "in", "the", "correct", "order", "determined", "by", "__findEventOrder", "()", ".", "The", "results", "from", "the", "Events", "are", "appended", "to", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L712-L783
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.__findEventOrder
private function __findEventOrder($a, $b) { if ($a->priority() == $b->priority()) { $a = $a->about(); $b = $b->about(); $handles = array($a['name'], $b['name']); asort($handles); return (key($handles) == 0) ? -1 : 1; } return $a->...
php
private function __findEventOrder($a, $b) { if ($a->priority() == $b->priority()) { $a = $a->about(); $b = $b->about(); $handles = array($a['name'], $b['name']); asort($handles); return (key($handles) == 0) ? -1 : 1; } return $a->...
[ "private", "function", "__findEventOrder", "(", "$", "a", ",", "$", "b", ")", "{", "if", "(", "$", "a", "->", "priority", "(", ")", "==", "$", "b", "->", "priority", "(", ")", ")", "{", "$", "a", "=", "$", "a", "->", "about", "(", ")", ";", ...
This function determines the correct order that events should be executed in. Events are executed based off priority, with `Event::kHIGH` priority executing first. If there is more than one Event of the same priority, they are then executed in alphabetical order. This function is designed to be used with PHP's uasort f...
[ "This", "function", "determines", "the", "correct", "order", "that", "events", "should", "be", "executed", "in", ".", "Events", "are", "executed", "based", "off", "priority", "with", "Event", "::", "kHIGH", "priority", "executing", "first", ".", "If", "there",...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L797-L809
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.processDatasources
public function processDatasources($datasources, XMLElement &$wrapper, array $params = array()) { if (trim($datasources) == '') { return; } $datasources = preg_split('/,\s*/i', $datasources, -1, PREG_SPLIT_NO_EMPTY); $datasources = array_map('trim', $datasources); ...
php
public function processDatasources($datasources, XMLElement &$wrapper, array $params = array()) { if (trim($datasources) == '') { return; } $datasources = preg_split('/,\s*/i', $datasources, -1, PREG_SPLIT_NO_EMPTY); $datasources = array_map('trim', $datasources); ...
[ "public", "function", "processDatasources", "(", "$", "datasources", ",", "XMLElement", "&", "$", "wrapper", ",", "array", "$", "params", "=", "array", "(", ")", ")", "{", "if", "(", "trim", "(", "$", "datasources", ")", "==", "''", ")", "{", "return",...
Given an array of all the Datasources for this page, sort them into the correct execution order and append the Datasource results to the page XML. If the Datasource provides any parameters, they will be added to the `$env` pool for use by other Datasources and eventual inclusion into the page parameters. @param string...
[ "Given", "an", "array", "of", "all", "the", "Datasources", "for", "this", "page", "sort", "them", "into", "the", "correct", "execution", "order", "and", "append", "the", "Datasource", "results", "to", "the", "page", "XML", ".", "If", "the", "Datasource", "...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L830-L935
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.__findDatasourceOrder
private function __findDatasourceOrder($dependenciesList) { if (!is_array($dependenciesList) || empty($dependenciesList)) { return; } foreach ($dependenciesList as $handle => $dependencies) { foreach ($dependencies as $i => $dependency) { $dependency ...
php
private function __findDatasourceOrder($dependenciesList) { if (!is_array($dependenciesList) || empty($dependenciesList)) { return; } foreach ($dependenciesList as $handle => $dependencies) { foreach ($dependencies as $i => $dependency) { $dependency ...
[ "private", "function", "__findDatasourceOrder", "(", "$", "dependenciesList", ")", "{", "if", "(", "!", "is_array", "(", "$", "dependenciesList", ")", "||", "empty", "(", "$", "dependenciesList", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", "dep...
The function finds the correct order Datasources need to be processed in to satisfy all dependencies that parameters can resolve correctly and in time for other Datasources to filter on. @param array $dependenciesList An associative array with the key being the Datasource handle and the values being it's dependencies....
[ "The", "function", "finds", "the", "correct", "order", "Datasources", "need", "to", "be", "processed", "in", "to", "satisfy", "all", "dependencies", "that", "parameters", "can", "resolve", "correctly", "and", "in", "time", "for", "other", "Datasources", "to", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L948-L995
symphonycms/symphony-2
symphony/lib/toolkit/class.frontendpage.php
FrontendPage.__buildDatasourcePooledParamList
private function __buildDatasourcePooledParamList($datasources) { if (!is_array($datasources) || empty($datasources)) { return array(); } $list = array(); foreach ($datasources as $handle) { $rootelement = str_replace('_', '-', $handle); $list[] ...
php
private function __buildDatasourcePooledParamList($datasources) { if (!is_array($datasources) || empty($datasources)) { return array(); } $list = array(); foreach ($datasources as $handle) { $rootelement = str_replace('_', '-', $handle); $list[] ...
[ "private", "function", "__buildDatasourcePooledParamList", "(", "$", "datasources", ")", "{", "if", "(", "!", "is_array", "(", "$", "datasources", ")", "||", "empty", "(", "$", "datasources", ")", ")", "{", "return", "array", "(", ")", ";", "}", "$", "li...
Given an array of datasource dependancies, this function will translate each of them to be a valid datasource handle. @param array $datasources The datasource dependencies @return array An array of the handlised datasources
[ "Given", "an", "array", "of", "datasource", "dependancies", "this", "function", "will", "translate", "each", "of", "them", "to", "be", "a", "valid", "datasource", "handle", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.frontendpage.php#L1006-L1020
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.execute
public function execute(array &$param_pool = null) { $result = new XMLElement($this->dsParamROOTELEMENT); try { $result = $this->execute($param_pool); } catch (FrontendPageNotFoundException $e) { // Work around. This ensures the 404 page is displayed and ...
php
public function execute(array &$param_pool = null) { $result = new XMLElement($this->dsParamROOTELEMENT); try { $result = $this->execute($param_pool); } catch (FrontendPageNotFoundException $e) { // Work around. This ensures the 404 page is displayed and ...
[ "public", "function", "execute", "(", "array", "&", "$", "param_pool", "=", "null", ")", "{", "$", "result", "=", "new", "XMLElement", "(", "$", "this", "->", "dsParamROOTELEMENT", ")", ";", "try", "{", "$", "result", "=", "$", "this", "->", "execute",...
The meat of the Datasource, this function includes the datasource type's file that will preform the logic to return the data for this datasource It is passed the current parameters. @param array $param_pool The current parameter pool that this Datasource can use when filtering and finding Entries or data. @return XMLE...
[ "The", "meat", "of", "the", "Datasource", "this", "function", "includes", "the", "datasource", "type", "s", "file", "that", "will", "preform", "the", "logic", "to", "return", "the", "data", "for", "this", "datasource", "It", "is", "passed", "the", "current",...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L181-L205
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.determineFilterType
public static function determineFilterType($value) { // Check for two possible combos // 1. The old pattern, which is ' + ' // 2. A new pattern, which accounts for '+' === ' ' in urls $pattern = '/(\s+\+\s+)|(\+\+\+)/'; return preg_match($pattern, $value) === 1 ? Datasource...
php
public static function determineFilterType($value) { // Check for two possible combos // 1. The old pattern, which is ' + ' // 2. A new pattern, which accounts for '+' === ' ' in urls $pattern = '/(\s+\+\s+)|(\+\+\+)/'; return preg_match($pattern, $value) === 1 ? Datasource...
[ "public", "static", "function", "determineFilterType", "(", "$", "value", ")", "{", "// Check for two possible combos", "// 1. The old pattern, which is ' + '", "// 2. A new pattern, which accounts for '+' === ' ' in urls", "$", "pattern", "=", "'/(\\s+\\+\\s+)|(\\+\\+\\+)/'", ";",...
By default, all Symphony filters are considering to be OR and " + " filters are used for AND. They are all used and Entries must match each filter to be included. It is possible to use OR filtering in a field by using an ", " to separate the values. If the filter is "test1, test2", this will match any entries where th...
[ "By", "default", "all", "Symphony", "filters", "are", "considering", "to", "be", "OR", "and", "+", "filters", "are", "used", "for", "AND", ".", "They", "are", "all", "used", "and", "Entries", "must", "match", "each", "filter", "to", "be", "included", "."...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L225-L232
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.splitFilter
public static function splitFilter($filter_type, $value) { $pattern = $filter_type === Datasource::FILTER_AND ? '\+' : '(?<!\\\\),'; $value = preg_split('/\s*' . $pattern . '\s*/', $value, -1, PREG_SPLIT_NO_EMPTY); $value = array_map('trim', $value); $value = array_map(array('Datasou...
php
public static function splitFilter($filter_type, $value) { $pattern = $filter_type === Datasource::FILTER_AND ? '\+' : '(?<!\\\\),'; $value = preg_split('/\s*' . $pattern . '\s*/', $value, -1, PREG_SPLIT_NO_EMPTY); $value = array_map('trim', $value); $value = array_map(array('Datasou...
[ "public", "static", "function", "splitFilter", "(", "$", "filter_type", ",", "$", "value", ")", "{", "$", "pattern", "=", "$", "filter_type", "===", "Datasource", "::", "FILTER_AND", "?", "'\\+'", ":", "'(?<!\\\\\\\\),'", ";", "$", "value", "=", "preg_split"...
Splits the filter string value into an array. @since Symphony 2.7.0 @param int $filter_type The filter's type, as determined by `determineFilterType()`. Valid values are Datasource::FILTER_OR or Datasource::FILTER_AND @param string $value The filter's value @return array The splitted filter value, according to its typ...
[ "Splits", "the", "filter", "string", "value", "into", "an", "array", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L246-L253
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.emptyXMLSet
public function emptyXMLSet(XMLElement $xml = null) { if (is_null($xml)) { $xml = new XMLElement($this->dsParamROOTELEMENT); } $xml->appendChild($this->__noRecordsFound()); return $xml; }
php
public function emptyXMLSet(XMLElement $xml = null) { if (is_null($xml)) { $xml = new XMLElement($this->dsParamROOTELEMENT); } $xml->appendChild($this->__noRecordsFound()); return $xml; }
[ "public", "function", "emptyXMLSet", "(", "XMLElement", "$", "xml", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "xml", ")", ")", "{", "$", "xml", "=", "new", "XMLElement", "(", "$", "this", "->", "dsParamROOTELEMENT", ")", ";", "}", "$", ...
If there is no results to return this function calls `Datasource::__noRecordsFound` which appends an XMLElement to the current root element. @param XMLElement $xml The root element XMLElement for this datasource. By default, this will the handle of the datasource, as defined by `$this->dsParamROOTELEMENT` @return XMLE...
[ "If", "there", "is", "no", "results", "to", "return", "this", "function", "calls", "Datasource", "::", "__noRecordsFound", "which", "appends", "an", "XMLElement", "to", "the", "current", "root", "element", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L264-L273
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.negateXMLSet
public function negateXMLSet(XMLElement $xml = null) { if (is_null($xml)) { $xml = new XMLElement($this->dsParamROOTELEMENT); } $xml->appendChild($this->__negateResult()); return $xml; }
php
public function negateXMLSet(XMLElement $xml = null) { if (is_null($xml)) { $xml = new XMLElement($this->dsParamROOTELEMENT); } $xml->appendChild($this->__negateResult()); return $xml; }
[ "public", "function", "negateXMLSet", "(", "XMLElement", "$", "xml", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "xml", ")", ")", "{", "$", "xml", "=", "new", "XMLElement", "(", "$", "this", "->", "dsParamROOTELEMENT", ")", ";", "}", "$", ...
If the datasource has been negated this function calls `Datasource::__negateResult` which appends an XMLElement to the current root element. @param XMLElement $xml The root element XMLElement for this datasource. By default, this will the handle of the datasource, as defined by `$this->dsParamROOTELEMENT` @return XMLE...
[ "If", "the", "datasource", "has", "been", "negated", "this", "function", "calls", "Datasource", "::", "__negateResult", "which", "appends", "an", "XMLElement", "to", "the", "current", "root", "element", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L284-L293
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.processParameters
public function processParameters(array $env = null) { if ($env) { $this->_env = $env; } if ((isset($this->_env) && is_array($this->_env)) && isset($this->dsParamFILTERS) && is_array($this->dsParamFILTERS) && !empty($this->dsParamFILTERS)) { foreach ($this->dsParamFI...
php
public function processParameters(array $env = null) { if ($env) { $this->_env = $env; } if ((isset($this->_env) && is_array($this->_env)) && isset($this->dsParamFILTERS) && is_array($this->dsParamFILTERS) && !empty($this->dsParamFILTERS)) { foreach ($this->dsParamFI...
[ "public", "function", "processParameters", "(", "array", "$", "env", "=", "null", ")", "{", "if", "(", "$", "env", ")", "{", "$", "this", "->", "_env", "=", "$", "env", ";", "}", "if", "(", "(", "isset", "(", "$", "this", "->", "_env", ")", "&&...
This function will iterates over the filters and replace any parameters with their actual values. All other Datasource variables such as sorting, ordering and pagination variables are also set by this function @param array $env The environment variables from the Frontend class which includes any params set by Symphony...
[ "This", "function", "will", "iterates", "over", "the", "filters", "and", "replace", "any", "parameters", "with", "their", "actual", "values", ".", "All", "other", "Datasource", "variables", "such", "as", "sorting", "ordering", "and", "pagination", "variables", "...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L329-L396
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.parseParamURL
public function parseParamURL($url = null) { if (!isset($url)) { return null; } // urlencode parameters $params = array(); if (preg_match_all('@{([^}]+)}@i', $url, $matches, PREG_SET_ORDER)) { foreach ($matches as $m) { $params[$m[1]]...
php
public function parseParamURL($url = null) { if (!isset($url)) { return null; } // urlencode parameters $params = array(); if (preg_match_all('@{([^}]+)}@i', $url, $matches, PREG_SET_ORDER)) { foreach ($matches as $m) { $params[$m[1]]...
[ "public", "function", "parseParamURL", "(", "$", "url", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "url", ")", ")", "{", "return", "null", ";", "}", "// urlencode parameters", "$", "params", "=", "array", "(", ")", ";", "if", "(", "p...
This function will parse a string (usually a URL) and fully evaluate any parameters (defined by {$param}) to return the absolute string value. @since Symphony 2.3 @param string $url The string (usually a URL) that contains the parameters (or doesn't) @return string The parsed URL
[ "This", "function", "will", "parse", "a", "string", "(", "usually", "a", "URL", ")", "and", "fully", "evaluate", "any", "parameters", "(", "defined", "by", "{", "$param", "}", ")", "to", "return", "the", "absolute", "string", "value", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L408-L435
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.__processParametersInString
public function __processParametersInString($value, array $env, $includeParenthesis = true, $escape = false) { if (trim($value) == '') { return null; } if (!$includeParenthesis) { $value = '{'.$value.'}'; } if (preg_match_all('@{([^}]+)}@i', $value, ...
php
public function __processParametersInString($value, array $env, $includeParenthesis = true, $escape = false) { if (trim($value) == '') { return null; } if (!$includeParenthesis) { $value = '{'.$value.'}'; } if (preg_match_all('@{([^}]+)}@i', $value, ...
[ "public", "function", "__processParametersInString", "(", "$", "value", ",", "array", "$", "env", ",", "$", "includeParenthesis", "=", "true", ",", "$", "escape", "=", "false", ")", "{", "if", "(", "trim", "(", "$", "value", ")", "==", "''", ")", "{", ...
This function will replace any parameters in a string with their value. Parameters are defined by being prefixed by a `$` character. In certain situations, the parameter will be surrounded by `{}`, which Symphony takes to mean, evaluate this parameter to a value, other times it will be omitted which is usually used to ...
[ "This", "function", "will", "replace", "any", "parameters", "in", "a", "string", "with", "their", "value", ".", "Parameters", "are", "defined", "by", "being", "prefixed", "by", "a", "$", "character", ".", "In", "certain", "situations", "the", "parameter", "w...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L461-L512
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.findParameterInEnv
public static function findParameterInEnv($needle, $env) { if (isset($env['env']['url'][$needle])) { return $env['env']['url'][$needle]; } if (isset($env['env']['pool'][$needle])) { return $env['env']['pool'][$needle]; } if (isset($env['param'][$need...
php
public static function findParameterInEnv($needle, $env) { if (isset($env['env']['url'][$needle])) { return $env['env']['url'][$needle]; } if (isset($env['env']['pool'][$needle])) { return $env['env']['pool'][$needle]; } if (isset($env['param'][$need...
[ "public", "static", "function", "findParameterInEnv", "(", "$", "needle", ",", "$", "env", ")", "{", "if", "(", "isset", "(", "$", "env", "[", "'env'", "]", "[", "'url'", "]", "[", "$", "needle", "]", ")", ")", "{", "return", "$", "env", "[", "'e...
Parameters can exist in three different facets of Symphony; in the URL, in the parameter pool or as an Symphony param. This function will attempt to find a parameter in those three areas and return the value. If it is not found null is returned @param string $needle The parameter name @param array $env The environment...
[ "Parameters", "can", "exist", "in", "three", "different", "facets", "of", "Symphony", ";", "in", "the", "URL", "in", "the", "parameter", "pool", "or", "as", "an", "Symphony", "param", ".", "This", "function", "will", "attempt", "to", "find", "a", "paramete...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L553-L568
symphonycms/symphony-2
symphony/lib/toolkit/class.datasource.php
Datasource.__determineFilterType
public function __determineFilterType($value) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('Datasource::__determineFilterType()', 'Datasource::determineFilterType()'); } return self::determineFilterType($value); }
php
public function __determineFilterType($value) { if (Symphony::Log()) { Symphony::Log()->pushDeprecateWarningToLog('Datasource::__determineFilterType()', 'Datasource::determineFilterType()'); } return self::determineFilterType($value); }
[ "public", "function", "__determineFilterType", "(", "$", "value", ")", "{", "if", "(", "Symphony", "::", "Log", "(", ")", ")", "{", "Symphony", "::", "Log", "(", ")", "->", "pushDeprecateWarningToLog", "(", "'Datasource::__determineFilterType()'", ",", "'Datasou...
By default, all Symphony filters are considering to be OR and "+" filters are used for AND. They are all used and Entries must match each filter to be included. It is possible to use OR filtering in a field by using an "," to separate the values. eg. If the filter is "test1, test2", this will match any entries where th...
[ "By", "default", "all", "Symphony", "filters", "are", "considering", "to", "be", "OR", "and", "+", "filters", "are", "used", "for", "AND", ".", "They", "are", "all", "used", "and", "Entries", "must", "match", "each", "filter", "to", "be", "included", "."...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.datasource.php#L586-L592
symphonycms/symphony-2
symphony/lib/toolkit/cryptography/class.pbkdf2.php
PBKDF2.hash
public static function hash($input, $salt = null, $iterations = null, $keylength = null) { if ($salt === null) { $salt = self::generateSalt(self::SALT_LENGTH); } if ($iterations === null) { $iterations = self::ITERATIONS; } if ($keylength === null) {...
php
public static function hash($input, $salt = null, $iterations = null, $keylength = null) { if ($salt === null) { $salt = self::generateSalt(self::SALT_LENGTH); } if ($iterations === null) { $iterations = self::ITERATIONS; } if ($keylength === null) {...
[ "public", "static", "function", "hash", "(", "$", "input", ",", "$", "salt", "=", "null", ",", "$", "iterations", "=", "null", ",", "$", "keylength", "=", "null", ")", "{", "if", "(", "$", "salt", "===", "null", ")", "{", "$", "salt", "=", "self"...
Uses `PBKDF2` and random salt generation to create a hash based on some input. Original implementation was under public domain, taken from http://www.itnewb.com/tutorial/Encrypting-Passwords-with-PHP-for-Storage-Using-the-RSA-PBKDF2-Standard @param string $input the string to be hashed @param string $salt an optional ...
[ "Uses", "PBKDF2", "and", "random", "salt", "generation", "to", "create", "a", "hash", "based", "on", "some", "input", ".", "Original", "implementation", "was", "under", "public", "domain", "taken", "from", "http", ":", "//", "www", ".", "itnewb", ".", "com...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/cryptography/class.pbkdf2.php#L56-L85
symphonycms/symphony-2
symphony/lib/toolkit/cryptography/class.pbkdf2.php
PBKDF2.compare
public static function compare($input, $hash, $isHash = false) { $salt = self::extractSalt($hash); $iterations = self::extractIterations($hash); $keylength = strlen(base64_decode(self::extractHash($hash))); return $hash === self::hash($input, $salt, $iterations, $keylength); }
php
public static function compare($input, $hash, $isHash = false) { $salt = self::extractSalt($hash); $iterations = self::extractIterations($hash); $keylength = strlen(base64_decode(self::extractHash($hash))); return $hash === self::hash($input, $salt, $iterations, $keylength); }
[ "public", "static", "function", "compare", "(", "$", "input", ",", "$", "hash", ",", "$", "isHash", "=", "false", ")", "{", "$", "salt", "=", "self", "::", "extractSalt", "(", "$", "hash", ")", ";", "$", "iterations", "=", "self", "::", "extractItera...
Compares a given hash with a cleantext password. Also extracts the salt from the hash. @param string $input the cleartext password @param string $hash the hash the password should be checked against @param boolean $isHash @return boolean the result of the comparison
[ "Compares", "a", "given", "hash", "with", "a", "cleantext", "password", ".", "Also", "extracts", "the", "salt", "from", "the", "hash", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/cryptography/class.pbkdf2.php#L99-L106
symphonycms/symphony-2
symphony/lib/toolkit/cryptography/class.pbkdf2.php
PBKDF2.requiresMigration
public static function requiresMigration($hash) { $length = self::extractSaltlength($hash); $iterations = self::extractIterations($hash); $keylength = strlen(base64_decode(self::extractHash($hash))); if ($length !== self::SALT_LENGTH || $iterations !== self::ITERATIONS || $keylength...
php
public static function requiresMigration($hash) { $length = self::extractSaltlength($hash); $iterations = self::extractIterations($hash); $keylength = strlen(base64_decode(self::extractHash($hash))); if ($length !== self::SALT_LENGTH || $iterations !== self::ITERATIONS || $keylength...
[ "public", "static", "function", "requiresMigration", "(", "$", "hash", ")", "{", "$", "length", "=", "self", "::", "extractSaltlength", "(", "$", "hash", ")", ";", "$", "iterations", "=", "self", "::", "extractIterations", "(", "$", "hash", ")", ";", "$"...
Checks if provided hash has been computed by most recent algorithm returns true if otherwise @param string $hash the hash to be checked @return boolean whether the hash should be re-computed
[ "Checks", "if", "provided", "hash", "has", "been", "computed", "by", "most", "recent", "algorithm", "returns", "true", "if", "otherwise" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/cryptography/class.pbkdf2.php#L175-L186
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.getValue
public function getValue() { $value = ''; if (is_array($this->_value)) { foreach ($this->_value as $v) { if ($v instanceof XMLElement) { $value .= $v->generate(); } else { $value .= $v; } ...
php
public function getValue() { $value = ''; if (is_array($this->_value)) { foreach ($this->_value as $v) { if ($v instanceof XMLElement) { $value .= $v->generate(); } else { $value .= $v; } ...
[ "public", "function", "getValue", "(", ")", "{", "$", "value", "=", "''", ";", "if", "(", "is_array", "(", "$", "this", "->", "_value", ")", ")", "{", "foreach", "(", "$", "this", "->", "_value", "as", "$", "v", ")", "{", "if", "(", "$", "v", ...
Accessor for `$_value` @return string|XMLElement
[ "Accessor", "for", "$_value" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L145-L162
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.getChild
public function getChild($position) { if (!isset($this->_children[$this->getRealIndex($position)])) { return null; } return $this->_children[$this->getRealIndex($position)]; }
php
public function getChild($position) { if (!isset($this->_children[$this->getRealIndex($position)])) { return null; } return $this->_children[$this->getRealIndex($position)]; }
[ "public", "function", "getChild", "(", "$", "position", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_children", "[", "$", "this", "->", "getRealIndex", "(", "$", "position", ")", "]", ")", ")", "{", "return", "null", ";", "}", "retu...
Retrieves a child-element by position @since Symphony 2.3 @param integer $position @return XMLElement
[ "Retrieves", "a", "child", "-", "element", "by", "position" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L196-L203
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.getChildByName
public function getChildByName($name, $position) { $result = array_values($this->getChildrenByName($name)); if (!isset($result[$position])) { return null; } return $result[$position]; }
php
public function getChildByName($name, $position) { $result = array_values($this->getChildrenByName($name)); if (!isset($result[$position])) { return null; } return $result[$position]; }
[ "public", "function", "getChildByName", "(", "$", "name", ",", "$", "position", ")", "{", "$", "result", "=", "array_values", "(", "$", "this", "->", "getChildrenByName", "(", "$", "name", ")", ")", ";", "if", "(", "!", "isset", "(", "$", "result", "...
Retrieves child-element by name and position. If no child is found, `NULL` will be returned. @since Symphony 2.3 @param string $name @param integer $position @return XMLElement
[ "Retrieves", "child", "-", "element", "by", "name", "and", "position", ".", "If", "no", "child", "is", "found", "NULL", "will", "be", "returned", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L235-L244
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.getChildrenByName
public function getChildrenByName($name) { $result = array(); foreach ($this as $i => $child) { if ($child->getName() != $name) { continue; } $result[$i] = $child; } return $result; }
php
public function getChildrenByName($name) { $result = array(); foreach ($this as $i => $child) { if ($child->getName() != $name) { continue; } $result[$i] = $child; } return $result; }
[ "public", "function", "getChildrenByName", "(", "$", "name", ")", "{", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "as", "$", "i", "=>", "$", "child", ")", "{", "if", "(", "$", "child", "->", "getName", "(", ")", "!="...
Accessor to return an associative array of all `$this->_children` whose's name matches the given `$name`. If no children are found, an empty array will be returned. @since Symphony 2.2.2 @param string $name @return array An associative array where the key is the `$index` of the child in `$this->_children`
[ "Accessor", "to", "return", "an", "associative", "array", "of", "all", "$this", "-", ">", "_children", "whose", "s", "name", "matches", "the", "given", "$name", ".", "If", "no", "children", "are", "found", "an", "empty", "array", "will", "be", "returned", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L257-L270
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.setName
public function setName($name, $createHandle = false) { $this->_name = ($createHandle) ? Lang::createHandle($name) : $name; }
php
public function setName($name, $createHandle = false) { $this->_name = ($createHandle) ? Lang::createHandle($name) : $name; }
[ "public", "function", "setName", "(", "$", "name", ",", "$", "createHandle", "=", "false", ")", "{", "$", "this", "->", "_name", "=", "(", "$", "createHandle", ")", "?", "Lang", "::", "createHandle", "(", "$", "name", ")", ":", "$", "name", ";", "}...
Sets the name of this `XMLElement`, ie. 'p' => <p /> @since Symphony 2.3.2 @param string $name The name of the `XMLElement`, 'p'. @param boolean $createHandle Whether this function should convert the `$name` to a handle. Defaults to `false`.
[ "Sets", "the", "name", "of", "this", "XMLElement", "ie", ".", "p", "=", ">", "<p", "/", ">" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L375-L378
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.setValue
public function setValue($value) { if (is_array($value)) { $value = implode(', ', $value); } if (!is_null($value)) { $this->_value = $value; $this->appendChild($value); } }
php
public function setValue($value) { if (is_array($value)) { $value = implode(', ', $value); } if (!is_null($value)) { $this->_value = $value; $this->appendChild($value); } }
[ "public", "function", "setValue", "(", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "$", "value", "=", "implode", "(", "', '", ",", "$", "value", ")", ";", "}", "if", "(", "!", "is_null", "(", "$", "value", "...
Sets the value of the `XMLElement`. Checks to see whether the value should be prepended or appended to the children. @param string|XMLElement|array $value Defaults to true.
[ "Sets", "the", "value", "of", "the", "XMLElement", ".", "Checks", "to", "see", "whether", "the", "value", "should", "be", "prepended", "or", "appended", "to", "the", "children", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L388-L398
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.replaceValue
public function replaceValue($value) { foreach ($this->_children as $i => $child) { if ($child instanceof XMLElement) { continue; } unset($this->_children[$i]); } $this->setValue($value); }
php
public function replaceValue($value) { foreach ($this->_children as $i => $child) { if ($child instanceof XMLElement) { continue; } unset($this->_children[$i]); } $this->setValue($value); }
[ "public", "function", "replaceValue", "(", "$", "value", ")", "{", "foreach", "(", "$", "this", "->", "_children", "as", "$", "i", "=>", "$", "child", ")", "{", "if", "(", "$", "child", "instanceof", "XMLElement", ")", "{", "continue", ";", "}", "uns...
This function will remove all text attributes from the `XMLElement` node and replace them with the given value. @since Symphony 2.4 @param string|XMLElement|array $value
[ "This", "function", "will", "remove", "all", "text", "attributes", "from", "the", "XMLElement", "node", "and", "replace", "them", "with", "the", "given", "value", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L407-L418
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.setAttributeArray
public function setAttributeArray(array $attributes = null) { if (!is_array($attributes) || empty($attributes)) { return; } foreach ($attributes as $name => $value) { $this->setAttribute($name, $value); } }
php
public function setAttributeArray(array $attributes = null) { if (!is_array($attributes) || empty($attributes)) { return; } foreach ($attributes as $name => $value) { $this->setAttribute($name, $value); } }
[ "public", "function", "setAttributeArray", "(", "array", "$", "attributes", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "$", "attributes", ")", "||", "empty", "(", "$", "attributes", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", ...
A convenience method to quickly add multiple attributes to an `XMLElement` @param array $attributes Associative array with the key being the name and the value being the value of the attribute.
[ "A", "convenience", "method", "to", "quickly", "add", "multiple", "attributes", "to", "an", "XMLElement" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L441-L450
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.setChildren
public function setChildren(array $children = null) { foreach ($children as $child) { $this->validateChild($child); } $this->_children = $children; return true; }
php
public function setChildren(array $children = null) { foreach ($children as $child) { $this->validateChild($child); } $this->_children = $children; return true; }
[ "public", "function", "setChildren", "(", "array", "$", "children", "=", "null", ")", "{", "foreach", "(", "$", "children", "as", "$", "child", ")", "{", "$", "this", "->", "validateChild", "(", "$", "child", ")", ";", "}", "$", "this", "->", "_child...
This function expects an array of `XMLElement` that will completely replace the contents of `$this->_children`. Take care when using this function. @since Symphony 2.2.2 @param array $children An array of XMLElement's to act as the children for the current XMLElement instance @return boolean
[ "This", "function", "expects", "an", "array", "of", "XMLElement", "that", "will", "completely", "replace", "the", "contents", "of", "$this", "-", ">", "_children", ".", "Take", "care", "when", "using", "this", "function", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L479-L487
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.appendChildArray
public function appendChildArray(array $children = null) { if (is_array($children) && !empty($children)) { foreach ($children as $child) { $this->appendChild($child); } } }
php
public function appendChildArray(array $children = null) { if (is_array($children) && !empty($children)) { foreach ($children as $child) { $this->appendChild($child); } } }
[ "public", "function", "appendChildArray", "(", "array", "$", "children", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "children", ")", "&&", "!", "empty", "(", "$", "children", ")", ")", "{", "foreach", "(", "$", "children", "as", "$", "ch...
A convenience method to add children to an `XMLElement` quickly. @param array $children
[ "A", "convenience", "method", "to", "add", "children", "to", "an", "XMLElement", "quickly", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L509-L516
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.addClass
public function addClass($class) { $current = preg_split('%\s+%', $this->getAttribute('class'), 0, PREG_SPLIT_NO_EMPTY); $added = preg_split('%\s+%', $class, 0, PREG_SPLIT_NO_EMPTY); $current = array_merge($current, $added); $classes = implode(' ', $current); $this->setAttri...
php
public function addClass($class) { $current = preg_split('%\s+%', $this->getAttribute('class'), 0, PREG_SPLIT_NO_EMPTY); $added = preg_split('%\s+%', $class, 0, PREG_SPLIT_NO_EMPTY); $current = array_merge($current, $added); $classes = implode(' ', $current); $this->setAttri...
[ "public", "function", "addClass", "(", "$", "class", ")", "{", "$", "current", "=", "preg_split", "(", "'%\\s+%'", ",", "$", "this", "->", "getAttribute", "(", "'class'", ")", ",", "0", ",", "PREG_SPLIT_NO_EMPTY", ")", ";", "$", "added", "=", "preg_split...
A convenience method to quickly add a CSS class to this `XMLElement`'s existing class attribute. If the attribute does not exist, it will be created. @since Symphony 2.2.2 @param string $class The CSS classname to add to this `XMLElement`
[ "A", "convenience", "method", "to", "quickly", "add", "a", "CSS", "class", "to", "this", "XMLElement", "s", "existing", "class", "attribute", ".", "If", "the", "attribute", "does", "not", "exist", "it", "will", "be", "created", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L539-L547
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.removeClass
public function removeClass($class) { $classes = preg_split('%\s+%', $this->getAttribute('class'), 0, PREG_SPLIT_NO_EMPTY); $removed = preg_split('%\s+%', $class, 0, PREG_SPLIT_NO_EMPTY); $classes = array_diff($classes, $removed); $classes = implode(' ', $classes); $this->se...
php
public function removeClass($class) { $classes = preg_split('%\s+%', $this->getAttribute('class'), 0, PREG_SPLIT_NO_EMPTY); $removed = preg_split('%\s+%', $class, 0, PREG_SPLIT_NO_EMPTY); $classes = array_diff($classes, $removed); $classes = implode(' ', $classes); $this->se...
[ "public", "function", "removeClass", "(", "$", "class", ")", "{", "$", "classes", "=", "preg_split", "(", "'%\\s+%'", ",", "$", "this", "->", "getAttribute", "(", "'class'", ")", ",", "0", ",", "PREG_SPLIT_NO_EMPTY", ")", ";", "$", "removed", "=", "preg_...
A convenience method to quickly remove a CSS class from an `XMLElement`'s existing class attribute. If the attribute does not exist, this method will do nothing. @since Symphony 2.2.2 @param string $class The CSS classname to remove from this `XMLElement`
[ "A", "convenience", "method", "to", "quickly", "remove", "a", "CSS", "class", "from", "an", "XMLElement", "s", "existing", "class", "attribute", ".", "If", "the", "attribute", "does", "not", "exist", "this", "method", "will", "do", "nothing", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L558-L566
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.removeChildAt
public function removeChildAt($index) { if (!is_numeric($index)) { return false; } $index = $this->getRealIndex($index); if (!isset($this->_children[$index])) { return false; } unset($this->_children[$index]); return true; }
php
public function removeChildAt($index) { if (!is_numeric($index)) { return false; } $index = $this->getRealIndex($index); if (!isset($this->_children[$index])) { return false; } unset($this->_children[$index]); return true; }
[ "public", "function", "removeChildAt", "(", "$", "index", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "index", ")", ")", "{", "return", "false", ";", "}", "$", "index", "=", "$", "this", "->", "getRealIndex", "(", "$", "index", ")", ";", "if"...
Given the position of the child in the `$this->_children`, this function will unset the child at that position. This function is not reversible. This function does not alter the key's of `$this->_children` after removing a child @since Symphony 2.2.2 @param integer $index The index of the child to be removed. If the i...
[ "Given", "the", "position", "of", "the", "child", "in", "the", "$this", "-", ">", "_children", "this", "function", "will", "unset", "the", "child", "at", "that", "position", ".", "This", "function", "is", "not", "reversible", ".", "This", "function", "does...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L590-L605
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.insertChildAt
public function insertChildAt($index, XMLElement $child = null) { if (!is_numeric($index)) { return false; } $this->validateChild($child); if ($index >= $this->getNumberOfChildren()) { return $this->appendChild($child); } $start = ar...
php
public function insertChildAt($index, XMLElement $child = null) { if (!is_numeric($index)) { return false; } $this->validateChild($child); if ($index >= $this->getNumberOfChildren()) { return $this->appendChild($child); } $start = ar...
[ "public", "function", "insertChildAt", "(", "$", "index", ",", "XMLElement", "$", "child", "=", "null", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "index", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->", "validateChild", "(", "$...
Given a desired index, and an `XMLElement`, this function will insert the child at that index in `$this->_children` shuffling all children greater than `$index` down one. If the `$index` given is greater then the number of children for this `XMLElement`, the `$child` will be appended to the current `$this->_children` a...
[ "Given", "a", "desired", "index", "and", "an", "XMLElement", "this", "function", "will", "insert", "the", "child", "at", "that", "index", "in", "$this", "-", ">", "_children", "shuffling", "all", "children", "greater", "than", "$index", "down", "one", ".", ...
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L622-L642
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.replaceChildAt
public function replaceChildAt($index, XMLElement $child = null) { if (!is_numeric($index)) { return false; } $this->validateChild($child); $index = $this->getRealIndex($index); if (!isset($this->_children[$index])) { return false; } ...
php
public function replaceChildAt($index, XMLElement $child = null) { if (!is_numeric($index)) { return false; } $this->validateChild($child); $index = $this->getRealIndex($index); if (!isset($this->_children[$index])) { return false; } ...
[ "public", "function", "replaceChildAt", "(", "$", "index", ",", "XMLElement", "$", "child", "=", "null", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "index", ")", ")", "{", "return", "false", ";", "}", "$", "this", "->", "validateChild", "(", "...
Given the position of the child to replace, and an `XMLElement` of the replacement child, this function will replace one child with another @since Symphony 2.2.2 @param integer $index The index of the child to be replaced. If the index given is negative it will be calculated from the end of `$this->_children`. @param ...
[ "Given", "the", "position", "of", "the", "child", "to", "replace", "and", "an", "XMLElement", "of", "the", "replacement", "child", "this", "function", "will", "replace", "one", "child", "with", "another" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L657-L674
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.stripInvalidXMLCharacters
public static function stripInvalidXMLCharacters($value) { if (Lang::isUnicodeCompiled()) { return preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $value); } else { $ret = ''; if (empty($value)) { return $ret...
php
public static function stripInvalidXMLCharacters($value) { if (Lang::isUnicodeCompiled()) { return preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $value); } else { $ret = ''; if (empty($value)) { return $ret...
[ "public", "static", "function", "stripInvalidXMLCharacters", "(", "$", "value", ")", "{", "if", "(", "Lang", "::", "isUnicodeCompiled", "(", ")", ")", "{", "return", "preg_replace", "(", "'/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u'", ",", ...
This function strips characters that are not allowed in XML @since Symphony 2.3 @link http://www.w3.org/TR/xml/#charsets @link http://www.phpedit.net/snippet/Remove-Invalid-XML-Characters @param string $value @return string
[ "This", "function", "strips", "characters", "that", "are", "not", "allowed", "in", "XML" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L705-L732
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.generate
public function generate($indent = false, $tab_depth = 0, $has_parent = false) { $result = null; $newline = ($indent ? PHP_EOL : null); if (!$has_parent) { if ($this->_includeHeader) { $result .= sprintf( '<?xml version="%s" encoding="%s" ?>%s...
php
public function generate($indent = false, $tab_depth = 0, $has_parent = false) { $result = null; $newline = ($indent ? PHP_EOL : null); if (!$has_parent) { if ($this->_includeHeader) { $result .= sprintf( '<?xml version="%s" encoding="%s" ?>%s...
[ "public", "function", "generate", "(", "$", "indent", "=", "false", ",", "$", "tab_depth", "=", "0", ",", "$", "has_parent", "=", "false", ")", "{", "$", "result", "=", "null", ";", "$", "newline", "=", "(", "$", "indent", "?", "PHP_EOL", ":", "nul...
This function will turn the `XMLElement` into a string representing the element as it would appear in the markup. The result is valid XML. @param boolean $indent Defaults to false @param integer $tab_depth Defaults to 0, indicates the number of tabs (\t) that this element should be indented by in the output string @pa...
[ "This", "function", "will", "turn", "the", "XMLElement", "into", "a", "string", "representing", "the", "element", "as", "it", "would", "appear", "in", "the", "markup", ".", "The", "result", "is", "valid", "XML", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L750-L828
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.convertFromXMLString
public static function convertFromXMLString($root_element, $xml) { $doc = new DOMDocument('1.0', 'utf-8'); $doc->loadXML($xml); return self::convertFromDOMDocument($root_element, $doc); }
php
public static function convertFromXMLString($root_element, $xml) { $doc = new DOMDocument('1.0', 'utf-8'); $doc->loadXML($xml); return self::convertFromDOMDocument($root_element, $doc); }
[ "public", "static", "function", "convertFromXMLString", "(", "$", "root_element", ",", "$", "xml", ")", "{", "$", "doc", "=", "new", "DOMDocument", "(", "'1.0'", ",", "'utf-8'", ")", ";", "$", "doc", "->", "loadXML", "(", "$", "xml", ")", ";", "return"...
Given a string of XML, this function will convert it to an `XMLElement` object and return the result. @since Symphony 2.4 @param string $root_element @param string $xml A string of XML @return XMLElement
[ "Given", "a", "string", "of", "XML", "this", "function", "will", "convert", "it", "to", "an", "XMLElement", "object", "and", "return", "the", "result", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L840-L846
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.convertFromDOMDocument
public static function convertFromDOMDocument($root_element, DOMDocument $doc) { $xpath = new DOMXPath($doc); $root = new XMLElement($root_element); foreach ($xpath->query('.') as $node) { self::convertNode($root, $node); } return $root; }
php
public static function convertFromDOMDocument($root_element, DOMDocument $doc) { $xpath = new DOMXPath($doc); $root = new XMLElement($root_element); foreach ($xpath->query('.') as $node) { self::convertNode($root, $node); } return $root; }
[ "public", "static", "function", "convertFromDOMDocument", "(", "$", "root_element", ",", "DOMDocument", "$", "doc", ")", "{", "$", "xpath", "=", "new", "DOMXPath", "(", "$", "doc", ")", ";", "$", "root", "=", "new", "XMLElement", "(", "$", "root_element", ...
Given a `DOMDocument`, this function will convert it to an `XMLElement` object and return the result. @since Symphony 2.4 @param string $root_element @param DOMDOcument $doc @return XMLElement
[ "Given", "a", "DOMDocument", "this", "function", "will", "convert", "it", "to", "an", "XMLElement", "object", "and", "return", "the", "result", "." ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L857-L867
symphonycms/symphony-2
symphony/lib/toolkit/class.xmlelement.php
XMLElement.convert
private static function convert(XMLElement $root = null, DOMNode $node) { $el = new XMLElement($node->tagName); self::convertNode($el, $node); if (is_null($root)) { return $el; } else { $root->appendChild($el); } }
php
private static function convert(XMLElement $root = null, DOMNode $node) { $el = new XMLElement($node->tagName); self::convertNode($el, $node); if (is_null($root)) { return $el; } else { $root->appendChild($el); } }
[ "private", "static", "function", "convert", "(", "XMLElement", "$", "root", "=", "null", ",", "DOMNode", "$", "node", ")", "{", "$", "el", "=", "new", "XMLElement", "(", "$", "node", "->", "tagName", ")", ";", "self", "::", "convertNode", "(", "$", "...
This helper function is used by `XMLElement::convertFromDOMDocument` to recursively convert `DOMNode` into an `XMLElement` structure @since Symphony 2.4 @param XMLElement $root @param DOMNOde $node @return XMLElement
[ "This", "helper", "function", "is", "used", "by", "XMLElement", "::", "convertFromDOMDocument", "to", "recursively", "convert", "DOMNode", "into", "an", "XMLElement", "structure" ]
train
https://github.com/symphonycms/symphony-2/blob/68f44f0c36ad3345068676bfb8a61c2e6a2e51f4/symphony/lib/toolkit/class.xmlelement.php#L878-L889