sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
private function hasFailed(TaskExecutionInterface $execution, \Exception $exception)
{
// this find is necessary because the storage could be
// invalid (clear in doctrine) after handling an execution.
$execution = $this->taskExecutionRepository->findByUuid($execution->getUuid());
$e... | The given task failed the run.
@param TaskExecutionInterface $execution
@param \Exception $exception
@return TaskExecutionInterface | entailment |
private function finalize(TaskExecutionInterface $execution, $start)
{
// this find is necessary because the storage could be
// invalid (clear in doctrine) after handling an execution.
$execution = $this->taskExecutionRepository->findByUuid($execution->getUuid());
if ($execution->g... | Finalizes given execution.
@param TaskExecutionInterface $execution
@param int $start | entailment |
public function execute(TaskExecutionInterface $execution)
{
$handler = $this->handlerFactory->create($execution->getHandlerClass());
try {
return $handler->handle($execution->getWorkload());
} catch (FailedException $exception) {
throw $exception->getPrevious();
... | {@inheritdoc} | entailment |
public function cacheMetrics($num = 1000, $page = 1)
{
if ($this->cached != null) {
return $this->cached;
}
$this->cached = $this->client->call(
'GET',
'metrics',
[
'query' => [
'per_page' => $num,
... | Cache Metrics for performance improvement.
@param int $num
@param int $page
@return array|bool | entailment |
public function indexMetrics($num = 1000, $page = 1)
{
if ($this->cache != false) {
return $this->cacheMetrics($num, $page);
}
return $this->client->call(
'GET',
'metrics',
[
'query' => [
'per_page' => $num,... | Get a defined number of Metrics.
@param int $num
@param int $page
@return array|bool | entailment |
public function searchMetrics($search, $by, $limit = 1, $num = 1000, $page = 1)
{
$metrics = $this->indexMetrics($num, $page)['data'];
$filtered = array_filter(
$metrics,
function ($metric) use ($search, $by) {
if (array_key_exists($by, $metric)) {
... | Search if a defined number of Metrics exists.
@param string $search
@param string $by
@param int $num
@param int $page
@param int $limit
@return mixed | entailment |
private function loadFullDictionary(): void
{
$file = __DIR__ . '/../Dictionary/' . $this->language;
if (!file_exists($file)) {
$file = __DIR__ . '/../Dictionary/en_US';
}
self::$dictionary = array_filter(explode(PHP_EOL, file_get_contents($file)));
} | Load the current language dictionary with a lot of words
to always be able to get a unique value. | entailment |
public function getCharactersCharacterIdKillmailsRecentAsync($characterId, $datasource = 'tranquility', $maxCount = '50', $maxKillId = null, $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdKillmailsRecentAsyncWithHttpInfo($characterId, $datasource, $maxCount, $m... | Operation getCharactersCharacterIdKillmailsRecentAsync
Get character kills and losses
@param int $characterId An EVE character ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $maxCount How many killmails to return at maximum (optional, ... | entailment |
public function getCorporationsCorporationIdKillmailsRecent($corporationId, $datasource = 'tranquility', $maxKillId = null, $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCorporationsCorporationIdKillmailsRecentWithHttpInfo($corporationId, $datasource, $maxKillId, $token... | Operation getCorporationsCorporationIdKillmailsRecent
Get corporation kills and losses
@param int $corporationId An EVE corporation ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $maxKillId Only return killmails with ID smaller than th... | entailment |
public function getCorporationsCorporationIdKillmailsRecentAsync($corporationId, $datasource = 'tranquility', $maxKillId = null, $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCorporationsCorporationIdKillmailsRecentAsyncWithHttpInfo($corporationId, $datasource, $maxKillId, $token,... | Operation getCorporationsCorporationIdKillmailsRecentAsync
Get corporation kills and losses
@param int $corporationId An EVE corporation ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $maxKillId Only return killmails with ID smaller th... | entailment |
public function getKillmailsKillmailIdKillmailHash($killmailHash, $killmailId, $datasource = 'tranquility', $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getKillmailsKillmailIdKillmailHashWithHttpInfo($killmailHash, $killmailId, $datasource, $userAgent, $xUserAgent);
return $resp... | Operation getKillmailsKillmailIdKillmailHash
Get a single killmail
@param string $killmailHash The killmail hash for verification (required)
@param int $killmailId The killmail ID to be queried (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param ... | entailment |
public function getKillmailsKillmailIdKillmailHashAsync($killmailHash, $killmailId, $datasource = 'tranquility', $userAgent = null, $xUserAgent = null)
{
return $this->getKillmailsKillmailIdKillmailHashAsyncWithHttpInfo($killmailHash, $killmailId, $datasource, $userAgent, $xUserAgent)
->then(
... | Operation getKillmailsKillmailIdKillmailHashAsync
Get a single killmail
@param string $killmailHash The killmail hash for verification (required)
@param int $killmailId The killmail ID to be queried (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@pa... | entailment |
public function setContactType($contactType)
{
$allowed_values = array('character', 'corporation', 'alliance', 'faction');
if ((!in_array($contactType, $allowed_values))) {
throw new \InvalidArgumentException("Invalid value for 'contactType', must be one of 'character', 'corporation', 'a... | Sets contactType
@param string $contactType contact_type string
@return $this | entailment |
public function getAlliancesAllianceId($allianceId, $datasource = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getAlliancesAllianceIdWithHttpInfo($allianceId, $datasource, $userAgent, $xUserAgent);
return $response;
} | Operation getAlliancesAllianceId
Get alliance information
@param int $allianceId An Eve alliance ID (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 string $xUser... | entailment |
public function getAlliancesAllianceIdCorporations($allianceId, $datasource = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getAlliancesAllianceIdCorporationsWithHttpInfo($allianceId, $datasource, $userAgent, $xUserAgent);
return $response;
} | Operation getAlliancesAllianceIdCorporations
List alliance's corporations
@param int $allianceId An EVE alliance ID (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)
@par... | entailment |
public function getAlliancesAllianceIdIcons($allianceId, $datasource = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getAlliancesAllianceIdIconsWithHttpInfo($allianceId, $datasource, $userAgent, $xUserAgent);
return $response;
} | Operation getAlliancesAllianceIdIcons
Get alliance icon
@param int $allianceId An EVE alliance ID (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 string $xUserAg... | entailment |
public function __toArray()
{
$dto = array();
try {
$reflectionClass = new \ReflectionClass($this);
$properties = $reflectionClass->getProperties(\ReflectionProperty::IS_PUBLIC);
if (count($properties) > 0) {
/** @var \ReflectionProperty $property ... | Convert dto to array representation
@return array | entailment |
public function fromArray(array $object = array())
{
if (count($object) > 0) {
$reflector = new \ReflectionClass($this);
$properties = InjectorHelper::extractProperties($reflector, \ReflectionProperty::IS_PUBLIC, InjectorHelper::VAR_PATTERN);
unset($reflector);
... | Hydrate object from array
@param array $object | entailment |
public static function addModelField(TableMap $tableMap, ModelCriteria &$query, $field, $value = null)
{
if ($column = self::checkFieldExists($tableMap, $field)) {
self::addQueryFilter($column, $query, $value);
}
} | Method that adds the fields for the model into the API Query
@param TableMap $tableMap
@param ModelCriteria $query
@param string $field
@param mixed $value | entailment |
public function createInstance($sid ,$token, $version = null, $retryAttempts = 1)
{
return new \Services_Twilio($sid, $token, $version, null, $retryAttempts);
} | Returns a new \Services_Twilio instance from the given parameters
@param $sid
@param $token
@param null $version
@param int $retryAttempts
@return \Services_Twilio | entailment |
public function deleteCharactersCharacterIdContactsAsync($characterId, $contactIds, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->deleteCharactersCharacterIdContactsAsyncWithHttpInfo($characterId, $contactIds, $datasource, $token, $userAgent, $xUserAgent)... | Operation deleteCharactersCharacterIdContactsAsync
Delete contacts
@param int $characterId An EVE character ID (required)
@param int[] $contactIds A list of contacts to delete (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param string $token Acce... | entailment |
public function deleteCharactersCharacterIdContactsAsyncWithHttpInfo($characterId, $contactIds, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
$returnType = '';
$request = $this->deleteCharactersCharacterIdContactsRequest($characterId, $contactIds, $datasource, ... | Operation deleteCharactersCharacterIdContactsAsyncWithHttpInfo
Delete contacts
@param int $characterId An EVE character ID (required)
@param int[] $contactIds A list of contacts to delete (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param string... | entailment |
public function getAlliancesAllianceIdContacts($allianceId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getAlliancesAllianceIdContactsWithHttpInfo($allianceId, $datasource, $page, $token, $userAgent, $xUserAgent);
return ... | Operation getAlliancesAllianceIdContacts
Get alliance contacts
@param int $allianceId An EVE alliance ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $page Which page of results to return (optional, default to 1)
@param string $token A... | entailment |
public function getAlliancesAllianceIdContactsAsync($allianceId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getAlliancesAllianceIdContactsAsyncWithHttpInfo($allianceId, $datasource, $page, $token, $userAgent, $xUserAgent)
->the... | Operation getAlliancesAllianceIdContactsAsync
Get alliance contacts
@param int $allianceId An EVE alliance ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $page Which page of results to return (optional, default to 1)
@param string $to... | entailment |
public function getCharactersCharacterIdContactsAsync($characterId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdContactsAsyncWithHttpInfo($characterId, $datasource, $page, $token, $userAgent, $xUserAgent)
... | Operation getCharactersCharacterIdContactsAsync
Get contacts
@param int $characterId An EVE character ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $page Which page of results to return (optional, default to 1)
@param string $token A... | entailment |
public function getCharactersCharacterIdContactsLabels($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCharactersCharacterIdContactsLabelsWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent);
return $r... | Operation getCharactersCharacterIdContactsLabels
Get contact labels
@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 stri... | entailment |
public function getCharactersCharacterIdContactsLabelsAsync($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdContactsLabelsAsyncWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent)
->then(... | Operation getCharactersCharacterIdContactsLabelsAsync
Get contact labels
@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 ... | entailment |
public function getCorporationsCorporationIdContacts($corporationId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCorporationsCorporationIdContactsWithHttpInfo($corporationId, $datasource, $page, $token, $userAgent, $xUserAgent... | Operation getCorporationsCorporationIdContacts
Get corporation contacts
@param int $corporationId An EVE corporation ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $page Which page of results to return (optional, default to 1)
@param ... | entailment |
public function getCorporationsCorporationIdContactsAsync($corporationId, $datasource = 'tranquility', $page = '1', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCorporationsCorporationIdContactsAsyncWithHttpInfo($corporationId, $datasource, $page, $token, $userAgent, $xUserAgent)... | Operation getCorporationsCorporationIdContactsAsync
Get corporation contacts
@param int $corporationId An EVE corporation ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $page Which page of results to return (optional, default to 1)
@pa... | entailment |
public function postCharactersCharacterIdContacts($characterId, $contactIds, $standing, $datasource = 'tranquility', $labelId = '0', $token = null, $userAgent = null, $watched = 'false', $xUserAgent = null)
{
list($response) = $this->postCharactersCharacterIdContactsWithHttpInfo($characterId, $contactIds, $... | Operation postCharactersCharacterIdContacts
Add contacts
@param int $characterId An EVE character ID (required)
@param int[] $contactIds A list of contacts to add (required)
@param float $standing Standing for the new contact (required)
@param string $datasource The server name you would like data from (optional,... | entailment |
public function postCharactersCharacterIdContactsAsync($characterId, $contactIds, $standing, $datasource = 'tranquility', $labelId = '0', $token = null, $userAgent = null, $watched = 'false', $xUserAgent = null)
{
return $this->postCharactersCharacterIdContactsAsyncWithHttpInfo($characterId, $contactIds, $s... | Operation postCharactersCharacterIdContactsAsync
Add contacts
@param int $characterId An EVE character ID (required)
@param int[] $contactIds A list of contacts to add (required)
@param float $standing Standing for the new contact (required)
@param string $datasource The server name you would like data from (opti... | entailment |
public function postCharactersCharacterIdContactsAsyncWithHttpInfo($characterId, $contactIds, $standing, $datasource = 'tranquility', $labelId = '0', $token = null, $userAgent = null, $watched = 'false', $xUserAgent = null)
{
$returnType = 'int[]';
$request = $this->postCharactersCharacterIdContacts... | Operation postCharactersCharacterIdContactsAsyncWithHttpInfo
Add contacts
@param int $characterId An EVE character ID (required)
@param int[] $contactIds A list of contacts to add (required)
@param float $standing Standing for the new contact (required)
@param string $datasource The server name you would like dat... | entailment |
public function putCharactersCharacterIdContactsAsync($characterId, $contactIds, $standing, $datasource = 'tranquility', $labelId = '0', $token = null, $userAgent = null, $watched = 'false', $xUserAgent = null)
{
return $this->putCharactersCharacterIdContactsAsyncWithHttpInfo($characterId, $contactIds, $sta... | Operation putCharactersCharacterIdContactsAsync
Edit contacts
@param int $characterId An EVE character ID (required)
@param int[] $contactIds A list of contacts to edit (required)
@param float $standing Standing for the contact (required)
@param string $datasource The server name you would like data from (optiona... | entailment |
public function putCharactersCharacterIdContactsAsyncWithHttpInfo($characterId, $contactIds, $standing, $datasource = 'tranquility', $labelId = '0', $token = null, $userAgent = null, $watched = 'false', $xUserAgent = null)
{
$returnType = '';
$request = $this->putCharactersCharacterIdContactsRequest... | Operation putCharactersCharacterIdContactsAsyncWithHttpInfo
Edit contacts
@param int $characterId An EVE character ID (required)
@param int[] $contactIds A list of contacts to edit (required)
@param float $standing Standing for the contact (required)
@param string $datasource The server name you would like data f... | entailment |
public function setCompany($company): Hybrid
{
self::validateSetLength('company', $company);
$this->data['company'] = $company;
return $this;
} | @param string $company
@return self | entailment |
public function setSalutation($salutation): Hybrid
{
self::validateSetLength('salutation', $salutation);
$this->data['salutation'] = $salutation;
return $this;
} | @param string $salutation
@return self | entailment |
public function setTitle($title): Hybrid
{
self::validateSetLength('title', $title);
$this->data['title'] = $title;
return $this;
} | @param string $title
@return self | entailment |
public function setFirstName($firstName): Hybrid
{
self::validateSetLength('firstName', $firstName);
$this->data['firstName'] = $firstName;
return $this;
} | @param string $firstName
@return self | entailment |
public function setLastName($lastName): Hybrid
{
self::validateSetLength('lastName', $lastName);
$this->data['lastName'] = $lastName;
return $this;
} | @param string $lastName
@return self | entailment |
public function setStreetName($streetName): Hybrid
{
self::validateSetLength('streetName', $streetName);
$this->data['streetName'] = $streetName;
return $this;
} | @param string $streetName
@return self | entailment |
public function setHouseNumber($houseNumber): Hybrid
{
self::validateSetLength('houseNumber', $houseNumber);
$this->data['houseNumber'] = $houseNumber;
return $this;
} | @param string $houseNumber
@return self | entailment |
public function setAddressAddOn($addressAddOn): Hybrid
{
self::validateSetLength('addressAddOn', $addressAddOn);
$this->data['addressAddOn'] = $addressAddOn;
return $this;
} | @param string $addressAddOn
@return self | entailment |
public function setPostOfficeBox($postOfficeBox): Hybrid
{
self::validateSetLength('postOfficeBox', $postOfficeBox);
$this->data['postOfficeBox'] = $postOfficeBox;
return $this;
} | @param string $postOfficeBox
@return self | entailment |
public function setZipCode($zipCode): Hybrid
{
self::validateSetLength('zipCode', $zipCode);
$this->data['zipCode'] = $zipCode;
return $this;
} | @param string $zipCode
@return self | entailment |
public function setCity($city): Hybrid
{
self::validateSetLength('city', $city);
$this->data['city'] = $city;
return $this;
} | @param string $city
@@return self | entailment |
function jsonSerialize()
{
if ((null === $this->getStreetName() && null === $this->getPostOfficeBox()) || null === $this->getZipCode()) {
throw new InvalidRecipientDataException(
'A (street name or post office box) and zip code must be set at least'
);
}
... | {@inheritdoc}
@throws InvalidRecipientDataException | entailment |
public function setResponse($response)
{
$allowed_values = array('accepted', 'declined', 'tentative');
if ((!in_array($response, $allowed_values))) {
throw new \InvalidArgumentException("Invalid value for 'response', must be one of 'accepted', 'declined', 'tentative'");
}
... | Sets response
@param string $response response string
@return $this | entailment |
public function setFromType($fromType)
{
$allowed_values = array('agent', 'npc_corp', 'faction');
if ((!in_array($fromType, $allowed_values))) {
throw new \InvalidArgumentException("Invalid value for 'fromType', must be one of 'agent', 'npc_corp', 'faction'");
}
$this->co... | Sets fromType
@param string $fromType from_type string
@return $this | entailment |
public function setStanding($standing)
{
if (($standing > 10)) {
throw new \InvalidArgumentException('invalid value for $standing when calling GetCharactersCharacterIdStandings200Ok., must be smaller than or equal to 10.');
}
if (($standing < -10)) {
throw new \Inval... | Sets standing
@param float $standing standing number
@return $this | entailment |
public static function checkFieldExists(TableMap $tableMap, $field)
{
$column = null;
try {
foreach($tableMap->getColumns() as $tableMapColumn) {
$columnName = $tableMapColumn->getPhpName();
if(preg_match('/^'.$field.'$/i', $columnName)) {
... | Check if parametrized field exists in api model
@param TableMap $tableMap
@param $field
@return \Propel\Runtime\Map\ColumnMap|null | entailment |
public function getStateAllowableValues()
{
return [
self::STATE_OPEN,
self::STATE_CLOSED,
self::STATE_EXPIRED,
self::STATE_CANCELLED,
self::STATE_PENDING,
self::STATE_CHARACTER_DELETED,
];
} | Gets allowable values of the enum
@return string[] | entailment |
private static function extractAction($doc)
{
$action = null;
if (false !== preg_match('/@action\s+([^\s]+)/', $doc, $matches)) {
if(count($matches) > 1) {
list(, $action) = $matches;
}
}
return $action;
} | Method that extract the instance of the class
@param $doc
@return null|string | entailment |
public function find()
{
$runTime = new \DateTime();
$skippedExecutions = [];
while ($execution = $this->taskExecutionRepository->findNextScheduled($runTime, $skippedExecutions)) {
$handler = $this->taskHandlerFactory->create($execution->getHandlerClass());
if (!$han... | {@inheritdoc} | entailment |
public function listInvalidProperties()
{
$invalidProperties = [];
if ($this->container['fuelBayView'] === null) {
$invalidProperties[] = "'fuelBayView' can't be null";
}
$allowedValues = $this->getFuelBayViewAllowableValues();
if (!in_array($this->container['fue... | Show all the invalid properties with reasons.
@return array invalid properties with reasons | entailment |
public function valid()
{
if ($this->container['fuelBayView'] === null) {
return false;
}
$allowedValues = $this->getFuelBayViewAllowableValues();
if (!in_array($this->container['fuelBayView'], $allowedValues)) {
return false;
}
if ($this->con... | Validate all the properties in the model
return true if all passed
@return bool True if all properties are valid | entailment |
public function setFuelBayView($fuelBayView)
{
$allowedValues = $this->getFuelBayViewAllowableValues();
if (!in_array($fuelBayView, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'fuelBayView', must be one of '%s'",... | Sets fuelBayView
@param string $fuelBayView Who can view the starbase (POS)'s fule bay. Characters either need to have required role or belong to the starbase (POS) owner's corporation or alliance, as described by the enum, all other access settings follows the same scheme
@return $this | entailment |
public function setFuelBayTake($fuelBayTake)
{
$allowedValues = $this->getFuelBayTakeAllowableValues();
if (!in_array($fuelBayTake, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'fuelBayTake', must be one of '%s'",... | Sets fuelBayTake
@param string $fuelBayTake Who can take fuel blocks out of the starbase (POS)'s fuel bay
@return $this | entailment |
public function setAnchor($anchor)
{
$allowedValues = $this->getAnchorAllowableValues();
if (!in_array($anchor, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'anchor', must be one of '%s'",
impl... | Sets anchor
@param string $anchor Who can anchor starbase (POS) and its structures
@return $this | entailment |
public function setUnanchor($unanchor)
{
$allowedValues = $this->getUnanchorAllowableValues();
if (!in_array($unanchor, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'unanchor', must be one of '%s'",
... | Sets unanchor
@param string $unanchor Who can unanchor starbase (POS) and its structures
@return $this | entailment |
public function setOnline($online)
{
$allowedValues = $this->getOnlineAllowableValues();
if (!in_array($online, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'online', must be one of '%s'",
impl... | Sets online
@param string $online Who can online starbase (POS) and its structures
@return $this | entailment |
public function setOffline($offline)
{
$allowedValues = $this->getOfflineAllowableValues();
if (!in_array($offline, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'offline', must be one of '%s'",
... | Sets offline
@param string $offline Who can offline starbase (POS) and its structures
@return $this | entailment |
public function adminLogin($route = null)
{
if ($this->isAdmin()) {
return $this->redirect('admin');
} else {
return Admin::staticAdminLogon($route);
}
} | Acción que pinta un formulario genérico de login pra la zona restringida
@param string $route
@GET
@route /admin/login
@visible false
@return string HTML | entailment |
public function postLogin($route = null)
{
$form = new LoginForm();
$form->setData(array("route" => $route));
$form->build();
$tpl = Template::getInstance();
$tpl->setPublicZone(true);
$template = "login.html.twig";
$params = array(
'form' => $form... | Servicio que valida el login
@param null $route
@POST
@visible false
@route /admin/login
@return string
@throws \PSFS\base\exception\FormException | entailment |
private function genCrfsToken()
{
$hashOrig = '';
if (!empty($this->fields)) {
foreach (array_keys($this->fields) as $field) {
if ($field !== self::SEPARATOR) {
$hashOrig .= $field;
}
}
}
if ('' !== $hashOrig... | Método que genera un CRFS token para los formularios
@return Form | entailment |
public function toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayError = true)
{
$strClass = (! empty($this->__class)) ? " class=\"{$this->__class} vf__page\"" : "class=\"vf__page\"";
$strStyle = (! empty($this->__style)) ? " style=\"{$this->__style}\"" : "";
... | Generate HTML
See {@link \ValidFormBuilder\ValidForm::toHtml()}
@return string | entailment |
public function addField($objField)
{
if (get_class($objField) == "ValidFormBuilder\\Fieldset") {
$objField->setMeta("parent", $this, true);
$this->__elements->addObject($objField);
} else {
if ($this->__elements->count() == 0) {
$objFieldset = new... | Add a field object
See {@link \ValidFormBuilder\Fieldset::addField()}
@param Element $objField | entailment |
public function toJS($intDynamicPosition = 0)
{
$strReturn = "objForm.addPage('" . $this->getId() . "');\n";
foreach ($this->__elements as $field) {
$strReturn .= $field->toJS($intDynamicPosition);
}
return $strReturn;
} | Generate javascript
See {@link \ValidFormBuilder\Base::toJS()}
@see \ValidFormBuilder\Base::toJS() | entailment |
public function getShortHeader()
{
$strReturn = $this->getHeader();
$strShortLabel = $this->getMeta("summaryLabel", null);
if (strlen($strShortLabel) > 0) {
$strReturn = $strShortLabel;
}
return $strReturn;
} | Get the short header if available.
If no short header is set (meta 'summaryLabel' on the Page object),
the full-length regular header is returned.
@return string Page (short)header as a string | entailment |
public function toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayErrors = true)
{
$blnError = ($submitted && ! $this->__validator->validate() && $blnDisplayErrors) ? true : false;
if (! $blnSimpleLayout) {
// *** We asume that all dynamic fields greater ... | Generate HTML output
@see \ValidFormBuilder\Element::toHtml() Element::toHtml() for a full description of this method | entailment |
public function toJS($intDynamicPosition = 0)
{
$strOutput = "";
$strCheck = $this->__sanitizeCheckForJs($this->__validator->getCheck());
$strRequired = ($this->__validator->getRequired()) ? "true" : "false";
;
$intMaxLength = ($this->__validator->getMaxLength() > 0) ? $this... | Generate Javascript
@see \ValidFormBuilder\Element::toJS() Element::toJS() for a full description of this method | entailment |
public function getValue($intDynamicPosition = 0)
{
$varValue = parent::getValue($intDynamicPosition);
return (strlen($varValue) > 0 && $varValue !== 0) ? true : false;
} | Get checkbox value
See {@link \ValidFormBuilder\Element::getValue()}
@see \ValidFormBuilder\Element::getValue() | entailment |
public static function checkRestrictedAccess($route)
{
Logger::log('Checking admin zone');
//Chequeamos si entramos en el admin
if (!Config::getInstance()->checkTryToSaveConfig()
&& (preg_match('/^\/(admin|setup\-admin)/i', $route) || Config::getParam('restricted', false))
... | Method that checks the access to the restricted zone
@param string $route
@throws AccessDeniedException
@throws AdminCredentialsException | entailment |
public static function generateToken($secret, $module = 'PSFS', $isOdd = null)
{
$ts = self::getTs($isOdd);
$module = strtolower($module);
$hash = hash_hmac('sha256', $module, $secret);
$token = self::mixSecret($ts, $hash);
$finalToken = self::mixToken($ts, $hash, $token);
... | Generate a authorized token
@param string $secret
@param string $module
@param boolean $isOdd
@return string | entailment |
private static function decodeToken($token, $force = false)
{
$decoded = NULL;
$parts = self::extractTokenParts($token);
list($token, $ts) = self::parseTokenParts($parts);
if ($force || time() - (integer)$ts < 300) {
$decoded = $token;
}
return $decoded;
... | Decode token to check authorized request
@param string $token
@param boolean $force
@return null|string | entailment |
public static function checkToken($token, $secret, $module = 'PSFS')
{
if (0 === strlen($token) || 0 === strlen($secret)) {
return false;
}
$module = strtolower($module);
$decodedToken = self::decodeToken($token);
$expectedToken = self::decodeToken(self::generateT... | Checks if auth token is correct
@param string $token
@param string $secret
@param string $module
@return bool | entailment |
public function setFirstExecution(\DateTime $firstExecution)
{
$this->firstExecution = $firstExecution;
$this->lastExecution = null;
return $this;
} | {@inheritdoc} | entailment |
public function setInterval(
CronExpression $interval,
\DateTime $firstExecution = null,
\DateTime $lastExecution = null
) {
$this->interval = $interval;
$this->firstExecution = $firstExecution ?: new \DateTime();
$this->lastExecution = $lastExecution;
return... | {@inheritdoc} | entailment |
public static function calculateNetworkAddress(Address $address, SubnetMask $subnetMask)
{
return new Address($address->get() & $subnetMask->get());
} | Calculate the network address of a Block given an IPV4 network address and SubnetMask.
@param \JAAulde\IP\V4\Address $address The IP address from which a network address will be derived
@param \JAAulde\IP\V4\SubnetMask $subnetMask The subnet mask (in address form) used in the derivation
@return \JAAulde\IP\V4\A... | entailment |
public static function calculateBroadcastAddress(Address $address, SubnetMask $subnetMask)
{
return new Address($address->get() | ~$subnetMask->get());
} | Calculate the broadcast address of a Block given an IPV4 network address and SubnetMask.
@param \JAAulde\IP\V4\Address $address The IP address from which a broadcast address will be derived
@param \JAAulde\IP\V4\SubnetMask $subnetMask The subnet mask (in address form) used in the derivation
@return \JAAulde\IP\... | entailment |
public function addField($field)
{
if (!$field instanceof Base) {
throw new \InvalidArgumentException(
"No valid object passed to Fieldset::addField(). " .
"Object should be an instance of \\ValidFormBuilder\\Base.",
E_ERROR
);
... | Add an object to the fiedset's elements collection
@param \ValidFormBuilder\Base $field The object to add
@throws \InvalidArgumentException if property passed to `addField()` is not an instance of Base | entailment |
public function toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayErrors = true)
{
// Call this right before __getMetaString();
$this->setConditionalMeta();
//*** Set the "id" if not yet set.
$this->__setMeta("id", $this->getName(), false);
$... | Generate HTML output for this fieldset and all it's children
@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 $blnDisplayErrors Display generated errors
@... | entailment |
public function setAdminHeaders()
{
$platform = trim(Config::getInstance()->get('platform.name'));
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic Realm="' . $platform . '"');
echo t('Zona restringida');
exit();
} | Servicio que devuelve las cabeceras de autenticación
@return string HTML | entailment |
public function getAdmins()
{
$admins = $this->security->getAdmins();
if (!empty($admins)) {
if (!$this->security->checkAdmin()) {
$this->setAdminHeaders();
}
}
$this->parseAdmins($admins);
return $admins;
} | Servicio que devuelve los administradores de la plataforma
@return array|mixed | entailment |
private function parseAdmins(&$admins)
{
if (!empty($admins)) {
foreach ($admins as &$admin) {
if (isset($admin['profile'])) {
switch ($admin['profile']) {
case Security::MANAGER_ID_TOKEN:
$admin['class'] = '... | Servicio que parsea los administradores para mostrarlos en la gestión de usuarios
@param array $admins | entailment |
public function getLogFiles()
{
$files = new Finder();
$files->files()->in(LOG_DIR)->name('*.log')->sortByModifiedTime();
$logs = array();
/** @var \SplFileInfo $file */
foreach ($files as $file) {
$size = $file->getSize() / 8 / 1024;
$time = date('c',... | Servicio que lee los logs y los formatea para listarlos
@return array | entailment |
public function formatLogFile($selectedLog)
{
$monthOpen = null;
$files = new Finder();
$files->files()->in(LOG_DIR)->name($selectedLog);
$file = $match = null;
$log = array();
foreach($files as $item) {
$file = $item;
$match = $item;
... | Servicio que parsea el fichero de log seleccionado
@param string|null $selectedLog
@return array | entailment |
private function parseLogLine($line, $match)
{
$line = preg_replace(array('/^\[(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})\]/'), '<span class="label label-success">$4:$5:$6 $3-$2-$1</span>', $line);
preg_match_all('/\{(.*)\}/', $line, $match);
try {
if (!empty($match[0])) {
... | Servicio que trata la línea del log para procesarle en el front end
@param $line
@param $match
@return array | entailment |
public function getCharactersCharacterIdCalendar($characterId, $datasource = 'tranquility', $fromEvent = null, $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCharactersCharacterIdCalendarWithHttpInfo($characterId, $datasource, $fromEvent, $token, $userAgent, $xUserAgent)... | Operation getCharactersCharacterIdCalendar
List calendar event summaries
@param int $characterId An EVE character ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $fromEvent The event ID to retrieve events from (optional)
@param string ... | entailment |
public function getCharactersCharacterIdCalendarAsync($characterId, $datasource = 'tranquility', $fromEvent = null, $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdCalendarAsyncWithHttpInfo($characterId, $datasource, $fromEvent, $token, $userAgent, $xUserAgent)
... | Operation getCharactersCharacterIdCalendarAsync
List calendar event summaries
@param int $characterId An EVE character ID (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param int $fromEvent The event ID to retrieve events from (optional)
@param st... | entailment |
public function getCharactersCharacterIdCalendarEventIdAsync($characterId, $eventId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdCalendarEventIdAsyncWithHttpInfo($characterId, $eventId, $datasource, $token, $userAgent, $xUserAgen... | Operation getCharactersCharacterIdCalendarEventIdAsync
Get an event
@param int $characterId An EVE character ID (required)
@param int $eventId The id of the event requested (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param string $token Access ... | entailment |
public function getCharactersCharacterIdCalendarEventIdAttendees($characterId, $eventId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCharactersCharacterIdCalendarEventIdAttendeesWithHttpInfo($characterId, $eventId, $datasource, $token, $us... | Operation getCharactersCharacterIdCalendarEventIdAttendees
Get attendees
@param int $characterId An EVE character ID (required)
@param int $eventId The id of the event requested (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param string $token Ac... | entailment |
public function getCharactersCharacterIdCalendarEventIdAttendeesAsync($characterId, $eventId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdCalendarEventIdAttendeesAsyncWithHttpInfo($characterId, $eventId, $datasource, $token, $use... | Operation getCharactersCharacterIdCalendarEventIdAttendeesAsync
Get attendees
@param int $characterId An EVE character ID (required)
@param int $eventId The id of the event requested (required)
@param string $datasource The server name you would like data from (optional, default to tranquility)
@param string $tok... | entailment |
public function putCharactersCharacterIdCalendarEventIdAsync($characterId, $eventId, $response, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->putCharactersCharacterIdCalendarEventIdAsyncWithHttpInfo($characterId, $eventId, $response, $datasource, $token, ... | Operation putCharactersCharacterIdCalendarEventIdAsync
Respond to an event
@param int $characterId An EVE character ID (required)
@param int $eventId The ID of the event requested (required)
@param \nullx27\ESI\nullx27\ESI\Models\PutCharactersCharacterIdCalendarEventIdResponse $response The response value to set, ... | entailment |
public function getSovereigntyStructures($datasource = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getSovereigntyStructuresWithHttpInfo($datasource, $userAgent, $xUserAgent);
return $response;
} | Operation getSovereigntyStructures
List sovereignty structures
@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 U... | entailment |
public function setRecipientType($recipientType)
{
$allowedValues = $this->getRecipientTypeAllowableValues();
if (!in_array($recipientType, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'recipientType', must be one... | Sets recipientType
@param string $recipientType recipient_type string
@return $this | entailment |
public function render($content = null)
{
if ($content === null) {
if (!isset($this->parts['{input}'])) {
$this->textInput();
}
if (!isset($this->parts['{error}'])) {
$this->error();
}
if (!isset($this->parts['{hint... | {@inheritdoc} | entailment |
public function label($label = null, $options = [])
{
if ($label === false) {
$this->parts['{label}'] = '';
$this->parts['{beginLabel}'] = '';
$this->parts['{endLabel}'] = '';
$this->parts['{labelTitle}'] = '';
return $this;
}
$opt... | {@inheritdoc} | entailment |
public function icon($icon, $options = [])
{
if ($icon === false) {
$this->parts['{icon}'] = '';
return $this;
}
$options = array_merge($this->iconOptions, $options);
if ($icon !== null) {
$uikit = ArrayHelper::remove($options, 'uikit', true);
... | Generates an icon tag for [[attribute]].
@param null|string|false $icon the icon to use.
If `false`, the generated field will not contain the icon part.
Note that this will NOT be [[Html::encode()|encoded]].
@param null|array $options the tag options in terms of name-value pairs. It will be merged with [[iconOptions]].... | entailment |
public function info($info, $options = [])
{
$options = array_merge($this->infoOptions, $options);
if (isset($options['uk-icon'])) {
IconAsset::register($this->form->view);
}
$tag = ArrayHelper::remove($options, 'tag', 'span');
$options['uk-tooltip'] = 'title: ' ... | Generates an info tag in the label for [[attribute]].
@param string $info the info to use.
@param null|array $options the tag options in terms of name-value pairs. It will be merged with [[infoOptions]].
The options will be rendered as the attributes of the resulting tag. The values will be HTML-encoded
@return $this t... | entailment |
public function checkbox($options = [], $enclosedByLabel = true)
{
Html::addCssClass($options,'uk-checkbox');
return parent::checkbox($options, $enclosedByLabel);
} | {@inheritdoc} | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.