sentence1
stringlengths
52
3.87M
sentence2
stringlengths
1
47.2k
label
stringclasses
1 value
public function old($name) { if (isset($this->session)) { return $this->session->getOldInput($this->transformKey($name)); } }
Get a value from the session's old input. @param string $name @return string
entailment
public function getCharactersCharacterIdBookmarks($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCharactersCharacterIdBookmarksWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent); return $response; }
Operation getCharactersCharacterIdBookmarks List bookmarks @param int $characterId An EVE character ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if preferred over a header (optional) @param string $userAge...
entailment
public function getCharactersCharacterIdBookmarksFolders($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCharactersCharacterIdBookmarksFoldersWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent); return $respon...
Operation getCharactersCharacterIdBookmarksFolders List bookmark folders @param int $characterId An EVE character ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if preferred over a header (optional) @param s...
entailment
public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) { $headers = []; // construct the http header $headerParams = array_merge( (array)$this->config->getDefaultHeaders(), (array)$headerPar...
Make the HTTP call (Sync) @param string $resourcePath path to method endpoint @param string $method method to call @param array $queryParams parameters to be place in query URL @param array $postData parameters to be placed in POST body @param array $headerParams parameters to be place in request header ...
entailment
public function getRouteOriginDestinationWithHttpInfo($destination, $origin, $avoid = null, $connections = null, $datasource = null, $flag = null, $userAgent = null, $xUserAgent = null) { // verify the required parameter 'destination' is set if ($destination === null) { throw new \Invali...
Operation getRouteOriginDestinationWithHttpInfo Get route @param int $destination destination solar system ID (required) @param int $origin origin solar system ID (required) @param int[] $avoid avoid solar system ID(s) (optional) @param int[][] $connections connected solar system pairs (optional) @param string $datas...
entailment
public function setConfiguration(Reader $configuration): void { $this->configuration = $configuration; $this->configEntities = $configuration->getConfigValues()['entities']; $this->initFaker(); }
Set the configuration @param Reader $configuration
entailment
public function setLimit(int $limit) { $this->limit = $limit; if ($this->limit < $this->batchSize) { $this->batchSize = $this->limit; } return $this; }
Limit of fake generated records for updates and creates @param int $limit @return mixed
entailment
protected function whatToDoWithEntity(): int { $this->checkEntityIsInConfig(); $entityConfig = $this->configEntities[$this->entity]; $actions = 0; if (array_key_exists('cols', $entityConfig)) { switch ($entityConfig['action']) { case 'update': ...
Evaluate, from the configuration if I have to update or Truncate the table @return int @throws NeuralyzerConfigurationException
entailment
protected function generateFakeData(): array { $this->checkEntityIsInConfig(); $colsInConfig = $this->configEntities[$this->entity]['cols']; $row = []; foreach ($colsInConfig as $colName => $colProps) { $this->checkColIsInEntity($colName); $data = \call_user_f...
Generate fake data for an entity and return it as an Array @return array @throws NeuralyzerConfigurationException
entailment
protected function checkEntityIsInConfig(): void { if (empty($this->configEntities)) { throw new NeuralyzerConfigurationException( 'No entities found. Have you loaded a configuration file ?' ); } if (!array_key_exists($this->entity, $this->configEntiti...
Make sure that entity is defined in the configuration @throws NeuralyzerConfigurationException
entailment
protected function initFaker(): void { $language = $this->configuration->getConfigValues()['language']; $this->faker = \Faker\Factory::create($language); $this->faker->addProvider(new \Edyan\Neuralyzer\Faker\Provider\Base($this->faker)); $this->faker->addProvider(new \Edyan\Neuralyze...
Init Faker and add additional methods
entailment
protected function getFakerObject(string $entityName, string $colName, array $colProps) { if (!isset($this->fakers[$entityName][$colName])) { $fakerClone = clone $this->faker; $this->fakers[$entityName][$colName] = isset($colProps['unique']) && $colProps['unique'] === true ? $fakerCl...
Get the faker object for a entity column @param string $entityName @param string $colName @param array $colProps @return \Faker\Generator|\Faker\UniqueGenerator
entailment
public function getSearch($categories, $search, $datasource = null, $language = null, $strict = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getSearchWithHttpInfo($categories, $search, $datasource, $language, $strict, $userAgent, $xUserAgent); return $response; }
Operation getSearch Search on a string @param string[] $categories Type of entities to search for (required) @param string $search The string to search on (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $language Search locale (optional, d...
entailment
public function toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayErrors = true) { $strOutput = ""; $intDynamicCount = $this->getDynamicCount(); for ($intCount = 0; $intCount <= $intDynamicCount; $intCount ++) { $strOutput .= $this->__toHtml($subm...
Generate HTML output See {@link \ValidFormBuilder\Element::toHtml()} @see \ValidFormBuilder\Element::toHtml()
entailment
public function __toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayErrors = true, $intCount = 0) { $blnError = ($submitted && ! $this->__validator->validate($intCount) && $blnDisplayErrors) ? true : false; if (! $blnSimpleLayout) { // *** We asume that a...
Generate HTML output See {@link \ValidFormBuilder\Element::__toHtml()} @see \ValidFormBuilder\Element::__toHtml()
entailment
public function getId() { return (strpos($this->__id, "[]") !== false) ? str_replace("[]", "", $this->__id) : $this->__id; }
Get element's ID This automatically strips off the [] from a checkbox ID @return string The element's ID
entailment
public function getName($blnPlain = false) { $strReturn = ""; if ($blnPlain) { $strReturn = $this->__name; } else { switch ($this->__type) { case ValidForm::VFORM_RADIO_LIST: $strReturn = $this->__name; break; ...
Get the element's name This automatically strips off the [] from a checkbox ID @see \ValidFormBuilder\Base::getName() @param bool $blnPlain If false, [] will be stripped from a checklist group name @return string The element's name
entailment
public function addField($label, $value, $checked = false, $meta = array()) { $name = $this->getName(); $objField = new GroupField($this->getRandomId($name), $name, $this->__type, $label, $value, $checked, $meta); $objField->setMeta("parent", $this, true); $this->__fields->addObjec...
Add either a radio button or checkbox to the group @param string $label The label @param string $value The value @param boolean $checked Set to true if this item should be checked / selected by default @param array $meta The meta array @return \ValidFormBuilder\GroupField
entailment
public function getStatus($datasource = 'tranquility', $userAgent = null, $xUserAgent = null) { list($response) = $this->getStatusWithHttpInfo($datasource, $userAgent, $xUserAgent); return $response; }
Operation getStatus Retrieve the uptime and player counts @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param string $xUserAgent Client identifier, takes precedence over Use...
entailment
public function getStatusAsync($datasource = 'tranquility', $userAgent = null, $xUserAgent = null) { return $this->getStatusAsyncWithHttpInfo($datasource, $userAgent, $xUserAgent) ->then( function ($response) { return $response[0]; } ...
Operation getStatusAsync Retrieve the uptime and player counts @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param string $xUserAgent Client identifier, takes precedence ove...
entailment
public function init() { $this->initSession(); $this->session = null === $_SESSION ? array() : $_SESSION; if (NULL === $this->getSessionKey('__FLASH_CLEAR__')) { $this->clearFlashes(); $this->setSessionKey('__FLASH_CLEAR__', microtime(TRUE)); } $this->...
Constructor por defecto
entailment
public function checkAdmin($user = NULL, $pass = NULL, $force = false) { Logger::log('Checking admin session'); if ((!$this->authorized && !$this->checked) || $force) { $admins = $this->getAdmins(); if (null !== $admins) { $request = Request::getInstance(); ...
@param string $user @param string $pass @param boolean $force @return bool
entailment
protected function getAdminFromCookie() { $auth_cookie = Request::getInstance()->getCookie($this->getHash()); $user = $pass = array(); if (!empty($auth_cookie)) { list($user, $pass) = explode(':', base64_decode($auth_cookie)); } return array($user, $pass); }
Método que obtiene el usuario y contraseña de la cookie de sesión de administración @return array
entailment
public function addButton($label, $meta = array()) { $objButton = new Button($label, $meta); // *** Set the parent for the new field. $objButton->setMeta("parent", $this, true); $this->__fields->addObject($objButton); return $objButton; }
Add a button to the navigation object @param string $label Button label @param array $meta The meta array @return \ValidFormBuilder\Button
entailment
public function addHtml($html, $meta = array()) { $objString = new StaticText($html, $meta); $objString->setMeta("parent", $this, true); $this->__fields->addObject($objString); return $objString; }
Inject HTML in the navigation element @param string $html The HTML string @param array $meta Optional meta array @return \ValidFormBuilder\StaticText
entailment
public function toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayError = true) { $this->setConditionalMeta(); $this->setMeta("class", "vf__navigation"); $strReturn = "<div{$this->__getMetaString()}>\n"; foreach ($this->__fields as $field) { ...
Render the Navigation and it's children @param boolean $submitted Define if the element has been submitted and propagate that flag to the child fields @param boolean $blnSimpleLayout Only render in simple layout mode @param boolean $blnLabel @param boolean $blnDisplayError Display generated errors @return string Rende...
entailment
public function getActivityAllowableValues() { return [ self::ACTIVITY_NONE, self::ACTIVITY_MANUFACTURING, self::ACTIVITY_RESEARCHING_TECHNOLOGY, self::ACTIVITY_RESEARCHING_TIME_EFFICIENCY, self::ACTIVITY_RESEARCHING_MATERIAL_EFFICIENCY, ...
Gets allowable values of the enum @return string[]
entailment
public function setActivity($activity) { $allowed_values = array('none', 'manufacturing', 'researching_technology', 'researching_time_efficiency', 'researching_material_efficiency', 'copying', 'duplicating', 'invention', 'reverse_engineering'); if (!in_array($activity, $allowed_values)) { ...
Sets activity @param string $activity activity string @return $this
entailment
public function getCharactersCharacterIdOpportunities($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCharactersCharacterIdOpportunitiesWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent); return $response; ...
Operation getCharactersCharacterIdOpportunities Get a character's completed tasks @param int $characterId ID for a character (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use, if preferred over a header (optional) ...
entailment
public function getOpportunitiesGroups($datasource = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getOpportunitiesGroupsWithHttpInfo($datasource, $userAgent, $xUserAgent); return $response; }
Operation getOpportunitiesGroups Get opportunities groups @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param string $xUserAgent Client identifier, takes precedence over User-A...
entailment
public function getOpportunitiesTasksTaskId($taskId, $datasource = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getOpportunitiesTasksTaskIdWithHttpInfo($taskId, $datasource, $userAgent, $xUserAgent); return $response; }
Operation getOpportunitiesTasksTaskId Get opportunities task @param int $taskId ID of an opportunities task (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param strin...
entailment
public function getIncursions($datasource = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getIncursionsWithHttpInfo($datasource, $userAgent, $xUserAgent); return $response; }
Operation getIncursions List incursions @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $userAgent Client identifier, takes precedence over headers (optional) @param string $xUserAgent Client identifier, takes precedence over User-Agent (optional) @t...
entailment
public static function asset($string, $name = null, $return = true) { $filePath = ''; if (!file_exists($filePath)) { $filePath = BASE_DIR . $string; } $filenamePath = AssetsParser::findDomainPath($string, $filePath); $filePath = self::processAsset($string, $name...
Función que copia los recursos de las carpetas Public al DocumentRoot @param $string @param null $name @param bool|TRUE $return @return string
entailment
public static function route($path = '', $absolute = false, array $params = []) { $router = Router::getInstance(); try { return $router->getRoute($path, $absolute, $params); } catch (\Exception $e) { return $router->getRoute('', $absolute, $params); } }
Función que devuelve una url correspondiente a una ruta @param string $path @param bool|FALSE $absolute @param array $params @return string|null
entailment
public static function resource($path, $dest, $force = false) { $debug = Config::getParam('debug'); $domains = Template::getDomains(true); $filenamePath = self::extractPathname($path, $domains); \PSFS\Services\GeneratorService::copyResources($dest, $force, $filenamePath, $debug); ...
Función que copia un recurso directamente en el DocumentRoot @param string $path @param string $dest @param bool|FALSE $force @return string @throws ConfigException
entailment
private static function extractPathname($path, $domains) { $filenamePath = $path; if (!empty($domains) && !file_exists($path)) { foreach ($domains as $domain => $paths) { $domainFilename = str_replace($domain, $paths['public'], $path); if (file_exists($dom...
Método que extrae el pathname para un dominio @param string $path @param $domains @return mixed
entailment
private static function putResourceContent($name, $filenamePath, $base, $filePath) { $data = file_get_contents($filenamePath); if (!empty($name)) { file_put_contents(WEB_DIR . DIRECTORY_SEPARATOR . $name, $data); }else { file_put_contents($base . $filePath, $data); ...
Método que copia el contenido de un recurso en su destino correspondiente @param string $name @param string $filenamePath @param string $base @param string $filePath
entailment
private static function processAsset($string, $name, $return, $filenamePath) { $filePath = $filenamePath; if (file_exists($filenamePath)) { list($base, $htmlBase, $filePath) = AssetsParser::calculateAssetPath($string, $name, $return, $filenamePath); //Creamos el directorio si...
Método que procesa un recurso para su copia en el DocumentRoot @param string $string @param string $name @param boolean $return @param string $filenamePath @return mixed @throws \PSFS\base\exception\GeneratorException
entailment
public static function getFlash($key) { $var = Security::getInstance()->getFlash($key); Security::getInstance()->setFlash($key, null); return $var; }
Template function that get a flash session var @param string $key @return mixed
entailment
protected function extractTmpAttribute($node = null, $value = null) { $tmp = []; if (null === $node) { $node = $value; } else { $tmp = $this->getTmpAttribute($node); } if(null !== $node) { $tmp[] = $value->getAttribute('value'); } ...
Método @param \Twig_Node_Expression|\Twig_Node_Expression_Conditional|null $node @param \Twig_Node_Expression|\Twig_Node_Expression_Conditional|null $value @return array
entailment
public function handle(GetResponseEvent $event) { $request = $event->getRequest(); $requestToken = $this->getToken( $request->headers->get($this->options['header_name'], null) ); if (!empty($requestToken)) { try { $decoded = $this->encode->dec...
This interface must be implemented by firewall listeners. @param GetResponseEvent $event
entailment
protected function getToken($requestToken) { $prefix = $this->options['token_prefix']; if (null === $prefix) { return $requestToken; } if (null === $requestToken) { return $requestToken; } $requestToken = trim(str_replace($prefix, "", $reques...
Convert token with prefix to normal token @param $requestToken @return string
entailment
public function listInvalidProperties() { $invalidProperties = []; if (!is_null($this->container['unreadCount']) && ($this->container['unreadCount'] < 0)) { $invalidProperties[] = "invalid value for 'unreadCount', must be bigger than or equal to 0."; } if (!is_null($thi...
Show all the invalid properties with reasons. @return array invalid properties with reasons
entailment
public function setUnreadCount($unreadCount) { if (!is_null($unreadCount) && ($unreadCount < 0)) { throw new \InvalidArgumentException('invalid value for $unreadCount when calling GetCharactersCharacterIdMailLabelsLabel., must be bigger than or equal to 0.'); } $this->container...
Sets unreadCount @param int $unreadCount unread_count integer @return $this
entailment
public function setLabelId($labelId) { if (!is_null($labelId) && ($labelId < 0)) { throw new \InvalidArgumentException('invalid value for $labelId when calling GetCharactersCharacterIdMailLabelsLabel., must be bigger than or equal to 0.'); } $this->container['labelId'] = $label...
Sets labelId @param int $labelId label_id integer @return $this
entailment
public function setColor($color) { $allowedValues = $this->getColorAllowableValues(); if (!is_null($color) && !in_array($color, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'color', must be one of '%s'", ...
Sets color @param string $color color string @return $this
entailment
public function cacheSubscribers($num = 1000, $page = 1) { if ($this->cached != null) { return $this->cached; } $this->cached = $this->client->call( 'GET', 'subscribers', [ 'query' => [ 'per_page' => $num, ...
Cache Subscribers for performance improvement. @param int $num @param int $page @return array|bool
entailment
public function indexSubscribers($num = 1000, $page = 1) { if ($this->cache != false) { return $this->cacheSubscribers($num, $page); } return $this->client->call( 'GET', 'subscribers', [ 'query' => [ 'per_pa...
Get a defined number of Subscribers. @param int $num @param int $page @return array|bool
entailment
public function searchSubscribers($search, $by, $limit = 1, $num = 1000, $page = 1) { $subscribers = $this->indexSubscribers($num, $page)['data']; $filtered = array_filter( $subscribers, function ($subscriber) use ($search, $by) { if (array_key_exists($by, $...
Search if a defined number of Subscribers exists. @param string $search @param string $by @param int $num @param int $page @param int $limit @return mixed
entailment
public function getDomain() { $model = explode("\\", $this->getModelNamespace()); return strlen($model[0]) || 1 === count($model) ? $model[0] : $model[1]; }
Method that extract the Domain name @return mixed
entailment
protected function hydrateFromRequest() { $class = new \ReflectionClass($this->getModelNamespace()); $this->model = $class->newInstance(); $this->hydrateModelFromRequest($this->model, $this->data); }
Hydrate fields from request
entailment
protected function hydrateBulkRequest() { $class = new \ReflectionClass($this->getModelNamespace()); $this->list = []; foreach($this->data as $item) { if(is_array($item)) { if(count($this->list) < Config::getParam('api.block.limit', 1000)) { /** @v...
Hydrate list elements for bulk insert
entailment
protected function saveBulk() { $tablemap = $this->getTableMap(); foreach($this->list as &$model) { $con = Propel::getWriteConnection($tablemap::DATABASE_NAME); try { $model->save($con); $con->commit(); } catch(\Exception $e) { ...
Save the list of items
entailment
protected function hydrateModel($primaryKey) { try { $query = $this->prepareQuery(); $this->model = $this->findPk($query, $primaryKey); } catch (\Exception $e) { Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR); } }
Hydrate model from pk @param string $primaryKey
entailment
protected function _get($primaryKey) { $this->hydrateModel($primaryKey); return ($this->getModel() instanceof ActiveRecordInterface) ? $this->getModel() : NULL; }
Extract specific entity @param integer $primaryKey @return null|ActiveRecordInterface
entailment
public function json($response, $status = 200) { $this->closeTransaction($status); return $this->_json($response, $status); }
Wrapper for json parent method with close transactions and close connections tasks @param \PSFS\base\dto\JsonResponse $response @param int $status @return mixed
entailment
public function loadData(string $table, string $fname, array $fields, string $mode): string { if (substr(gethostbyname($this->conn->getHost()), 0, 3) !== '127') { throw new NeuralyzerException('SQL Server must be on the same host than PHP'); } $sql ="BULK INSERT {$table} FROM '{...
{@inheritdoc}
entailment
protected function getModelNamespace() { /** @var TableMap $tableMap */ $tableMap = $this->getModelTableMap(); return (null !== $tableMap) ? $tableMap::getOMClass(FALSE) : null; }
Extract model api namespace @return mixed
entailment
protected function addDefaultListField() { if (!in_array(Api::API_LIST_NAME_FIELD, array_values($this->extraColumns))) { /** @var TableMap $tableMap */ $tableMap = $this->getTableMap(); /** @var ColumnMap $column */ $column = null; if ($tableMap->h...
Method that add a new field with the Label of the row
entailment
public function getOnce($key, $default = null) { $read = $this->get($key, $default); $this->delete($key); return $read; }
Read a value from the session and unset it, this is a form of read once flash memory using the session. @param string $key in session variable. @param mixed $default default value to return when key is not set in the session. @return mixed value from session and null if not set.
entailment
public function setEventType($eventType) { $allowedValues = $this->getEventTypeAllowableValues(); if (!in_array($eventType, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'eventType', must be one of '%s'", ...
Sets eventType @param string $eventType Type of event this campaign is for. tcu_defense, ihub_defense and station_defense are referred to as \"Defense Events\", station_freeport as \"Freeport Events\". @return $this
entailment
public function setDescription($description) { if ((strlen($description) > 500)) { throw new \InvalidArgumentException('invalid length for $description when calling PostCharactersCharacterIdFittingsFitting., must be smaller than or equal to 500.'); } if ((strlen($description) < 0...
Sets description @param string $description description string @return $this
entailment
public function setName($name) { if ((strlen($name) > 50)) { throw new \InvalidArgumentException('invalid length for $name when calling PostCharactersCharacterIdFittingsFitting., must be smaller than or equal to 50.'); } if ((strlen($name) < 1)) { throw new \InvalidAr...
Sets name @param string $name name string @return $this
entailment
public function addParagraph($strBody, $strHeader = "", $meta = array()) { $objParagraph = new Paragraph($strHeader, $strBody, $meta); $objParagraph->setMeta("parent", $this, true); // *** Add field to the fieldset. $this->__fields->addObject($objParagraph); return $objPar...
Add paragraph to Area #### Example ```php $objArea->addParagraph( "Cool paragraph with lots of text in it. It's an absolute must-read.", "You must read this" ); ``` @param string $strBody The paragraph's body text @param string $strHeader The paragraph's optional header @param array $meta Standard meta array @return ...
entailment
public function addMultiField($label = null, $meta = array()) { if (!array_key_exists("dynamic", $meta)) { $meta["dynamic"] = $this->__dynamic; } // *** Overwrite dynamic settings. We cannot have a dynamic multifield inside a dynamic area. if ($this->__dynamic) { ...
Add a multifield to the Area @param string $label The multifield's label @param array $meta The standard meta array @return \ValidFormBuilder\MultiField
entailment
public function hasContent($intCount = 0) { $blnReturn = false; foreach ($this->__fields as $objField) { if (get_class($objField) !== "ValidFormBuilder\\Hidden" || get_class($objField) !== "ValidFormBuilder\\Paragraph") { if (get_class($objField) == "ValidFormBuilder\\Mu...
Verify if any of the child fields in this area has submitted data @param integer $intCount Optional counter to do the same for dynamic multifields. @return boolean True if area childs contain submitted data, false if not.
entailment
protected function __toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayErrors = true, $intCount = 0) { // *** Conditional meta should be set before all other meta. Otherwise the set meta is being reset. $this->setConditionalMeta(); $strName = ($intCount == 0)...
Same as {@link \ValidFormBuilder\Area::toHtml()} but with dynamic counter as extra parameter @param boolean $submitted Define if the area has been submitted and propagate that flag to the child fields @param boolean $blnSimpleLayout Only render in simple layout mode @param boolean $blnLabel @param boolean $blnDisplayE...
entailment
protected function getDynamicHtml($intCount = 0) { $strReturn = ""; if ($this->__dynamic && ! empty($this->__dynamicLabel)) { $arrFields = array(); // Generate an array of field id's foreach ($this->__fields as $field) { switch (get_class($field))...
Generate extra HTML output to facilitate the dynamic duplication logic @param int $intCount @return string
entailment
public function toJS($intDynamicPosition = 0) { $strReturn = ""; foreach ($this->__fields as $field) { $strReturn .= $field->toJS($this->__dynamic); } $strReturn .= $this->conditionsToJs($intDynamicPosition); return $strReturn; }
Generate Javascript code. See {@link \ValidFormBuilder\Base::toJs() Base::toJs()} @param integer $intDynamicPosition The dynamic position counter @return string Generated javascript code
entailment
public function isValid() { $blnReturn = true; $intDynamicCount = $this->getDynamicCount(); for ($intCount = 0; $intCount <= $intDynamicCount; $intCount ++) { $blnReturn = $this->__validate($intCount); if (! $blnReturn) { break; } ...
Verify if all submitted data of this area and it's children is valid. @return boolean
entailment
public function getDynamicCount() { $intReturn = 0; if ($this->__dynamic) { $objCounters = $this->getCountersRecursive($this->getFields()); foreach ($objCounters as $objCounter) { $intCounterValue = $objCounter->getValidator()->getValue(); if...
Get the dynamic counter value if this is an dynamic area. @return integer Defaults to 0 if not an dynamic area. If dynamic, this returns the number of times the user duplicated this area.
entailment
public function getValue($intCount = null) { $strName = ($intCount > 0) ? $this->__name . "_" . $intCount : $this->__name; $value = ValidForm::get($strName); return (($this->__active && ! empty($value)) || ! $this->__active) ? true : false; }
If this is an active area, this will return the value of the checkbox. @param string $intCount Dynamic counter, defaults to null @return boolean
entailment
private function __validate($intCount = null) { $blnReturn = true; foreach ($this->__fields as $field) { // Note: hasContent is only accurate if isValid() is called first ... if (! $field->isValid($intCount)) { $blnReturn = false; break; ...
Validate this Area and it's children's submitted values @param string $intCount The dynamic counter @return boolean True if Area and children are valid, false if not.
entailment
public function render($tpl, array $vars = array(), array $cookies = array()) { Logger::log('Start render response'); $vars = ResponseHelper::setDebugHeaders($vars); $output = $this->dump($tpl, $vars); return $this->output($output, 'text/html', $cookies); }
Método que procesa la plantilla @param string $tpl @param array $vars @param array $cookies @return string HTML
entailment
public function addPath($path, $domain = '') { $this->tpl->getLoader()->addPath($path, $domain); return $this; }
Método que añade una nueva ruta al path de Twig @param $path @param $domain @return Template
entailment
public function dump($tpl, array $vars = array()) { $vars['__user__'] = Security::getInstance()->getUser(); $vars['__admin__'] = Security::getInstance()->getAdmin(); $vars['__profiles__'] = Security::getCleanProfiles(); $vars['__flash__'] = Security::getInstance()->getFlashes(); ...
Método que devuelve el contenido de una plantilla @param string $tpl @param array $vars @return string
entailment
protected function addTemplateFunction($templateFunction, $functionName) { $function = new TwigFunction($templateFunction, $functionName); $this->tpl->addFunction($function); return $this; }
Método que añade una función al motor de plantillas @param string $templateFunction @param $functionName @return Template
entailment
public function regenerateTemplates() { $this->generateTemplatesCache(); $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', Cache::JSON, true); $translations = []; if (is_array($domains)) { $translations = $this->parsePathT...
Servicio que regenera todas las plantillas @return array
entailment
protected function generateTemplate($tplDir, $domain = '') { $templatesDir = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($tplDir), \RecursiveIteratorIterator::LEAVES_ONLY); foreach ($templatesDir as $file) { // force compilation if ($file->isFile()) { ...
@param $tplDir @param string $domain @return mixed
entailment
public static function extractPath($path) { $explodePath = explode(DIRECTORY_SEPARATOR, $path); $realPath = array(); for ($i = 0, $parts = count($explodePath) - 1; $i < $parts; $i++) { $realPath[] = $explodePath[$i]; } return implode(DIRECTORY_SEPARATOR, $realPath...
Método que extrae el path de un string @param $path @return string
entailment
static public function getDomains($append = false) { $domains = Router::getInstance()->getDomains(); if ($append) { foreach ($domains as &$domain) { foreach ($domain as &$path) { $path .= DIRECTORY_SEPARATOR; } } } ...
Método que devuelve los dominios de una plataforma @param bool $append @return array
entailment
private function addTemplateFunctions() { //Asignamos las funciones especiales $functions = [ 'asset' => TemplateFunctions::ASSETS_FUNCTION, 'form' => TemplateFunctions::FORM_FUNCTION, 'form_widget' => TemplateFunctions::WIDGET_FUNCTION, 'form_button' ...
Método que añade todas las funciones de las plantillas
entailment
private function loadDomains() { $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', Cache::JSON, true); if (null !== $domains) { foreach ($domains as $domain => $paths) { $this->addPath($paths['template'], preg_replace('/(@...
Method that extract all domains for using them with the templates
entailment
private function setup() { $loader = new FilesystemLoader(GeneratorHelper::getTemplatePath()); $this->tpl = new Environment($loader, array( 'cache' => CACHE_DIR . DIRECTORY_SEPARATOR . 'twig', 'debug' => (bool)$this->debug, 'auto_reload' => Config::getParam('twig....
Método que inicializa el motor de plantillas
entailment
private function parsePathTranslations($domains) { $translations = array(); if (!empty($domains)) { foreach ($domains as $domain => $paths) { if (strlen($domain) && array_key_exists('template', $paths)) { $this->addPath($paths['template'], $domain); ...
Method that extract all path tag for extracting translations @param array $domains @return array
entailment
private function generateTemplatesCache() { /** @var \Twig_Loader_Filesystem $loader */ $loader = $this->tpl->getLoader(); $availablePaths = $loader->getPaths(); if (!empty($availablePaths)) { foreach ($availablePaths as $path) { $this->generateTemplate($p...
Method that generate all template caches
entailment
public function setLetterType($letterType): PostageInfo { if (!in_array($letterType, Envelope::getLetterTypeOptions())) { throw new InvalidArgumentException( sprintf('Property %s is not supported for %s', $letterType, __FUNCTION__) ); } $this->letter[...
Set the letter type @param string $letterType @return self @throws InvalidArgumentException
entailment
public function deleteFleetsFleetIdMembersMemberId($fleetId, $memberId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { $this->deleteFleetsFleetIdMembersMemberIdWithHttpInfo($fleetId, $memberId, $datasource, $token, $userAgent, $xUserAgent); }
Operation deleteFleetsFleetIdMembersMemberId Kick fleet member @param int $fleetId ID for a fleet (required) @param int $memberId The character ID of a member in this fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access ...
entailment
public function deleteFleetsFleetIdMembersMemberIdAsync($fleetId, $memberId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { return $this->deleteFleetsFleetIdMembersMemberIdAsyncWithHttpInfo($fleetId, $memberId, $datasource, $token, $userAgent, $xUserAgent) -...
Operation deleteFleetsFleetIdMembersMemberIdAsync Kick fleet member @param int $fleetId ID for a fleet (required) @param int $memberId The character ID of a member in this fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Ac...
entailment
public function deleteFleetsFleetIdMembersMemberIdAsyncWithHttpInfo($fleetId, $memberId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { $returnType = ''; $request = $this->deleteFleetsFleetIdMembersMemberIdRequest($fleetId, $memberId, $datasource, $token, $userA...
Operation deleteFleetsFleetIdMembersMemberIdAsyncWithHttpInfo Kick fleet member @param int $fleetId ID for a fleet (required) @param int $memberId The character ID of a member in this fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param stri...
entailment
public function deleteFleetsFleetIdSquadsSquadId($fleetId, $squadId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { $this->deleteFleetsFleetIdSquadsSquadIdWithHttpInfo($fleetId, $squadId, $datasource, $token, $userAgent, $xUserAgent); }
Operation deleteFleetsFleetIdSquadsSquadId Delete fleet squad @param int $fleetId ID for a fleet (required) @param int $squadId The squad to delete (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unable to...
entailment
public function deleteFleetsFleetIdSquadsSquadIdAsync($fleetId, $squadId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { return $this->deleteFleetsFleetIdSquadsSquadIdAsyncWithHttpInfo($fleetId, $squadId, $datasource, $token, $userAgent, $xUserAgent) ->then(...
Operation deleteFleetsFleetIdSquadsSquadIdAsync Delete fleet squad @param int $fleetId ID for a fleet (required) @param int $squadId The squad to delete (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unab...
entailment
public function deleteFleetsFleetIdWingsWingId($fleetId, $wingId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { $this->deleteFleetsFleetIdWingsWingIdWithHttpInfo($fleetId, $wingId, $datasource, $token, $userAgent, $xUserAgent); }
Operation deleteFleetsFleetIdWingsWingId Delete fleet wing @param int $fleetId ID for a fleet (required) @param int $wingId The wing to delete (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unable to set ...
entailment
public function deleteFleetsFleetIdWingsWingIdAsync($fleetId, $wingId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { return $this->deleteFleetsFleetIdWingsWingIdAsyncWithHttpInfo($fleetId, $wingId, $datasource, $token, $userAgent, $xUserAgent) ->then( ...
Operation deleteFleetsFleetIdWingsWingIdAsync Delete fleet wing @param int $fleetId ID for a fleet (required) @param int $wingId The wing to delete (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unable to...
entailment
public function getCharactersCharacterIdFleet($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getCharactersCharacterIdFleetWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent); return $response; }
Operation getCharactersCharacterIdFleet Get character fleet info @param int $characterId An EVE character ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unable to set a header (optional) @param string ...
entailment
public function getCharactersCharacterIdFleetAsync($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getCharactersCharacterIdFleetAsyncWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent) ->then( f...
Operation getCharactersCharacterIdFleetAsync Get character fleet info @param int $characterId An EVE character ID (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unable to set a header (optional) @param st...
entailment
public function getFleetsFleetIdAsync($fleetId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getFleetsFleetIdAsyncWithHttpInfo($fleetId, $datasource, $token, $userAgent, $xUserAgent) ->then( function ($response) { ...
Operation getFleetsFleetIdAsync Get fleet information @param int $fleetId ID for a fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $token Access token to use if unable to set a header (optional) @param string $userAgent Client id...
entailment
public function getFleetsFleetIdMembers($fleetId, $datasource = 'tranquility', $language = 'en-us', $token = null, $userAgent = null, $xUserAgent = null) { list($response) = $this->getFleetsFleetIdMembersWithHttpInfo($fleetId, $datasource, $language, $token, $userAgent, $xUserAgent); return $respons...
Operation getFleetsFleetIdMembers Get fleet members @param int $fleetId ID for a fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $language Language to use in the response (optional, default to en-us) @param string $token Access t...
entailment
public function getFleetsFleetIdMembersAsync($fleetId, $datasource = 'tranquility', $language = 'en-us', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getFleetsFleetIdMembersAsyncWithHttpInfo($fleetId, $datasource, $language, $token, $userAgent, $xUserAgent) ->then( ...
Operation getFleetsFleetIdMembersAsync Get fleet members @param int $fleetId ID for a fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $language Language to use in the response (optional, default to en-us) @param string $token Acc...
entailment
public function getFleetsFleetIdWingsAsync($fleetId, $datasource = 'tranquility', $language = 'en-us', $token = null, $userAgent = null, $xUserAgent = null) { return $this->getFleetsFleetIdWingsAsyncWithHttpInfo($fleetId, $datasource, $language, $token, $userAgent, $xUserAgent) ->then( ...
Operation getFleetsFleetIdWingsAsync Get fleet wings @param int $fleetId ID for a fleet (required) @param string $datasource The server name you would like data from (optional, default to tranquility) @param string $language Language to use in the response (optional, default to en-us) @param string $token Access ...
entailment