sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
public function getLabelMeta($property = null, $fallbackValue = "")
{
if (is_null($property)) {
$varReturn = $this->__labelmeta;
} elseif (isset($this->__labelmeta[$property])
&& !is_null($this->__labelmeta[$property])
) {
$varReturn = $this->__labelmeta[$... | Get label meta property.
@param string $property Property to get from internal label meta array.
@param string $fallbackValue Optional fallback value if requested property has no value
@return string Property value or empty string of none is set. | entailment |
public function getName()
{
$strName = parent::getName();
if (empty($strName)) {
$strName = $this->__name = $this->__generateName();
}
return $strName;
} | Return the (original) name of the current field.
Use getDynamicName() to get the field name + dynamic count
@return string The original field name | entailment |
public function getDynamicName($intCount = 0)
{
$strName = $this->getName();
if ($intCount > 0) {
$strName = $strName . "_" . $intCount;
}
return $strName;
} | Same as getName() except getDynamicName adds the current dynamic count to the fieldname as a suffix (_1, _2 etc)
When the dynamic count === 0, the return value equals the output of getName()
@param integer $intCount The dynamic count
@return string The field name | entailment |
public function getShortLabel()
{
$strReturn = $this->getLabel();
$strShortLabel = $this->getMeta("summaryLabel", null);
if (! is_null($strShortLabel) && strlen($strShortLabel) > 0) {
$strReturn = $strShortLabel;
}
return $strReturn;
} | Get the short label (meta 'summaryLabel') if available.
Use the 'long' (regular)
label as a fallback return value.
@return string The short or regular element label | entailment |
protected function conditionsToJs($intDynamicPosition = 0)
{
$strReturn = "";
if ($this->hasConditions() && (count($this->getConditions()) > 0)) {
/* @var $objCondition \ValidFormBuilder\Condition */
foreach ($this->getConditions() as $objCondition) {
$strRet... | Generates needed javascript initialization code for client-side conditional logic
@param integer $intDynamicPosition Dynamic position
@return string Generated javascript code | entailment |
protected function matchWithToJs($intDynamicPosition = 0)
{
$strReturn = "";
$objMatchWith = $this->getValidator()->getMatchWith();
if (is_object($objMatchWith)) {
$strId = ($intDynamicPosition == 0) ? $this->__id : $this->__id . "_" . $intDynamicPosition;
$strMatchI... | Generate matchWith javascript code
@param integer $intDynamicPosition
@return string Generated javascript | entailment |
public function setData($strKey = null, $varValue = null)
{
$arrData = $this->getMeta("data", array());
if (! is_null($strKey) && ! is_null($varValue)) {
$arrData[$strKey] = $varValue;
}
// Set and overwrite previous value.
$this->setMeta("data", $arrData, true)... | Store data in the current object.
This data will not be visibile in any output and will only be used for internal purposes. For example, you
can store some custom data from your CMS or an other library in a field object, for later use.
**Note: Using this method will overwrite any previously set data with the same key... | entailment |
public function getData($strKey = null)
{
$varReturn = false;
$arrData = $this->getMeta("data", null);
if (! is_null($arrData)) {
if ($strKey == null) {
$varReturn = $arrData;
} else {
if (isset($arrData[$strKey])) {
... | Get a value from the internal data array.
@param string $strKey The key of the data attribute to return
@return mixed | entailment |
protected function __sanitizeCheckForJs($strCheck)
{
$strCheck = (empty($strCheck)) ? "''" : str_replace("'", "\\'", $strCheck);
$strCheck = (mb_substr($strCheck, -1) == "u") ? mb_substr($strCheck, 0, -1) : $strCheck;
return $strCheck;
} | Sanitize a regular expression check for javascript.
@param string $strCheck
@return mixed|string | entailment |
protected function __getMetaString()
{
$strOutput = "";
foreach ($this->__meta as $key => $value) {
if (! in_array($key, array_merge($this->__reservedmeta, $this->__fieldmeta))) {
$strOutput .= " {$key}=\"{$value}\"";
}
}
return $strOutput;
... | Convert meta array to html attributes+values
@return string | entailment |
protected function __getFieldMetaString()
{
$strOutput = "";
if (is_array($this->__fieldmeta)) {
foreach ($this->__fieldmeta as $key => $value) {
if (! in_array($key, $this->__reservedmeta)) {
$strOutput .= " {$key}=\"{$value}\"";
}
... | Convert fieldmeta array to html attributes+values
@return string | entailment |
protected function __getLabelMetaString()
{
$strOutput = "";
if (is_array($this->__labelmeta)) {
foreach ($this->__labelmeta as $key => $value) {
if (! in_array($key, $this->__reservedmeta)) {
$strOutput .= " {$key}=\"{$value}\"";
}
... | Convert labelmeta array to html attributes+values
@return string | entailment |
protected function __getTipMetaString()
{
$strOutput = "";
if (is_array($this->__tipmeta)) {
foreach ($this->__tipmeta as $key => $value) {
if (! in_array($key, $this->__reservedmeta)) {
$strOutput .= " {$key}=\"{$value}\"";
}
... | Convert tipmeta array to html attributes+values
@return string | entailment |
protected function __getDynamicLabelMetaString()
{
$strOutput = "";
if (is_array($this->__dynamiclabelmeta)) {
foreach ($this->__dynamiclabelmeta as $key => $value) {
if (! in_array($key, $this->__reservedmeta)) {
$strOutput .= " {$key}=\"{$value}\"";... | Convert dynamiclabelmeta array to html attributes+values
@return string | entailment |
protected function __getDynamicRemoveLabelMetaString()
{
$strOutput = "";
if (is_array($this->__dynamicremovelabelmeta)) {
foreach ($this->__dynamicremovelabelmeta as $key => $value) {
if (! in_array($key, $this->__reservedmeta)) {
$strOutput .= " {$k... | Convert dynamicRemoveLabelMeta array to html attributes+values
@return string | entailment |
protected function __initializeMeta()
{
foreach ($this->__meta as $key => $value) {
if (in_array($key, $this->__reservedfieldmeta)) {
$key = "field" . $key;
}
if (in_array($key, $this->__reservedlabelmeta)) {
$key = "label" . $key;
... | Filter out special field or label specific meta tags from the main
meta array and add them to the designated meta arrays __fieldmeta or __labelmeta.
Example: `$meta["labelstyle"] = "width: 20px";` will become `$__fieldmeta["style"] = "width: 20px;"`
Any meta key that starts with 'label' or 'field' will be assigned to i... | entailment |
protected function __setMeta($property, $value, $blnOverwrite = false)
{
$internalMetaArray = &$this->__meta;
/**
* Re-set internalMetaArray if property has magic key 'label', 'field', 'tip', 'dynamicLabel'
* or 'dynamicRemoveLabel'
*/
$strMagicKey = null;
... | Helper method to set meta data
@param string $property The key to set in the meta array
@param string $value The corresponding value
@param boolean $blnOverwrite If true, overwrite pre-existing key-value pair
@return array|string|null | entailment |
public function getRouteOriginDestination($destination, $origin, $avoid = null, $connections = null, $datasource = 'tranquility', $flag = 'shortest', $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getRouteOriginDestinationWithHttpInfo($destination, $origin, $avoid, $connections, $datasour... | Operation getRouteOriginDestination
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 $datasource T... | entailment |
public function getRouteOriginDestinationWithHttpInfo($destination, $origin, $avoid = null, $connections = null, $datasource = 'tranquility', $flag = 'shortest', $userAgent = null, $xUserAgent = null)
{
$returnType = 'int[]';
$request = $this->getRouteOriginDestinationRequest($destination, $origin, ... | 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 $... | entailment |
public function getRouteOriginDestinationAsync($destination, $origin, $avoid = null, $connections = null, $datasource = 'tranquility', $flag = 'shortest', $userAgent = null, $xUserAgent = null)
{
return $this->getRouteOriginDestinationAsyncWithHttpInfo($destination, $origin, $avoid, $connections, $datasourc... | Operation getRouteOriginDestinationAsync
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 $datasou... | entailment |
public function getRouteOriginDestinationAsyncWithHttpInfo($destination, $origin, $avoid = null, $connections = null, $datasource = 'tranquility', $flag = 'shortest', $userAgent = null, $xUserAgent = null)
{
$returnType = 'int[]';
$request = $this->getRouteOriginDestinationRequest($destination, $ori... | Operation getRouteOriginDestinationAsyncWithHttpInfo
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 str... | entailment |
protected function getRouteOriginDestinationRequest($destination, $origin, $avoid = null, $connections = null, $datasource = 'tranquility', $flag = 'shortest', $userAgent = null, $xUserAgent = null)
{
// verify the required parameter 'destination' is set
if ($destination === null) {
thro... | Create request for operation 'getRouteOriginDestination'
@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 $da... | entailment |
private function clearContext()
{
$this->url = NULL;
$this->params = array();
$this->headers = array();
Logger::log('Context service for ' . static::class . ' cleared!');
$this->closeConnection();
} | Método que limpia el contexto de la llamada | entailment |
private function initialize()
{
$this->closeConnection();
$this->params = [];
$this->con = curl_init($this->url);
} | Initialize CURL | entailment |
public function yearly(\DateTime $firstExecution = null, \DateTime $lastExecution = null)
{
$this->task->setInterval(CronExpression::factory('@yearly'), $firstExecution, $lastExecution);
return $this;
} | {@inheritdoc} | entailment |
public function cron($cronExpression, \DateTime $firstExecution = null, \DateTime $lastExecution = null)
{
$this->task->setInterval(CronExpression::factory($cronExpression), $firstExecution, $lastExecution);
return $this;
} | {@inheritdoc} | entailment |
public function getQuery($queryParams)
{
return array_key_exists($queryParams, $this->query) ? $this->query[$queryParams] : null;
} | Get query params
@param string $queryParams
@return mixed | entailment |
public function get($param)
{
return array_key_exists($param, $this->data) ? $this->data[$param] : null;
} | Método que devuelve un parámetro de la solicitud
@param string $param
@return string|null | entailment |
public function redirect($url = null)
{
if (null === $url) {
$url = $this->getServer('HTTP_ORIGIN');
}
ob_start();
header('Location: ' . $url);
ob_end_clean();
Security::getInstance()->updateSession();
exit(t('Redireccionando...'));
} | Método que realiza una redirección a la url dada
@param string $url | entailment |
public function getServer($param, $default = null)
{
return array_key_exists($param, $this->server) ? $this->server[$param] : $default;
} | Devuelve un parámetro de $_SERVER
@param string $param
@param $default
@return string|null | entailment |
public function getRootUrl($hasProtocol = true)
{
$url = $this->getServerName();
$protocol = $hasProtocol ? $this->getProtocol() : '';
if (!empty($protocol)) {
$url = $protocol . $url;
}
if (!in_array((integer)$this->getServer('SERVER_PORT'), [80, 443], true)) {
... | Devuelve la url completa de base
@param boolean $hasProtocol
@return string | entailment |
public function init()
{
parent::init();
Logger::log(static::class . ' init', LOG_DEBUG);
$this->domain = $this->getDomain();
$this->hydrateRequestData();
$this->hydrateOrders();
if($this instanceof CustomApi === false) {
$this->createConnection($this->get... | Initialize api | entailment |
protected function hydrateOrders()
{
if (count($this->query)) {
Logger::log(static::class . ' gathering query string', LOG_DEBUG);
foreach ($this->query as $key => $value) {
if ($key === self::API_ORDER_FIELD && is_array($value)) {
foreach ($value ... | Hydrate order from request | entailment |
protected function extractPagination()
{
Logger::log(static::class . ' extract pagination start', LOG_DEBUG);
$page = array_key_exists(self::API_PAGE_FIELD, $this->query) ? $this->query[self::API_PAGE_FIELD] : 1;
$limit = array_key_exists(self::API_LIMIT_FIELD, $this->query) ? $this->query[s... | Extract pagination values
@return array | entailment |
private function addOrders(ModelCriteria &$query)
{
Logger::log(static::class . ' extract orders start ', LOG_DEBUG);
$orderAdded = FALSE;
$tableMap = $this->getTableMap();
foreach ($this->order->getOrders() as $field => $direction) {
if ($column = ApiHelper::checkFieldEx... | Add order fields to query
@param ModelCriteria $query
@throws \PSFS\base\exception\ApiException | entailment |
protected function addFilters(ModelCriteria &$query)
{
if (count($this->query) > 0) {
$tableMap = $this->getTableMap();
foreach ($this->query as $field => $value) {
if (self::API_COMBO_FIELD === $field) {
ApiHelper::composerComboField($tableMap, $q... | Add filters fields to query
@param ModelCriteria $query | entailment |
private function paginate()
{
$this->list = null;
try {
$query = $this->prepareQuery();
$this->addFilters($query);
$this->checkReturnFields($query);
$this->addOrders($query);
list($page, $limit) = $this->extractPagination();
if ... | Generate list page for model | entailment |
public function modelList()
{
$this->action = self::API_ACTION_LIST;
$code = 200;
list($return, $total, $pages) = $this->getList();
$message = null;
if(!$total) {
$message = t('No se han encontrado elementos para la búsqueda');
}
return $this->jso... | @label Get list of {__API__} elements filtered
@GET
@CACHE 600
@ROUTE /{__DOMAIN__}/api/{__API__}
@return \PSFS\base\dto\JsonResponse(data=[{__API__}]) | entailment |
public function get($pk)
{
$this->action = self::API_ACTION_GET;
$return = NULL;
$total = NULL;
$pages = 1;
$message = null;
list($code, $return) = $this->getSingleResult($pk);
if($code !== 200) {
$message = t('No se ha encontrado el elemento solic... | @label Get unique element for {__API__}
@GET
@CACHE 600
@ROUTE /{__DOMAIN__}/api/{__API__}/{pk}
@param int $pk
@return \PSFS\base\dto\JsonResponse(data={__API__}) | entailment |
public function post()
{
$this->action = self::API_ACTION_POST;
$saved = FALSE;
$status = 400;
$model = NULL;
$message = null;
try {
$this->hydrateFromRequest();
if (false !== $this->model->save($this->con)) {
$status = 200;
... | @label Create a new {__API__}
@POST
@PAYLOAD {__API__}
@ROUTE /{__DOMAIN__}/api/{__API__}
@return \PSFS\base\dto\JsonResponse(data={__API__}) | entailment |
public function put($pk)
{
$this->action = self::API_ACTION_PUT;
$this->hydrateModel($pk);
$status = 400;
$updated = FALSE;
$model = NULL;
$message = null;
if (NULL !== $this->model) {
try {
$this->hydrateModelFromRequest($this->mod... | @label Modify {__API__} model
@PUT
@PAYLOAD {__API__}
@ROUTE /{__DOMAIN__}/api/{__API__}/{pk}
@param string $pk
@return \PSFS\base\dto\JsonResponse(data={__API__}) | entailment |
public function delete($pk = NULL)
{
$this->action = self::API_ACTION_DELETE;
$this->closeTransaction(200);
$deleted = FALSE;
$message = null;
if (NULL !== $pk) {
try {
$this->con->beginTransaction();
$this->hydrateModel($pk);
... | @label Delete {__API__} model
@DELETE
@ROUTE /{__DOMAIN__}/api/{__API__}/{pk}
@param string $pk
@return \PSFS\base\dto\JsonResponse(data={__API__}) | entailment |
public function bulk() {
$this->action = self::API_ACTION_BULK;
$saved = FALSE;
$status = 400;
$message = null;
try {
$this->hydrateBulkRequest();
$this->saveBulk();
$saved = true;
$status = 200;
} catch(\Exception $e) {
... | @label Bulk insert for {__API__} model
@POST
@route /{__DOMAIN__}/api/{__API__}s
@payload [{__API__}]
@return \PSFS\base\dto\JsonResponse(data=[{__API__}]) | entailment |
protected function hydrateRequestData()
{
$request = Request::getInstance();
$this->query = array_merge($this->query, $request->getQueryParams());
$this->data = array_merge($this->data, $request->getRawData());
} | Hydrate data from request | entailment |
private function getSingleResult($pk)
{
$model = $this->_get($pk);
$code = 200;
$return = array();
if (NULL === $model || !method_exists($model, 'toArray')) {
$code = 404;
} else {
$return = $model->toArray($this->fieldType ?: TableMap::TYPE_PHPNAME, t... | @param integer $pk
@return array | entailment |
public function assertNotThrows(string $class, callable $execute) : void
{
try {
$execute();
} catch (ExpectationFailedException $e) {
throw $e;
} catch (Throwable $e) {
static::assertThat($e, new LogicalNot(new ConstraintException($class)));
... | Asserts that the callable doesn't throw a specified exception.
@param string $class The exception type expected not to be thrown.
@param callable $execute The callable.
@since 1.0.0 | entailment |
public function assertThrows(
string $class,
callable $execute,
callable $inspect = null
) : void {
try {
$execute();
} catch (ExpectationFailedException $e) {
throw $e;
} catch (Throwable $e) {
static::assertThat($e, new Constraint... | Asserts that the callable throws a specified throwable.
If successful and the inspection callable is not null
then it is called and the caught exception is passed as argument.
@param string $class The exception type expected to be thrown.
@param callable $execute The callable.
@param callable|null $inspect... | entailment |
public function cachePoints($metricId, $num = 1000, $page = 1)
{
// If cache already exists return it
if ($this->cached != null) {
return $this->cached;
}
$this->cached = $this->client->call(
'GET',
"metrics/$metricId/points",
[
... | Cache Points for performance improvement.
@param int $metricId
@param int $num
@param int $page
@return array|bool | entailment |
public function indexPoints($metricId, $num = 1000, $page = 1)
{
if ($this->cache != false) {
return $this->cachePoints($metricId, $num, $page);
}
return $this->client->call(
'GET',
"metrics/$metricId/points",
[
'query' => [
... | Get a defined number of Points.
@param int $metricId
@param int $num
@param int $page
@return array|bool | entailment |
public function searchPoints($metricId, $search, $by, $limit = 1, $num = 1000, $page = 1)
{
$points = $this->indexPoints($metricId, $num, $page)['data'];
$filtered = array_filter(
$points,
function ($point) use ($search, $by) {
if (array_key_exists($by, $poi... | Search if a defined number of Points exists.
@param $metricId
@param string $search
@param string $by
@param int $limit
@param int $num
@param int $page
@return mixed | entailment |
public function getAllRoutes()
{
$routes = [];
foreach ($this->getRoutes() as $path => $route) {
if (array_key_exists('slug', $route)) {
$routes[$route['slug']] = $path;
}
}
return $routes;
} | Method that extract all routes in the platform
@return array | entailment |
public function execute($route)
{
Logger::log('Executing the request');
try {
//Search action and execute
return $this->searchAction($route);
} catch (AccessDeniedException $e) {
Logger::log(t('Solicitamos credenciales de acceso a zona restringida'), LOG_W... | @param string|null $route
@throws \Exception
@return string HTML | entailment |
public function getRoute($slug = '', $absolute = FALSE, array $params = [])
{
if ('' === $slug) {
return $absolute ? Request::getInstance()->getRootUrl() . '/' : '/';
}
if (!is_array($this->slugs) || !array_key_exists($slug, $this->slugs)) {
throw new RouterException(... | @param string $slug
@param boolean $absolute
@param array $params
@return string|null
@throws RouterException | entailment |
private function generateSlugs($absoluteTranslationFileName)
{
$translations = I18nHelper::generateTranslationsFile($absoluteTranslationFileName);
foreach ($this->routing as $key => &$info) {
$keyParts = explode('#|#', $key);
$keyParts = array_key_exists(1, $keyParts) ? $keyP... | Parse slugs to create translations
@param string $absoluteTranslationFileName | entailment |
public function setSystemMessageType($messageType): Envelope
{
if (!in_array($messageType, static::getLetterTypeOptions())) {
throw new InvalidArgumentException(
sprintf('Property %s is not supported for %s', $messageType, __FUNCTION__)
);
}
$this->da... | Specify the type of E-POST letter
@param string $messageType
@return self
@throws InvalidArgumentException | entailment |
public function addRecipientNormal(Recipient\Normal $recipient): Envelope
{
if ($this->isHybridLetter()) {
throw new LogicException(
sprintf('Can not set recipients if message type is "%s"', self::LETTER_TYPE_HYBRID)
);
}
$this->data['recipients'][] =... | Add a normal (electronic) recipient
@param Recipient\Normal|AbstractRecipient $recipient
@return self | entailment |
public function addRecipientPrinted(Recipient\Hybrid $recipient): Envelope
{
if ($this->isNormalLetter()) {
throw new LogicException(
sprintf('Can not set recipientsPrinted if message type is "%s"', self::LETTER_TYPE_NORMAL)
);
}
if (count($this->getR... | Add a hybrid recipient for printed letters
@param Recipient\Hybrid|AbstractRecipient $recipient
@return self | entailment |
public function getRecipients()
{
switch ($this->getSystemMessageType()) {
case self::LETTER_TYPE_NORMAL:
return $this->data['recipients'];
break;
case self::LETTER_TYPE_HYBRID:
return $this->data['recipientsPrinted'];
... | Get the recipients added to the envelope
@return AbstractRecipient[] | entailment |
public function setContactType($contactType)
{
$allowedValues = $this->getContactTypeAllowableValues();
if (!in_array($contactType, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'contactType', must be one of '%s'",... | Sets contactType
@param string $contactType contact_type string
@return $this | entailment |
public function getEnvelope(): Envelope
{
if (null === $this->envelope) {
throw new MissingEnvelopeException('No Envelope provided! Provide one beforehand');
}
// Check for recipients
if (empty($this->envelope->getRecipients())) {
throw new MissingRecipientEx... | Get the envelope
@return Envelope
@throws MissingEnvelopeException If the envelope is missing
@throws MissingRecipientException If there are no recipients | entailment |
public function addAttachment($attachment): Letter
{
if (!is_file($attachment)) {
throw new InvalidArgumentException('"%s" can not be found or is not a file');
}
$this->attachments[] = $attachment;
return $this;
} | Add an attachment
@param string $attachment The file path
@return self
@throws InvalidArgumentException If the file is not found or it is no file | entailment |
public function setDeliveryOptions(DeliveryOptions $deliveryOptions): Letter
{
if ($this->envelope && $this->envelope->isNormalLetter()) {
throw new LogicException('Delivery options are not supported for non-printed letters.');
}
$this->deliveryOptions = $deliveryOptions;
... | Set the delivery options
@param DeliveryOptions $deliveryOptions
@return self
@throws LogicException If the letter isn't a hybrid (printed) letter | entailment |
public function getPostageInfo()
{
if (null === $this->postageInfo) {
throw new MissingPreconditionException('No postage info provided! Provide them beforehand');
}
// Set delivery options to postage info if they were passed to this instance
if (null === $this->postageIn... | Get the postage info
@return PostageInfo
@throws MissingPreconditionException If no postage info are given | entailment |
public function create(): Letter
{
$multipartElements = [
[
'name' => 'envelope',
'contents' => \GuzzleHttp\json_encode($this->getEnvelope()),
'headers' => ['Content-Type' => $this->getEnvelope()->getMimeType()],
],
];
... | Create a draft by given envelope and attachments
@return self
@throws BadResponseException See API Send Reference | entailment |
public function send(): Letter
{
$options = [
'headers' => [
'Content-Source' => $this->getEndpointMailbox().'/letters/'.$this->getLetterId(),
],
];
if ($this->getEnvelope()->isHybridLetter() && null !== $this->getDeliveryOptions()) {
$opt... | Send the given letter. Delivery options should be set optionally for physical letters
@return self
@throws BadResponseException See API Send Reference | entailment |
public function queryPriceInformation()
{
try {
// Try to fetch postage info for a particular draft that was created beforehand
$options = [
'headers' => [
'Content-Source' => $this->getEndpointMailbox().'/letters/'.$this->getLetterId(),
... | Query price information for a given letter (created beforehand) or for general purposes (with given postage info)
@return \stdClass
@throws BadResponseException See API Send Reference
@throws MissingPreconditionException If neither letterId nor PostageInfo provided | entailment |
private static function getMimeTypeOfFile($path)
{
$fileInfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($fileInfo, $path);
finfo_close($fileInfo);
return $mime;
} | Get a file's mime type
@param $path
@return mixed | entailment |
public function getCharactersCharacterIdAttributes($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCharactersCharacterIdAttributesWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent);
return $response;... | Operation getCharactersCharacterIdAttributes
Get character attributes
@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 getCharactersCharacterIdAttributesAsync($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdAttributesAsyncWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent)
->then(
... | Operation getCharactersCharacterIdAttributesAsync
Get character attributes
@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)
@para... | entailment |
public function getCharactersCharacterIdSkillqueueAsync($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdSkillqueueAsyncWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent)
->then(
... | Operation getCharactersCharacterIdSkillqueueAsync
Get character's skill queue
@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)
@p... | entailment |
public function getCharactersCharacterIdSkills($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCharactersCharacterIdSkillsWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent);
return $response;
} | Operation getCharactersCharacterIdSkills
Get character skills
@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 $us... | entailment |
public function getCharactersCharacterIdSkillsAsync($characterId, $datasource = 'tranquility', $token = null, $userAgent = null, $xUserAgent = null)
{
return $this->getCharactersCharacterIdSkillsAsyncWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent)
->then(
... | Operation getCharactersCharacterIdSkillsAsync
Get character skills
@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 strin... | entailment |
public function getCharactersCharacterIdWallets($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCharactersCharacterIdWalletsWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent);
return $response;
} | Operation getCharactersCharacterIdWallets
List wallets and balances
@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... | entailment |
public function getCharacter($characterId, $fields = ['*'])
{
//dd(config('services.igdb.url'));
$apiUrl = $this->getEndpoint('characters');
$apiUrl .= $characterId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, ... | Get character information
@param integer $characterId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getCompany($companyId, $fields = ['*'])
{
$apiUrl = $this->getEndpoint('companies');
$apiUrl .= $companyId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decodeSingle($api... | Get company information by ID
@param integer $companyId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getFranchise($franchiseId, $fields = ['*'])
{
$apiUrl = $this->getEndpoint('franchises');
$apiUrl .= $franchiseId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decodeSing... | Get franchise information
@param integer $franchiseId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getGameMode($gameModeId, $fields = ['name', 'slug', 'url'])
{
$apiUrl = $this->getEndpoint('game_modes');
$apiUrl .= $gameModeId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $t... | Get game mode information by ID
@param integer $gameModeId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function searchGameModes($search, $fields = ['name', 'slug', 'url'], $limit = 10, $offset = 0)
{
$apiUrl = $this->getEndpoint('game_modes');
$params = array(
'fields' => implode(',', $fields),
'limit' => $limit,
'offset' => $offset,
'search' =>... | Search game modes by name
@param string $search
@param array $fields
@param integer $limit
@param integer $offset
@return \StdClass
@throws \Exception | entailment |
public function getGame($gameId, $fields = ['*'])
{
$apiUrl = $this->getEndpoint('games');
$apiUrl .= $gameId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decodeSingle($apiData);
} | Get game information by ID
@param integer $gameId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function searchGames($search, $fields = ['*'], $limit = 10, $offset = 0, $order = null)
{
$apiUrl = $this->getEndpoint('games');
$params = array(
'fields' => implode(',', $fields),
'limit' => $limit,
'offset' => $offset,
'order' => $order,
... | Search games by name
@param string $search
@param array $fields
@param integer $limit
@param integer $offset
@param string $order
@return \StdClass
@throws \Exception | entailment |
public function getGenre($genreId, $fields = ['name', 'slug', 'url'])
{
$apiUrl = $this->getEndpoint('genres');
$apiUrl .= $genreId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decodeSi... | Get genre information by ID
@param integer $genreId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getKeyword($keywordId, $fields = ['name', 'slug', 'url'])
{
$apiUrl = $this->getEndpoint('keywords');
$apiUrl .= $keywordId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->... | Get keyword information by ID
@param integer $keywordId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getPerson($personId, $fields = ['*'])
{
$apiUrl = $this->getEndpoint('people');
$apiUrl .= $personId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decodeSingle($apiData);... | Get people information by ID
@param integer $personId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getPlatform($platformId, $fields = ['name', 'logo', 'slug', 'url'])
{
$apiUrl = $this->getEndpoint('platforms');
$apiUrl .= $platformId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
re... | Get platform information by ID
@param integer $platformId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getPlayerPerspective($perspectiveId, $fields = ['name', 'slug', 'url'])
{
$apiUrl = $this->getEndpoint('player_perspectives');
$apiUrl .= $perspectiveId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $par... | Get player perspective information by ID
@param integer $perspectiveId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getPulse($pulseId, $fields = ['*'])
{
$apiUrl = $this->getEndpoint('pulses');
$apiUrl .= $pulseId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decodeSingle($apiData);
... | Get pulse information by ID
@param integer $pulseId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function fetchPulses($fields = ['*'], $limit = 10, $offset = 0)
{
$apiUrl = $this->getEndpoint('pulses');
$params = array(
'fields' => implode(',', $fields),
'limit' => $limit,
'offset' => $offset
);
$apiData = $this->apiGet($apiUrl, $para... | Search pulses by title
@param array $fields
@param integer $limit
@param integer $offset
@return \StdClass
@throws \Exception | entailment |
public function getCollection($collectionId, $fields = ['*'])
{
$apiUrl = $this->getEndpoint('collections');
$apiUrl .= $collectionId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decode... | Get collection information by ID
@param integer $collectionId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
public function getTheme($themeId, $fields = ['name', 'slug', 'url'])
{
$apiUrl = $this->getEndpoint('themes');
$apiUrl .= $themeId;
$params = array(
'fields' => implode(',', $fields)
);
$apiData = $this->apiGet($apiUrl, $params);
return $this->decodeSi... | Get themes information by ID
@param integer $themeId
@param array $fields
@return \StdClass
@throws \Exception | entailment |
private function decodeSingle(&$apiData)
{
$resObj = json_decode($apiData);
if (isset($resObj->status)) {
$msg = "Error " . $resObj->status . " " . $resObj->message;
throw new \Exception($msg);
}
if (!is_array($resObj) || count($resObj) == 0) {
r... | Decode the response from IGDB, extract the single resource object.
(Don't use this to decode the response containing list of objects)
@param string $apiData the api response from IGDB
@throws \Exception
@return \StdClass an IGDB resource object | entailment |
private function decodeMultiple(&$apiData)
{
$resObj = json_decode($apiData);
if (isset($resObj->status)) {
$msg = "Error " . $resObj->status . " " . $resObj->message;
throw new \Exception($msg);
} else {
//$itemsArray = $resObj->items;
if (!i... | Decode the response from IGDB, extract the multiple resource object.
@param string $apiData the api response from IGDB
@throws \Exception
@return \StdClass an IGDB resource object | entailment |
private function apiGet($url, $params)
{
$url = $url . (strpos($url, '?') === false ? '?' : '') . http_build_query($params);
try {
$response = $this->httpClient->request('GET', $url, [
'headers' => [
'user-key' => $this->igdbKey,
'... | Using CURL to issue a GET request
@param $url
@param $params
@return mixed
@throws \Exception | entailment |
public function init()
{
if (!in_array($this->layout, ['horizontal', 'stacked'])) {
throw new InvalidConfigException('Invalid layout type: ' . $this->layout);
}
Html::addCssClass($this->options, 'uk-form');
if ($this->layout !== 'grid') {
Html::addCssClass($... | {@inheritdoc} | entailment |
public function getCharactersCharacterIdPlanets($characterId, $datasource = null, $token = null, $userAgent = null, $xUserAgent = null)
{
list($response) = $this->getCharactersCharacterIdPlanetsWithHttpInfo($characterId, $datasource, $token, $userAgent, $xUserAgent);
return $response;
} | Operation getCharactersCharacterIdPlanets
Get colonies
@param int $characterId Character id of the target 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)
@param st... | entailment |
public function setFaction($faction)
{
$allowed_values = array('Minmatar', 'Gallente', 'Caldari', 'Amarr');
if (!is_null($faction) && (!in_array($faction, $allowed_values))) {
throw new \InvalidArgumentException("Invalid value for 'faction', must be one of 'Minmatar', 'Gallente', 'Caldar... | Sets faction
@param string $faction faction string
@return $this | entailment |
public function setTaxRate($taxRate)
{
if (($taxRate > 1)) {
throw new \InvalidArgumentException('invalid value for $taxRate when calling GetCorporationsCorporationIdOk., must be smaller than or equal to 1.');
}
if (($taxRate < 0)) {
throw new \InvalidArgumentExcepti... | Sets taxRate
@param float $taxRate tax_rate number
@return $this | entailment |
public function setFinishedLevel($finishedLevel)
{
if (($finishedLevel > 5)) {
throw new \InvalidArgumentException('invalid value for $finishedLevel when calling GetCharactersCharacterIdSkillqueue200Ok., must be smaller than or equal to 5.');
}
if (($finishedLevel < 0)) {
... | Sets finishedLevel
@param int $finishedLevel finished_level integer
@return $this | entailment |
public function setOwnerType($ownerType)
{
$allowed_values = array('eve_server', 'corporation', 'faction', 'character', 'alliance');
if ((!in_array($ownerType, $allowed_values))) {
throw new \InvalidArgumentException("Invalid value for 'ownerType', must be one of 'eve_server', 'corporati... | Sets ownerType
@param string $ownerType owner_type string
@return $this | entailment |
private function checkAuth()
{
$namespace = explode('\\', $this->getModelTableMap());
$module = strtolower($namespace[0]);
$secret = Config::getInstance()->get($module . '.api.secret');
if (NULL === $secret) {
$secret = Config::getInstance()->get("api.secret");
}
... | Check service authentication
@return bool | entailment |
public function getField($name)
{
return (null !== $name && array_key_exists($name, $this->fields)) ? $this->fields[$name] : null;
} | @param string $name
@return array|null | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.