repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
ongr-io/ElasticsearchBundle | DependencyInjection/Configuration.php | Configuration.getAnalysisNode | private function getAnalysisNode()
{
$builder = new TreeBuilder();
$node = $builder->root('analysis');
$node
->info('Defines analyzers, normalizers, tokenizers and filters')
->addDefaultsIfNotSet()
->children()
->arrayNode('tokenizer')
... | php | private function getAnalysisNode()
{
$builder = new TreeBuilder();
$node = $builder->root('analysis');
$node
->info('Defines analyzers, normalizers, tokenizers and filters')
->addDefaultsIfNotSet()
->children()
->arrayNode('tokenizer')
... | [
"private",
"function",
"getAnalysisNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'analysis'",
")",
";",
"$",
"node",
"->",
"info",
"(",
"'Defines analyzers, normalizers... | Analysis configuration node.
@return \Symfony\Component\Config\Definition\Builder\NodeDefinition | [
"Analysis",
"configuration",
"node",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/DependencyInjection/Configuration.php#L57-L89 |
ongr-io/ElasticsearchBundle | DependencyInjection/Configuration.php | Configuration.getManagersNode | private function getManagersNode()
{
$builder = new TreeBuilder();
$node = $builder->root('managers');
$node
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('name')
->info('Maps managers to connections and bundles')
... | php | private function getManagersNode()
{
$builder = new TreeBuilder();
$node = $builder->root('managers');
$node
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('name')
->info('Maps managers to connections and bundles')
... | [
"private",
"function",
"getManagersNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'managers'",
")",
";",
"$",
"node",
"->",
"isRequired",
"(",
")",
"->",
"requiresAt... | Managers configuration node.
@return \Symfony\Component\Config\Definition\Builder\NodeDefinition | [
"Managers",
"configuration",
"node",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/DependencyInjection/Configuration.php#L96-L194 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.parse | public function parse(\ReflectionClass $class)
{
$className = $class->getName();
if ($class->isTrait()) {
return false;
}
if (!isset($this->documents[$className])) {
/** @var Document $document */
$document = $this->reader->getClassAnnotation($cl... | php | public function parse(\ReflectionClass $class)
{
$className = $class->getName();
if ($class->isTrait()) {
return false;
}
if (!isset($this->documents[$className])) {
/** @var Document $document */
$document = $this->reader->getClassAnnotation($cl... | [
"public",
"function",
"parse",
"(",
"\\",
"ReflectionClass",
"$",
"class",
")",
"{",
"$",
"className",
"=",
"$",
"class",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"$",
"class",
"->",
"isTrait",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if... | Parses documents by used annotations and returns mapping for elasticsearch with some extra metadata.
@param \ReflectionClass $class
@return array|null
@throws MissingDocumentAnnotationException | [
"Parses",
"documents",
"by",
"used",
"annotations",
"and",
"returns",
"mapping",
"for",
"elasticsearch",
"with",
"some",
"extra",
"metadata",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L92-L133 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getPropertyAnnotationData | private function getPropertyAnnotationData(\ReflectionProperty $property)
{
$result = $this->reader->getPropertyAnnotation($property, self::PROPERTY_ANNOTATION);
if ($result !== null && $result->name === null) {
$result->name = Caser::snake($property->getName());
}
retu... | php | private function getPropertyAnnotationData(\ReflectionProperty $property)
{
$result = $this->reader->getPropertyAnnotation($property, self::PROPERTY_ANNOTATION);
if ($result !== null && $result->name === null) {
$result->name = Caser::snake($property->getName());
}
retu... | [
"private",
"function",
"getPropertyAnnotationData",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"reader",
"->",
"getPropertyAnnotation",
"(",
"$",
"property",
",",
"self",
"::",
"PROPERTY_ANNOTATION",
")",
"... | Returns property annotation data from reader.
@param \ReflectionProperty $property
@return Property|object|null | [
"Returns",
"property",
"annotation",
"data",
"from",
"reader",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L154-L163 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getEmbeddedAnnotationData | private function getEmbeddedAnnotationData(\ReflectionProperty $property)
{
$result = $this->reader->getPropertyAnnotation($property, self::EMBEDDED_ANNOTATION);
if ($result !== null && $result->name === null) {
$result->name = Caser::snake($property->getName());
}
retu... | php | private function getEmbeddedAnnotationData(\ReflectionProperty $property)
{
$result = $this->reader->getPropertyAnnotation($property, self::EMBEDDED_ANNOTATION);
if ($result !== null && $result->name === null) {
$result->name = Caser::snake($property->getName());
}
retu... | [
"private",
"function",
"getEmbeddedAnnotationData",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"reader",
"->",
"getPropertyAnnotation",
"(",
"$",
"property",
",",
"self",
"::",
"EMBEDDED_ANNOTATION",
")",
"... | Returns Embedded annotation data from reader.
@param \ReflectionProperty $property
@return Embedded|object|null | [
"Returns",
"Embedded",
"annotation",
"data",
"from",
"reader",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L172-L181 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getHashMapAnnotationData | private function getHashMapAnnotationData(\ReflectionProperty $property)
{
$result = $this->reader->getPropertyAnnotation($property, self::HASH_MAP_ANNOTATION);
if ($result !== null && $result->name === null) {
$result->name = Caser::snake($property->getName());
}
retur... | php | private function getHashMapAnnotationData(\ReflectionProperty $property)
{
$result = $this->reader->getPropertyAnnotation($property, self::HASH_MAP_ANNOTATION);
if ($result !== null && $result->name === null) {
$result->name = Caser::snake($property->getName());
}
retur... | [
"private",
"function",
"getHashMapAnnotationData",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"reader",
"->",
"getPropertyAnnotation",
"(",
"$",
"property",
",",
"self",
"::",
"HASH_MAP_ANNOTATION",
")",
";... | Returns HashMap annotation data from reader.
@param \ReflectionProperty $property
@return HashMap|object|null | [
"Returns",
"HashMap",
"annotation",
"data",
"from",
"reader",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L190-L199 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getMetaFieldAnnotationData | private function getMetaFieldAnnotationData($property, $directory)
{
/** @var MetaField $annotation */
$annotation = $this->reader->getPropertyAnnotation($property, self::ID_ANNOTATION);
$annotation = $annotation ?: $this->reader->getPropertyAnnotation($property, self::PARENT_ANNOTATION);
... | php | private function getMetaFieldAnnotationData($property, $directory)
{
/** @var MetaField $annotation */
$annotation = $this->reader->getPropertyAnnotation($property, self::ID_ANNOTATION);
$annotation = $annotation ?: $this->reader->getPropertyAnnotation($property, self::PARENT_ANNOTATION);
... | [
"private",
"function",
"getMetaFieldAnnotationData",
"(",
"$",
"property",
",",
"$",
"directory",
")",
"{",
"/** @var MetaField $annotation */",
"$",
"annotation",
"=",
"$",
"this",
"->",
"reader",
"->",
"getPropertyAnnotation",
"(",
"$",
"property",
",",
"self",
... | Returns meta field annotation data from reader.
@param \ReflectionProperty $property
@param string $directory The name of the Document directory in the bundle
@return array | [
"Returns",
"meta",
"field",
"annotation",
"data",
"from",
"reader",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L209-L231 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getAliases | private function getAliases(\ReflectionClass $reflectionClass, array &$metaFields = null)
{
$reflectionName = $reflectionClass->getName();
// We skip cache in case $metaFields is given. This should not affect performance
// because for each document this method is called only once. For obje... | php | private function getAliases(\ReflectionClass $reflectionClass, array &$metaFields = null)
{
$reflectionName = $reflectionClass->getName();
// We skip cache in case $metaFields is given. This should not affect performance
// because for each document this method is called only once. For obje... | [
"private",
"function",
"getAliases",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
",",
"array",
"&",
"$",
"metaFields",
"=",
"null",
")",
"{",
"$",
"reflectionName",
"=",
"$",
"reflectionClass",
"->",
"getName",
"(",
")",
";",
"// We skip cache in case ... | Finds aliases for every property used in document including parent classes.
@param \ReflectionClass $reflectionClass
@param array $metaFields
@return array | [
"Finds",
"aliases",
"for",
"every",
"property",
"used",
"in",
"document",
"including",
"parent",
"classes",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L251-L337 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getMutatorMethods | private function getMutatorMethods(\ReflectionClass $reflectionClass, $property, $propertyType)
{
$camelCaseName = ucfirst(Caser::camel($property));
$setterName = 'set'.$camelCaseName;
if (!$reflectionClass->hasMethod($setterName)) {
$message = sprintf(
'Missing %... | php | private function getMutatorMethods(\ReflectionClass $reflectionClass, $property, $propertyType)
{
$camelCaseName = ucfirst(Caser::camel($property));
$setterName = 'set'.$camelCaseName;
if (!$reflectionClass->hasMethod($setterName)) {
$message = sprintf(
'Missing %... | [
"private",
"function",
"getMutatorMethods",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
",",
"$",
"property",
",",
"$",
"propertyType",
")",
"{",
"$",
"camelCaseName",
"=",
"ucfirst",
"(",
"Caser",
"::",
"camel",
"(",
"$",
"property",
")",
")",
";"... | Checks if class have setter and getter, and returns them in array.
@param \ReflectionClass $reflectionClass
@param string $property
@return array | [
"Checks",
"if",
"class",
"have",
"setter",
"and",
"getter",
"and",
"returns",
"them",
"in",
"array",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L347-L390 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.registerAnnotations | private function registerAnnotations()
{
$annotations = [
'Document',
'Property',
'Embedded',
'ObjectType',
'Nested',
'Id',
'ParentDocument',
'Routing',
'Version',
'HashMap',
];
... | php | private function registerAnnotations()
{
$annotations = [
'Document',
'Property',
'Embedded',
'ObjectType',
'Nested',
'Id',
'ParentDocument',
'Routing',
'Version',
'HashMap',
];
... | [
"private",
"function",
"registerAnnotations",
"(",
")",
"{",
"$",
"annotations",
"=",
"[",
"'Document'",
",",
"'Property'",
",",
"'Embedded'",
",",
"'ObjectType'",
",",
"'Nested'",
",",
"'Id'",
",",
"'ParentDocument'",
",",
"'Routing'",
",",
"'Version'",
",",
... | Registers annotations to registry so that it could be used by reader. | [
"Registers",
"annotations",
"to",
"registry",
"so",
"that",
"it",
"could",
"be",
"used",
"by",
"reader",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L395-L417 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getDocumentType | private function getDocumentType($document, $directory)
{
$namespace = $this->finder->getNamespace($document, $directory);
$reflectionClass = new \ReflectionClass($namespace);
$document = $this->getDocumentAnnotationData($reflectionClass);
return empty($document->type) ? Caser::snak... | php | private function getDocumentType($document, $directory)
{
$namespace = $this->finder->getNamespace($document, $directory);
$reflectionClass = new \ReflectionClass($namespace);
$document = $this->getDocumentAnnotationData($reflectionClass);
return empty($document->type) ? Caser::snak... | [
"private",
"function",
"getDocumentType",
"(",
"$",
"document",
",",
"$",
"directory",
")",
"{",
"$",
"namespace",
"=",
"$",
"this",
"->",
"finder",
"->",
"getNamespace",
"(",
"$",
"document",
",",
"$",
"directory",
")",
";",
"$",
"reflectionClass",
"=",
... | Returns document type.
@param string $document Format must be like AcmeBundle:Document.
@param string $directory The Document directory name of the bundle.
@return string | [
"Returns",
"document",
"type",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L427-L434 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getDocumentPropertiesReflection | private function getDocumentPropertiesReflection(\ReflectionClass $reflectionClass)
{
if (in_array($reflectionClass->getName(), $this->properties)) {
return $this->properties[$reflectionClass->getName()];
}
$properties = [];
foreach ($reflectionClass->getProperties() as... | php | private function getDocumentPropertiesReflection(\ReflectionClass $reflectionClass)
{
if (in_array($reflectionClass->getName(), $this->properties)) {
return $this->properties[$reflectionClass->getName()];
}
$properties = [];
foreach ($reflectionClass->getProperties() as... | [
"private",
"function",
"getDocumentPropertiesReflection",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"reflectionClass",
"->",
"getName",
"(",
")",
",",
"$",
"this",
"->",
"properties",
")",
")",
"{",
"retur... | Returns all defined properties including private from parents.
@param \ReflectionClass $reflectionClass
@return array | [
"Returns",
"all",
"defined",
"properties",
"including",
"private",
"from",
"parents",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L443-L468 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getAnalyzers | private function getAnalyzers(\ReflectionClass $reflectionClass)
{
$analyzers = [];
foreach ($this->getDocumentPropertiesReflection($reflectionClass) as $name => $property) {
$directory = $this->guessDirName($property->getDeclaringClass());
$type = $this->getPropertyAnnotat... | php | private function getAnalyzers(\ReflectionClass $reflectionClass)
{
$analyzers = [];
foreach ($this->getDocumentPropertiesReflection($reflectionClass) as $name => $property) {
$directory = $this->guessDirName($property->getDeclaringClass());
$type = $this->getPropertyAnnotat... | [
"private",
"function",
"getAnalyzers",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
")",
"{",
"$",
"analyzers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDocumentPropertiesReflection",
"(",
"$",
"reflectionClass",
")",
"as",
"$",
"nam... | Parses analyzers list from document mapping.
@param \ReflectionClass $reflectionClass
@return array | [
"Parses",
"analyzers",
"list",
"from",
"document",
"mapping",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L476-L514 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getProperties | private function getProperties(\ReflectionClass $reflectionClass, $properties = [], $flag = false)
{
$mapping = [];
/** @var \ReflectionProperty $property */
foreach ($this->getDocumentPropertiesReflection($reflectionClass) as $name => $property) {
$directory = $this->guessDirNa... | php | private function getProperties(\ReflectionClass $reflectionClass, $properties = [], $flag = false)
{
$mapping = [];
/** @var \ReflectionProperty $property */
foreach ($this->getDocumentPropertiesReflection($reflectionClass) as $name => $property) {
$directory = $this->guessDirNa... | [
"private",
"function",
"getProperties",
"(",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
",",
"$",
"properties",
"=",
"[",
"]",
",",
"$",
"flag",
"=",
"false",
")",
"{",
"$",
"mapping",
"=",
"[",
"]",
";",
"/** @var \\ReflectionProperty $property */",
"fo... | Returns properties of reflection class.
@param \ReflectionClass $reflectionClass Class to read properties from.
@param array $properties Properties to skip.
@param bool $flag If false exludes properties, true only includes properties.
@return array | [
"Returns",
"properties",
"of",
"reflection",
"class",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L525-L570 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.getObjectMapping | private function getObjectMapping($className, $directory)
{
$namespace = $this->finder->getNamespace($className, $directory);
if (array_key_exists($namespace, $this->objects)) {
return $this->objects[$namespace];
}
$reflectionClass = new \ReflectionClass($namespace);
... | php | private function getObjectMapping($className, $directory)
{
$namespace = $this->finder->getNamespace($className, $directory);
if (array_key_exists($namespace, $this->objects)) {
return $this->objects[$namespace];
}
$reflectionClass = new \ReflectionClass($namespace);
... | [
"private",
"function",
"getObjectMapping",
"(",
"$",
"className",
",",
"$",
"directory",
")",
"{",
"$",
"namespace",
"=",
"$",
"this",
"->",
"finder",
"->",
"getNamespace",
"(",
"$",
"className",
",",
"$",
"directory",
")",
";",
"if",
"(",
"array_key_exist... | Returns object mapping.
Loads from cache if it's already loaded.
@param string $className
@param string $directory Name of the directory where the Document is
@return array | [
"Returns",
"object",
"mapping",
"."
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L582-L614 |
ongr-io/ElasticsearchBundle | Mapping/DocumentParser.php | DocumentParser.guessDirName | private function guessDirName(\ReflectionClass $reflection)
{
return substr(
$directory = $reflection->getName(),
$start = strpos($directory, '\\') + 1,
strrpos($directory, '\\') - $start
);
} | php | private function guessDirName(\ReflectionClass $reflection)
{
return substr(
$directory = $reflection->getName(),
$start = strpos($directory, '\\') + 1,
strrpos($directory, '\\') - $start
);
} | [
"private",
"function",
"guessDirName",
"(",
"\\",
"ReflectionClass",
"$",
"reflection",
")",
"{",
"return",
"substr",
"(",
"$",
"directory",
"=",
"$",
"reflection",
"->",
"getName",
"(",
")",
",",
"$",
"start",
"=",
"strpos",
"(",
"$",
"directory",
",",
... | @param \ReflectionClass $reflection
@return string | [
"@param",
"\\",
"ReflectionClass",
"$reflection"
] | train | https://github.com/ongr-io/ElasticsearchBundle/blob/c817dc53d3b93129e8575a740e11484c67f79a87/Mapping/DocumentParser.php#L621-L628 |
slimphp/Slim-Flash | src/Messages.php | Messages.addMessage | public function addMessage($key, $message)
{
// Create Array for this key
if (!isset($this->storage[$this->storageKey][$key])) {
$this->storage[$this->storageKey][$key] = [];
}
// Push onto the array
$this->storage[$this->storageKey][$key][] = $message;
} | php | public function addMessage($key, $message)
{
// Create Array for this key
if (!isset($this->storage[$this->storageKey][$key])) {
$this->storage[$this->storageKey][$key] = [];
}
// Push onto the array
$this->storage[$this->storageKey][$key][] = $message;
} | [
"public",
"function",
"addMessage",
"(",
"$",
"key",
",",
"$",
"message",
")",
"{",
"// Create Array for this key",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"storage",
"[",
"$",
"this",
"->",
"storageKey",
"]",
"[",
"$",
"key",
"]",
")",
")",
... | Add flash message for the next request
@param string $key The key to store the message under
@param mixed $message Message to show on next request | [
"Add",
"flash",
"message",
"for",
"the",
"next",
"request"
] | train | https://github.com/slimphp/Slim-Flash/blob/3fa6e614ed7e399fa6234c7f709bdf56be877c99/src/Messages.php#L86-L95 |
slimphp/Slim-Flash | src/Messages.php | Messages.addMessageNow | public function addMessageNow($key, $message)
{
// Create Array for this key
if (!isset($this->forNow[$key])) {
$this->forNow[$key] = [];
}
// Push onto the array
$this->forNow[$key][] = $message;
} | php | public function addMessageNow($key, $message)
{
// Create Array for this key
if (!isset($this->forNow[$key])) {
$this->forNow[$key] = [];
}
// Push onto the array
$this->forNow[$key][] = $message;
} | [
"public",
"function",
"addMessageNow",
"(",
"$",
"key",
",",
"$",
"message",
")",
"{",
"// Create Array for this key",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"forNow",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"forNow",
"[",
"... | Add flash message for current request
@param string $key The key to store the message under
@param mixed $message Message to show for the current request | [
"Add",
"flash",
"message",
"for",
"current",
"request"
] | train | https://github.com/slimphp/Slim-Flash/blob/3fa6e614ed7e399fa6234c7f709bdf56be877c99/src/Messages.php#L103-L112 |
slimphp/Slim-Flash | src/Messages.php | Messages.getMessages | public function getMessages()
{
$messages = $this->fromPrevious;
foreach ($this->forNow as $key => $values) {
if (!isset($messages[$key])) {
$messages[$key] = [];
}
foreach ($values as $value) {
array_push($messages[$key], $value)... | php | public function getMessages()
{
$messages = $this->fromPrevious;
foreach ($this->forNow as $key => $values) {
if (!isset($messages[$key])) {
$messages[$key] = [];
}
foreach ($values as $value) {
array_push($messages[$key], $value)... | [
"public",
"function",
"getMessages",
"(",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"fromPrevious",
";",
"foreach",
"(",
"$",
"this",
"->",
"forNow",
"as",
"$",
"key",
"=>",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"mess... | Get flash messages
@return array Messages to show for current request | [
"Get",
"flash",
"messages"
] | train | https://github.com/slimphp/Slim-Flash/blob/3fa6e614ed7e399fa6234c7f709bdf56be877c99/src/Messages.php#L119-L134 |
slimphp/Slim-Flash | src/Messages.php | Messages.getMessage | public function getMessage($key)
{
$messages = $this->getMessages();
// If the key exists then return all messages or null
return (isset($messages[$key])) ? $messages[$key] : null;
} | php | public function getMessage($key)
{
$messages = $this->getMessages();
// If the key exists then return all messages or null
return (isset($messages[$key])) ? $messages[$key] : null;
} | [
"public",
"function",
"getMessage",
"(",
"$",
"key",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"getMessages",
"(",
")",
";",
"// If the key exists then return all messages or null",
"return",
"(",
"isset",
"(",
"$",
"messages",
"[",
"$",
"key",
"]",
... | Get Flash Message
@param string $key The key to get the message from
@return mixed|null Returns the message | [
"Get",
"Flash",
"Message"
] | train | https://github.com/slimphp/Slim-Flash/blob/3fa6e614ed7e399fa6234c7f709bdf56be877c99/src/Messages.php#L142-L148 |
slimphp/Slim-Flash | src/Messages.php | Messages.getFirstMessage | public function getFirstMessage($key, $default = null)
{
$messages = self::getMessage($key);
if (is_array($messages) && count($messages) > 0) {
return $messages[0];
}
return $default;
} | php | public function getFirstMessage($key, $default = null)
{
$messages = self::getMessage($key);
if (is_array($messages) && count($messages) > 0) {
return $messages[0];
}
return $default;
} | [
"public",
"function",
"getFirstMessage",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"messages",
"=",
"self",
"::",
"getMessage",
"(",
"$",
"key",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"messages",
")",
"&&",
"count",
"(",
... | Get the first Flash message
@param string $key The key to get the message from
@param string $default Default value if key doesn't exist
@return mixed Returns the message | [
"Get",
"the",
"first",
"Flash",
"message"
] | train | https://github.com/slimphp/Slim-Flash/blob/3fa6e614ed7e399fa6234c7f709bdf56be877c99/src/Messages.php#L157-L165 |
slimphp/Slim-Flash | src/Messages.php | Messages.clearMessages | public function clearMessages()
{
if (isset($this->storage[$this->storageKey])) {
$this->storage[$this->storageKey] = [];
}
$this->fromPrevious = [];
$this->forNow = [];
} | php | public function clearMessages()
{
if (isset($this->storage[$this->storageKey])) {
$this->storage[$this->storageKey] = [];
}
$this->fromPrevious = [];
$this->forNow = [];
} | [
"public",
"function",
"clearMessages",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"storage",
"[",
"$",
"this",
"->",
"storageKey",
"]",
")",
")",
"{",
"$",
"this",
"->",
"storage",
"[",
"$",
"this",
"->",
"storageKey",
"]",
"=",
"["... | Clear all messages
@return void | [
"Clear",
"all",
"messages"
] | train | https://github.com/slimphp/Slim-Flash/blob/3fa6e614ed7e399fa6234c7f709bdf56be877c99/src/Messages.php#L184-L192 |
slimphp/Slim-Flash | src/Messages.php | Messages.clearMessage | public function clearMessage($key)
{
if (isset($this->storage[$this->storageKey][$key])) {
unset($this->storage[$this->storageKey][$key]);
}
if (isset($this->fromPrevious[$key])) {
unset($this->fromPrevious[$key]);
}
if (isset($this->forNow[$key])) {... | php | public function clearMessage($key)
{
if (isset($this->storage[$this->storageKey][$key])) {
unset($this->storage[$this->storageKey][$key]);
}
if (isset($this->fromPrevious[$key])) {
unset($this->fromPrevious[$key]);
}
if (isset($this->forNow[$key])) {... | [
"public",
"function",
"clearMessage",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"storage",
"[",
"$",
"this",
"->",
"storageKey",
"]",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"storage",
"[... | Clear specific message
@param String $key The key to clear
@return void | [
"Clear",
"specific",
"message"
] | train | https://github.com/slimphp/Slim-Flash/blob/3fa6e614ed7e399fa6234c7f709bdf56be877c99/src/Messages.php#L200-L213 |
Petschko/dhl-php-sdk | includes/IdentCheck.php | IdentCheck.getIdentClass_v2 | public function getIdentClass_v2() {
$class = new StdClass;
$class->surname = $this->getLastName();
$class->givenName = $this->getFirstName();
$class->dateOfBirth = $this->getBirthday();
$class->minimumAge = $this->getMinimumAge();
return $class;
} | php | public function getIdentClass_v2() {
$class = new StdClass;
$class->surname = $this->getLastName();
$class->givenName = $this->getFirstName();
$class->dateOfBirth = $this->getBirthday();
$class->minimumAge = $this->getMinimumAge();
return $class;
} | [
"public",
"function",
"getIdentClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"$",
"class",
"->",
"surname",
"=",
"$",
"this",
"->",
"getLastName",
"(",
")",
";",
"$",
"class",
"->",
"givenName",
"=",
"$",
"this",
"->",
"getFirstN... | Get the Ident-DHL-Class
@return StdClass - Ident-DHL-Class | [
"Get",
"the",
"Ident",
"-",
"DHL",
"-",
"Class"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/IdentCheck.php#L170-L178 |
Petschko/dhl-php-sdk | includes/Response.php | Response.getLabelData | public function getLabelData($index = null) {
if($index === null)
return $this->labelData;
else
return $this->labelData[$index];
} | php | public function getLabelData($index = null) {
if($index === null)
return $this->labelData;
else
return $this->labelData[$index];
} | [
"public",
"function",
"getLabelData",
"(",
"$",
"index",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"index",
"===",
"null",
")",
"return",
"$",
"this",
"->",
"labelData",
";",
"else",
"return",
"$",
"this",
"->",
"labelData",
"[",
"$",
"index",
"]",
";",... | Getter for LabelData-Objects
@param null|int $index - Index of the LabelData-Object or null for the array
@return LabelData[]|LabelData - LabelData-Object(-Array) | [
"Getter",
"for",
"LabelData",
"-",
"Objects"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Response.php#L291-L296 |
Petschko/dhl-php-sdk | includes/Response.php | Response.validateStatusCode | private function validateStatusCode() {
if($this->getStatusCode() === self::DHL_ERROR_NO_ERROR && $this->getStatusText() !== 'ok')
$this->setStatusCode(self::DHL_ERROR_WEAK_WARNING);
// Fix the DHL-Error Weak-Warning-Bug
if($this->countLabelData() === 1) {
// ALWAYS uses the Shipment-Response when only 1
... | php | private function validateStatusCode() {
if($this->getStatusCode() === self::DHL_ERROR_NO_ERROR && $this->getStatusText() !== 'ok')
$this->setStatusCode(self::DHL_ERROR_WEAK_WARNING);
// Fix the DHL-Error Weak-Warning-Bug
if($this->countLabelData() === 1) {
// ALWAYS uses the Shipment-Response when only 1
... | [
"private",
"function",
"validateStatusCode",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getStatusCode",
"(",
")",
"===",
"self",
"::",
"DHL_ERROR_NO_ERROR",
"&&",
"$",
"this",
"->",
"getStatusText",
"(",
")",
"!==",
"'ok'",
")",
"$",
"this",
"->",
"se... | Check if the current Status-Code is correct and set the correct one if not | [
"Check",
"if",
"the",
"current",
"Status",
"-",
"Code",
"is",
"correct",
"and",
"set",
"the",
"correct",
"one",
"if",
"not"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Response.php#L319-L349 |
Petschko/dhl-php-sdk | includes/Response.php | Response.handleMultiShipments | private function handleMultiShipments($possibleMultiLabelObject) {
if(is_array($possibleMultiLabelObject)) {
$multiLabelArray = $possibleMultiLabelObject;
foreach($multiLabelArray as &$singleLabel)
$this->addLabelData(new LabelData($this->getVersion(), $singleLabel));
} else
$this->addLabelData(new La... | php | private function handleMultiShipments($possibleMultiLabelObject) {
if(is_array($possibleMultiLabelObject)) {
$multiLabelArray = $possibleMultiLabelObject;
foreach($multiLabelArray as &$singleLabel)
$this->addLabelData(new LabelData($this->getVersion(), $singleLabel));
} else
$this->addLabelData(new La... | [
"private",
"function",
"handleMultiShipments",
"(",
"$",
"possibleMultiLabelObject",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"possibleMultiLabelObject",
")",
")",
"{",
"$",
"multiLabelArray",
"=",
"$",
"possibleMultiLabelObject",
";",
"foreach",
"(",
"$",
"mult... | Handles all Multi-Shipment Object/Arrays and add them to Label-Data
@param Object|array $possibleMultiLabelObject - Object or array, which should be added to LabelData | [
"Handles",
"all",
"Multi",
"-",
"Shipment",
"Object",
"/",
"Arrays",
"and",
"add",
"them",
"to",
"Label",
"-",
"Data"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Response.php#L368-L376 |
Petschko/dhl-php-sdk | includes/Response.php | Response.loadResponse_v2 | private function loadResponse_v2($response) {
// Set global Status-Values first
if(isset($response->Status)) {
if(isset($response->Status->statusCode))
$this->setStatusCode((int) $response->Status->statusCode);
if(isset($response->Status->statusText)) {
if(is_array($response->Status->statusText))
... | php | private function loadResponse_v2($response) {
// Set global Status-Values first
if(isset($response->Status)) {
if(isset($response->Status->statusCode))
$this->setStatusCode((int) $response->Status->statusCode);
if(isset($response->Status->statusText)) {
if(is_array($response->Status->statusText))
... | [
"private",
"function",
"loadResponse_v2",
"(",
"$",
"response",
")",
"{",
"// Set global Status-Values first",
"if",
"(",
"isset",
"(",
"$",
"response",
"->",
"Status",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"response",
"->",
"Status",
"->",
"statusCod... | Loads a DHL-Response into this Object
@param Object $response - DHL-Response | [
"Loads",
"a",
"DHL",
"-",
"Response",
"into",
"this",
"Object"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Response.php#L383-L435 |
Petschko/dhl-php-sdk | includes/Version.php | Version.setVersion | protected function setVersion($version) {
$this->version = $version;
$numbers = explode('.', $version);
// Update Mayor and Minor-Version-Numbers
$this->setMayor((int) $numbers[0]);
$this->setMinor((int) $numbers[1]);
} | php | protected function setVersion($version) {
$this->version = $version;
$numbers = explode('.', $version);
// Update Mayor and Minor-Version-Numbers
$this->setMayor((int) $numbers[0]);
$this->setMinor((int) $numbers[1]);
} | [
"protected",
"function",
"setVersion",
"(",
"$",
"version",
")",
"{",
"$",
"this",
"->",
"version",
"=",
"$",
"version",
";",
"$",
"numbers",
"=",
"explode",
"(",
"'.'",
",",
"$",
"version",
")",
";",
"// Update Mayor and Minor-Version-Numbers",
"$",
"this",... | Set/Change the Version and also Update Mayor and Minor-Fields
@param string $version - Version | [
"Set",
"/",
"Change",
"the",
"Version",
"and",
"also",
"Update",
"Mayor",
"and",
"Minor",
"-",
"Fields"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Version.php#L75-L83 |
Petschko/dhl-php-sdk | includes/ReturnReceiver.php | ReturnReceiver.getClass_v2 | public function getClass_v2() {
$class = new StdClass;
// Name
$class->Name = new StdClass;
$class->Name->name1 = $this->getName();
if($this->getName2() !== null)
$class->Name->name2 = $this->getName2();
if($this->getName3() !== null)
$class->Name->name3 = $this->getName3();
// Address
$class->A... | php | public function getClass_v2() {
$class = new StdClass;
// Name
$class->Name = new StdClass;
$class->Name->name1 = $this->getName();
if($this->getName2() !== null)
$class->Name->name2 = $this->getName2();
if($this->getName3() !== null)
$class->Name->name3 = $this->getName3();
// Address
$class->A... | [
"public",
"function",
"getClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"// Name",
"$",
"class",
"->",
"Name",
"=",
"new",
"StdClass",
";",
"$",
"class",
"->",
"Name",
"->",
"name1",
"=",
"$",
"this",
"->",
"getName",
"(",
")",... | Returns a Class for the DHL-SendPerson
@return StdClass - DHL-SendPerson-class | [
"Returns",
"a",
"Class",
"for",
"the",
"DHL",
"-",
"SendPerson"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ReturnReceiver.php#L29-L71 |
Petschko/dhl-php-sdk | includes/ExportDocPosition.php | ExportDocPosition.getExportDocPositionClass_v2 | public function getExportDocPositionClass_v2() {
$class = new StdClass;
$class->description = $this->getDescription();
$class->countryCodeOrigin = $this->getCountryCodeOrigin();
$class->customsTariffNumber = $this->getCustomsTariffNumber();
$class->amount = $this->getAmount();
$class->netWeightInKG = $this... | php | public function getExportDocPositionClass_v2() {
$class = new StdClass;
$class->description = $this->getDescription();
$class->countryCodeOrigin = $this->getCountryCodeOrigin();
$class->customsTariffNumber = $this->getCustomsTariffNumber();
$class->amount = $this->getAmount();
$class->netWeightInKG = $this... | [
"public",
"function",
"getExportDocPositionClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"$",
"class",
"->",
"description",
"=",
"$",
"this",
"->",
"getDescription",
"(",
")",
";",
"$",
"class",
"->",
"countryCodeOrigin",
"=",
"$",
"... | Returns a Class for ExportDocPosition
@return StdClass - DHL-ExportDocPosition-Class | [
"Returns",
"a",
"Class",
"for",
"ExportDocPosition"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ExportDocPosition.php#L245-L256 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getAPIUrl | protected function getAPIUrl() {
// Use own API-URL if set
if($this->getCustomAPIURL() !== null)
return $this->getCustomAPIURL();
return self::DHL_WSDL_LIB_URL . $this->getVersion() . '/geschaeftskundenversand-api-' . $this->getVersion() . '.wsdl';
} | php | protected function getAPIUrl() {
// Use own API-URL if set
if($this->getCustomAPIURL() !== null)
return $this->getCustomAPIURL();
return self::DHL_WSDL_LIB_URL . $this->getVersion() . '/geschaeftskundenversand-api-' . $this->getVersion() . '.wsdl';
} | [
"protected",
"function",
"getAPIUrl",
"(",
")",
"{",
"// Use own API-URL if set",
"if",
"(",
"$",
"this",
"->",
"getCustomAPIURL",
"(",
")",
"!==",
"null",
")",
"return",
"$",
"this",
"->",
"getCustomAPIURL",
"(",
")",
";",
"return",
"self",
"::",
"DHL_WSDL_... | Get the Business-API-URL for this Version
@return string - Business-API-URL | [
"Get",
"the",
"Business",
"-",
"API",
"-",
"URL",
"for",
"this",
"Version"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L300-L306 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.setShipmentOrders | public function setShipmentOrders($shipmentOrders) {
if(! is_array($shipmentOrders)) {
trigger_error(
'[DHL-PHP-SDK]: The type of $shipmentOrders is NOT an array, but is required to set as array! Called method ' .
__METHOD__ . ' in class ' . __CLASS__,
E_USER_ERROR
);
$this->addError(__METHOD__ .... | php | public function setShipmentOrders($shipmentOrders) {
if(! is_array($shipmentOrders)) {
trigger_error(
'[DHL-PHP-SDK]: The type of $shipmentOrders is NOT an array, but is required to set as array! Called method ' .
__METHOD__ . ' in class ' . __CLASS__,
E_USER_ERROR
);
$this->addError(__METHOD__ .... | [
"public",
"function",
"setShipmentOrders",
"(",
"$",
"shipmentOrders",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"shipmentOrders",
")",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: The type of $shipmentOrders is NOT an array, but is required to set as array! Called ... | Set the list with all Shipment-Orders Objects
@param ShipmentOrder[]|ShipmentOrder $shipmentOrders - Shipment-Order Object-Array or a Single Shipment-Order Object | [
"Set",
"the",
"list",
"with",
"all",
"Shipment",
"-",
"Orders",
"Objects"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L842-L855 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.checkRequestCount | private function checkRequestCount($array, $action, $maxReq = self::MAX_DHL_REQUESTS) {
$count = count($array);
if($count > self::MAX_DHL_REQUESTS)
$this->addError('There are only ' . $maxReq . ' Request/s for one call allowed for the action "'
. $action . '"! You tried to request ' . $count . ' ones');
} | php | private function checkRequestCount($array, $action, $maxReq = self::MAX_DHL_REQUESTS) {
$count = count($array);
if($count > self::MAX_DHL_REQUESTS)
$this->addError('There are only ' . $maxReq . ' Request/s for one call allowed for the action "'
. $action . '"! You tried to request ' . $count . ' ones');
} | [
"private",
"function",
"checkRequestCount",
"(",
"$",
"array",
",",
"$",
"action",
",",
"$",
"maxReq",
"=",
"self",
"::",
"MAX_DHL_REQUESTS",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"array",
")",
";",
"if",
"(",
"$",
"count",
">",
"self",
"::... | Check if the request-Array is to long
@param array $array - Array to check
@param string $action - Action of the request
@param int $maxReq - Maximum-Requests - Default: self::MAX_DHL_REQUESTS | [
"Check",
"if",
"the",
"request",
"-",
"Array",
"is",
"to",
"long"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L907-L913 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.buildAuthHeader | private function buildAuthHeader() {
$auth_params = array(
'user' => $this->getCredentials()->getUser(),
'signature' => $this->getCredentials()->getSignature(),
'type' => 0
);
return new SoapHeader(self::DHL_SOAP_HEADER_URI, 'Authentification', $auth_params);
} | php | private function buildAuthHeader() {
$auth_params = array(
'user' => $this->getCredentials()->getUser(),
'signature' => $this->getCredentials()->getSignature(),
'type' => 0
);
return new SoapHeader(self::DHL_SOAP_HEADER_URI, 'Authentification', $auth_params);
} | [
"private",
"function",
"buildAuthHeader",
"(",
")",
"{",
"$",
"auth_params",
"=",
"array",
"(",
"'user'",
"=>",
"$",
"this",
"->",
"getCredentials",
"(",
")",
"->",
"getUser",
"(",
")",
",",
"'signature'",
"=>",
"$",
"this",
"->",
"getCredentials",
"(",
... | Build SOAP-Auth-Header
@return SoapHeader - Soap-Auth-Header | [
"Build",
"SOAP",
"-",
"Auth",
"-",
"Header"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L920-L928 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.buildSoapClient | private function buildSoapClient() {
$header = $this->buildAuthHeader();
if($this->isTest())
$location = self::DHL_SANDBOX_URL;
else
$location = self::DHL_PRODUCTION_URL;
$auth_params = array(
'login' => $this->getCredentials()->getApiUser(),
'password' => $this->getCredentials()->getApiPassword()... | php | private function buildSoapClient() {
$header = $this->buildAuthHeader();
if($this->isTest())
$location = self::DHL_SANDBOX_URL;
else
$location = self::DHL_PRODUCTION_URL;
$auth_params = array(
'login' => $this->getCredentials()->getApiUser(),
'password' => $this->getCredentials()->getApiPassword()... | [
"private",
"function",
"buildSoapClient",
"(",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"buildAuthHeader",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isTest",
"(",
")",
")",
"$",
"location",
"=",
"self",
"::",
"DHL_SANDBOX_URL",
";",
"else",... | Builds the Soap-Client | [
"Builds",
"the",
"Soap",
"-",
"Client"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L933-L950 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getVersion | public function getVersion($viaSOAP = false, $getBuildNumber = false, $returnAsArray = false) {
if(! $viaSOAP) {
if($returnAsArray)
return array(
'mayor' => parent::getMayor(),
'minor' => parent::getMinor()
);
else
return parent::getVersion();
}
switch($this->getMayor()) {
case 1:
... | php | public function getVersion($viaSOAP = false, $getBuildNumber = false, $returnAsArray = false) {
if(! $viaSOAP) {
if($returnAsArray)
return array(
'mayor' => parent::getMayor(),
'minor' => parent::getMinor()
);
else
return parent::getVersion();
}
switch($this->getMayor()) {
case 1:
... | [
"public",
"function",
"getVersion",
"(",
"$",
"viaSOAP",
"=",
"false",
",",
"$",
"getBuildNumber",
"=",
"false",
",",
"$",
"returnAsArray",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"viaSOAP",
")",
"{",
"if",
"(",
"$",
"returnAsArray",
")",
"return"... | Gets the current (local)-Version or Request it via SOAP from DHL
@param bool $viaSOAP - Request the Version from DHL (Default: false - get local-version as string)
@param bool $getBuildNumber - Return the Build number as well (String look then like this: 2.2.12) Only possible via SOAP - Default false
@param bool $retu... | [
"Gets",
"the",
"current",
"(",
"local",
")",
"-",
"Version",
"or",
"Request",
"it",
"via",
"SOAP",
"from",
"DHL"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L960-L1005 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.sendDoManifestRequest | private function sendDoManifestRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->DoManifestTD($data);
case 2:
default:
return $this->getSoapClient()->doManifest($data);
}
} | php | private function sendDoManifestRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->DoManifestTD($data);
case 2:
default:
return $this->getSoapClient()->doManifest($data);
}
} | [
"private",
"function",
"sendDoManifestRequest",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"return",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"DoManifestTD",
"(",
"$",
"dat... | Creates the doManifest-Request via SOAP
@param Object|array $data - Manifest-Data
@return Object - DHL-Response | [
"Creates",
"the",
"doManifest",
"-",
"Request",
"via",
"SOAP"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1023-L1031 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.doManifest | public function doManifest($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->createDoManifestClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->createDoManifestClass_v2($shipmentNumbers);
}
try {
$response = $this->sendDoManifestRequest($data);
} cat... | php | public function doManifest($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->createDoManifestClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->createDoManifestClass_v2($shipmentNumbers);
}
try {
$response = $this->sendDoManifestRequest($data);
} cat... | [
"public",
"function",
"doManifest",
"(",
"$",
"shipmentNumbers",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"$",
"data",
"=",
"$",
"this",
"->",
"createDoManifestClass_v1",
"(",
"$",
"shipmentNumbers",
"... | Creates the doManifest-Request
@param string|string[] $shipmentNumbers - Shipment-Number(s) for Manifest (up to 30 Numbers)
@return bool|Response - false on error or DHL-Response Object | [
"Creates",
"the",
"doManifest",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1039-L1063 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createDoManifestClass_v1 | private function createDoManifestClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USE... | php | private function createDoManifestClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USE... | [
"private",
"function",
"createDoManifestClass_v1",
"(",
"$",
"shipmentNumbers",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method '",
".",
"__METHOD__",
".",
"')!'",
",",
"E_USER_DEPRECATED",
")",
";",
"trigge... | Creates the Data-Object for Manifest
@param string|string[] $shipmentNumbers - Shipment-Number(s) for the Manifest (up to 30 Numbers)
@return StdClass - Data-Object
@deprecated - DHL-API-Version 1 Method | [
"Creates",
"the",
"Data",
"-",
"Object",
"for",
"Manifest"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1073-L1080 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getManifest | public function getManifest($manifestDate, $useIntTime = false) {
if($useIntTime) {
// Convert to Date-Format for DHL
$oldDate = $manifestDate;
$manifestDate = date('Y-m-d', $manifestDate);
if($manifestDate === false) {
$this->addError('Could not convert given time() value "' . $oldDate . '" to YYYY-... | php | public function getManifest($manifestDate, $useIntTime = false) {
if($useIntTime) {
// Convert to Date-Format for DHL
$oldDate = $manifestDate;
$manifestDate = date('Y-m-d', $manifestDate);
if($manifestDate === false) {
$this->addError('Could not convert given time() value "' . $oldDate . '" to YYYY-... | [
"public",
"function",
"getManifest",
"(",
"$",
"manifestDate",
",",
"$",
"useIntTime",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"useIntTime",
")",
"{",
"// Convert to Date-Format for DHL",
"$",
"oldDate",
"=",
"$",
"manifestDate",
";",
"$",
"manifestDate",
"=",... | Creates the getManifest-Request
@param string|int $manifestDate - Manifest-Date as String (YYYY-MM-DD) or the int time() value of the date
@param bool $useIntTime - Use the int Time Value instead of a String
@return bool|Response - false on error or DHL-Response Object | [
"Creates",
"the",
"getManifest",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1111-L1151 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createGetManifestClass_v2 | private function createGetManifestClass_v2($manifestDate) {
$data = new StdClass;
if(is_array($manifestDate))
$this->addError('You can only request 1 date on getManifest - multiple requests in 1 call are not allowed here');
$data->Version = $this->getVersionClass();
$data->manifestDate = $manifestDate;
... | php | private function createGetManifestClass_v2($manifestDate) {
$data = new StdClass;
if(is_array($manifestDate))
$this->addError('You can only request 1 date on getManifest - multiple requests in 1 call are not allowed here');
$data->Version = $this->getVersionClass();
$data->manifestDate = $manifestDate;
... | [
"private",
"function",
"createGetManifestClass_v2",
"(",
"$",
"manifestDate",
")",
"{",
"$",
"data",
"=",
"new",
"StdClass",
";",
"if",
"(",
"is_array",
"(",
"$",
"manifestDate",
")",
")",
"$",
"this",
"->",
"addError",
"(",
"'You can only request 1 date on getM... | Creates the Data-Object for getManifest
@param string $manifestDate - Manifest Date (String-Format: YYYY-MM-DD)
@return StdClass - Data-Object | [
"Creates",
"the",
"Data",
"-",
"Object",
"for",
"getManifest"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1159-L1169 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.sendCreateRequest | private function sendCreateRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->CreateShipmentDD($data);
case 2:
default:
return $this->getSoapClient()->createShipmentOrder($data);
}
} | php | private function sendCreateRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->CreateShipmentDD($data);
case 2:
default:
return $this->getSoapClient()->createShipmentOrder($data);
}
} | [
"private",
"function",
"sendCreateRequest",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"return",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"CreateShipmentDD",
"(",
"$",
"dat... | Creates the Shipment-Order Request via SOAP
@param Object|array $data - Shipment-Data
@return Object - DHL-Response | [
"Creates",
"the",
"Shipment",
"-",
"Order",
"Request",
"via",
"SOAP"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1187-L1195 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createShipmentOrder | public function createShipmentOrder() {
switch($this->getMayor()) {
case 1:
$data = $this->createShipmentClass_v1();
break;
case 2:
default:
if($this->countShipmentOrders() < 1)
$data = $this->createShipmentClass_v2_legacy();
else
$data = $this->createShipmentClass_v2();
}
$res... | php | public function createShipmentOrder() {
switch($this->getMayor()) {
case 1:
$data = $this->createShipmentClass_v1();
break;
case 2:
default:
if($this->countShipmentOrders() < 1)
$data = $this->createShipmentClass_v2_legacy();
else
$data = $this->createShipmentClass_v2();
}
$res... | [
"public",
"function",
"createShipmentOrder",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"$",
"data",
"=",
"$",
"this",
"->",
"createShipmentClass_v1",
"(",
")",
";",
"break",
";",
"case",
"2",
"... | Creates the Shipment-Request
@return bool|Response - false on error or DHL-Response Object | [
"Creates",
"the",
"Shipment",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1213-L1243 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createShipmentClass_v1 | private function createShipmentClass_v1() {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WARNING);
$da... | php | private function createShipmentClass_v1() {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WARNING);
$da... | [
"private",
"function",
"createShipmentClass_v1",
"(",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method '",
".",
"__METHOD__",
".",
"')!'",
",",
"E_USER_DEPRECATED",
")",
";",
"trigger_error",
"(",
"'[DHL-PHP-... | Creates the Data-Object for the Request
@return StdClass - Data-Object
@deprecated - DHL-API-Version 1 Method | [
"Creates",
"the",
"Data",
"-",
"Object",
"for",
"the",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1252-L1259 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createShipmentClass_v2 | private function createShipmentClass_v2($shipmentNumber = null) {
$shipmentOrders = $this->getShipmentOrders();
$this->checkRequestCount($shipmentOrders, 'createShipmentClass');
$data = new StdClass;
$data->Version = $this->getVersionClass();
if($shipmentNumber !== null)
$data->shipmentNumber = (string)... | php | private function createShipmentClass_v2($shipmentNumber = null) {
$shipmentOrders = $this->getShipmentOrders();
$this->checkRequestCount($shipmentOrders, 'createShipmentClass');
$data = new StdClass;
$data->Version = $this->getVersionClass();
if($shipmentNumber !== null)
$data->shipmentNumber = (string)... | [
"private",
"function",
"createShipmentClass_v2",
"(",
"$",
"shipmentNumber",
"=",
"null",
")",
"{",
"$",
"shipmentOrders",
"=",
"$",
"this",
"->",
"getShipmentOrders",
"(",
")",
";",
"$",
"this",
"->",
"checkRequestCount",
"(",
"$",
"shipmentOrders",
",",
"'cr... | Creates the Data-Object for the Request
@param null|string $shipmentNumber - Shipment Number which should be included or null for none
@return StdClass - Data-Object | [
"Creates",
"the",
"Data",
"-",
"Object",
"for",
"the",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1267-L1290 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createShipmentClass_v2_legacy | private function createShipmentClass_v2_legacy($shipmentNumber = null) {
trigger_error(
'[DHL-PHP-SDK]: ' . __CLASS__ . '->' . __METHOD__ .
' This method was called for Backward-Compatibility, please create `ShipmentOrder` Objects' .
' and assign them with `addShipmentOrder($shipmentOrder)` on this instance.... | php | private function createShipmentClass_v2_legacy($shipmentNumber = null) {
trigger_error(
'[DHL-PHP-SDK]: ' . __CLASS__ . '->' . __METHOD__ .
' This method was called for Backward-Compatibility, please create `ShipmentOrder` Objects' .
' and assign them with `addShipmentOrder($shipmentOrder)` on this instance.... | [
"private",
"function",
"createShipmentClass_v2_legacy",
"(",
"$",
"shipmentNumber",
"=",
"null",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: '",
".",
"__CLASS__",
".",
"'->'",
".",
"__METHOD__",
".",
"' This method was called for Backward-Compatibility, please create `Sh... | Creates the Data-Object for the Request
@param null|string $shipmentNumber - Shipment Number which should be included or null for none
@return StdClass - Data-Object
@deprecated - Old Shipment creation class (Supports only 1 Shipment) | [
"Creates",
"the",
"Data",
"-",
"Object",
"for",
"the",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1300-L1364 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.sendDeleteRequest | private function sendDeleteRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->DeleteShipmentDD($data);
case 2:
default:
return $this->getSoapClient()->deleteShipmentOrder($data);
}
} | php | private function sendDeleteRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->DeleteShipmentDD($data);
case 2:
default:
return $this->getSoapClient()->deleteShipmentOrder($data);
}
} | [
"private",
"function",
"sendDeleteRequest",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"return",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"DeleteShipmentDD",
"(",
"$",
"dat... | Creates the Shipment-Order-Delete Request via SOAP
@param Object|array $data - Delete-Data
@return Object - DHL-Response | [
"Creates",
"the",
"Shipment",
"-",
"Order",
"-",
"Delete",
"Request",
"via",
"SOAP"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1372-L1380 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.deleteShipmentOrder | public function deleteShipmentOrder($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->createDeleteClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->createDeleteClass_v2($shipmentNumbers);
}
try {
$response = $this->sendDeleteRequest($data);
} catch(... | php | public function deleteShipmentOrder($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->createDeleteClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->createDeleteClass_v2($shipmentNumbers);
}
try {
$response = $this->sendDeleteRequest($data);
} catch(... | [
"public",
"function",
"deleteShipmentOrder",
"(",
"$",
"shipmentNumbers",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"$",
"data",
"=",
"$",
"this",
"->",
"createDeleteClass_v1",
"(",
"$",
"shipmentNumbers"... | Deletes a Shipment
@param string|string[] $shipmentNumbers - Shipment-Number(s) of the Shipment(s) to delete (up to 30 Numbers)
@return bool|Response - Response | [
"Deletes",
"a",
"Shipment"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1400-L1424 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createDeleteClass_v1 | private function createDeleteClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WA... | php | private function createDeleteClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WA... | [
"private",
"function",
"createDeleteClass_v1",
"(",
"$",
"shipmentNumbers",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method '",
".",
"__METHOD__",
".",
"')!'",
",",
"E_USER_DEPRECATED",
")",
";",
"trigger_er... | Creates Data-Object for Deletion
@param string|string[] $shipmentNumbers - Shipment-Number(s) of the Shipment(s) to delete (up to 30 Numbers)
@return StdClass - Data-Object
@deprecated - DHL-API-Version 1 Method | [
"Creates",
"Data",
"-",
"Object",
"for",
"Deletion"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1434-L1441 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.createDeleteClass_v2 | private function createDeleteClass_v2($shipmentNumbers) {
$data = new StdClass;
$data->Version = $this->getVersionClass();
if(is_array($shipmentNumbers)) {
$this->checkRequestCount($shipmentNumbers, 'deleteShipmentOrder');
foreach($shipmentNumbers as $key => &$number)
$data->shipmentNumber[$key] = $n... | php | private function createDeleteClass_v2($shipmentNumbers) {
$data = new StdClass;
$data->Version = $this->getVersionClass();
if(is_array($shipmentNumbers)) {
$this->checkRequestCount($shipmentNumbers, 'deleteShipmentOrder');
foreach($shipmentNumbers as $key => &$number)
$data->shipmentNumber[$key] = $n... | [
"private",
"function",
"createDeleteClass_v2",
"(",
"$",
"shipmentNumbers",
")",
"{",
"$",
"data",
"=",
"new",
"StdClass",
";",
"$",
"data",
"->",
"Version",
"=",
"$",
"this",
"->",
"getVersionClass",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"ship... | Creates Data-Object for Deletion
@param string|string[] $shipmentNumbers - Shipment-Number(s) of the Shipment(s) to delete (up to 30 Numbers)
@return StdClass - Data-Object | [
"Creates",
"Data",
"-",
"Object",
"for",
"Deletion"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1449-L1463 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.sendGetLabelRequest | private function sendGetLabelRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->getLabelDD($data);
case 2:
default:
return $this->getSoapClient()->getLabel($data);
}
} | php | private function sendGetLabelRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->getLabelDD($data);
case 2:
default:
return $this->getSoapClient()->getLabel($data);
}
} | [
"private",
"function",
"sendGetLabelRequest",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"return",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"getLabelDD",
"(",
"$",
"data",
... | Requests a Label again via SOAP
@param Object $data - Label-Data
@return Object - DHL-Response | [
"Requests",
"a",
"Label",
"again",
"via",
"SOAP"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1471-L1479 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getLabel | public function getLabel($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->getLabelClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->getLabelClass_v2($shipmentNumbers);
}
try {
$response = $this->sendGetLabelRequest($data);
} catch(Exception $e) {
... | php | public function getLabel($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->getLabelClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->getLabelClass_v2($shipmentNumbers);
}
try {
$response = $this->sendGetLabelRequest($data);
} catch(Exception $e) {
... | [
"public",
"function",
"getLabel",
"(",
"$",
"shipmentNumbers",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"$",
"data",
"=",
"$",
"this",
"->",
"getLabelClass_v1",
"(",
"$",
"shipmentNumbers",
")",
";",... | Requests a Shipment-Label again
@param string|string[] $shipmentNumbers - Shipment-Number(s) of the Label(s) (up to 30 Numbers)
@return bool|Response - Response or false on error | [
"Requests",
"a",
"Shipment",
"-",
"Label",
"again"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1499-L1523 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getLabelClass_v1 | private function getLabelClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WARNIN... | php | private function getLabelClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WARNIN... | [
"private",
"function",
"getLabelClass_v1",
"(",
"$",
"shipmentNumbers",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method '",
".",
"__METHOD__",
".",
"')!'",
",",
"E_USER_DEPRECATED",
")",
";",
"trigger_error"... | Creates Data-Object for Label-Request
@param string|string[] $shipmentNumbers - Number(s) of the Shipment(s) (up to 30 Numbers)
@return StdClass - Data-Object
@deprecated - DHL-API-Version 1 Method | [
"Creates",
"Data",
"-",
"Object",
"for",
"Label",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1533-L1540 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getLabelClass_v2 | private function getLabelClass_v2($shipmentNumbers) {
$data = new StdClass;
$data->Version = $this->getVersionClass();
if(is_array($shipmentNumbers)) {
$this->checkRequestCount($shipmentNumbers, 'getLabel');
foreach($shipmentNumbers as $key => &$number)
$data->shipmentNumber[$key] = $number;
} else... | php | private function getLabelClass_v2($shipmentNumbers) {
$data = new StdClass;
$data->Version = $this->getVersionClass();
if(is_array($shipmentNumbers)) {
$this->checkRequestCount($shipmentNumbers, 'getLabel');
foreach($shipmentNumbers as $key => &$number)
$data->shipmentNumber[$key] = $number;
} else... | [
"private",
"function",
"getLabelClass_v2",
"(",
"$",
"shipmentNumbers",
")",
"{",
"$",
"data",
"=",
"new",
"StdClass",
";",
"$",
"data",
"->",
"Version",
"=",
"$",
"this",
"->",
"getVersionClass",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"shipment... | Creates Data-Object for Label-Request
@param string|string[] $shipmentNumbers - Number(s) of the Shipment(s) (up to 30 Numbers)
@return StdClass - Data-Object | [
"Creates",
"Data",
"-",
"Object",
"for",
"Label",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1548-L1565 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.sendGetExportDocRequest | private function sendGetExportDocRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->getExportDocDD($data);
case 2:
default:
return $this->getSoapClient()->getExportDoc($data);
}
} | php | private function sendGetExportDocRequest($data) {
switch($this->getMayor()) {
case 1:
return $this->getSoapClient()->getExportDocDD($data);
case 2:
default:
return $this->getSoapClient()->getExportDoc($data);
}
} | [
"private",
"function",
"sendGetExportDocRequest",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"return",
"$",
"this",
"->",
"getSoapClient",
"(",
")",
"->",
"getExportDocDD",
"(",
"$",
... | Requests the Export-Document again via SOAP
@param Object $data - Export-Doc-Data
@return Object - DHL-Response | [
"Requests",
"the",
"Export",
"-",
"Document",
"again",
"via",
"SOAP"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1573-L1581 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getExportDoc | public function getExportDoc($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->getExportDocClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->getExportDocClass_v2($shipmentNumbers);
}
try {
$response = $this->sendGetExportDocRequest($data);
} catch(E... | php | public function getExportDoc($shipmentNumbers) {
switch($this->getMayor()) {
case 1:
$data = $this->getExportDocClass_v1($shipmentNumbers);
break;
case 2:
default:
$data = $this->getExportDocClass_v2($shipmentNumbers);
}
try {
$response = $this->sendGetExportDocRequest($data);
} catch(E... | [
"public",
"function",
"getExportDoc",
"(",
"$",
"shipmentNumbers",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"$",
"data",
"=",
"$",
"this",
"->",
"getExportDocClass_v1",
"(",
"$",
"shipmentNumbers",
")"... | Requests a Export-Document again
@param string|string[] $shipmentNumbers - Shipment-Number(s) of the Export-Document(s) (up to 30 Numbers)
@return bool|Response - Response or false on error | [
"Requests",
"a",
"Export",
"-",
"Document",
"again"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1589-L1613 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getExportDocClass_v1 | private function getExportDocClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WA... | php | private function getExportDocClass_v1($shipmentNumbers) {
trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WA... | [
"private",
"function",
"getExportDocClass_v1",
"(",
"$",
"shipmentNumbers",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method '",
".",
"__METHOD__",
".",
"')!'",
",",
"E_USER_DEPRECATED",
")",
";",
"trigger_er... | Creates Data-Object for Export-Document-Request
@param string|string[] $shipmentNumbers - Number(s) of the Shipment(s) (up to 30 Numbers)
@return StdClass - Data-Object
@deprecated - DHL-API-Version 1 Method | [
"Creates",
"Data",
"-",
"Object",
"for",
"Export",
"-",
"Document",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1623-L1630 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.getExportDocClass_v2 | private function getExportDocClass_v2($shipmentNumbers) {
$data = new StdClass;
$data->Version = $this->getVersionClass();
if(is_array($shipmentNumbers)) {
$this->checkRequestCount($shipmentNumbers, 'getExportDoc');
foreach($shipmentNumbers as $key => &$number)
$data->shipmentNumber[$key] = $number;
... | php | private function getExportDocClass_v2($shipmentNumbers) {
$data = new StdClass;
$data->Version = $this->getVersionClass();
if(is_array($shipmentNumbers)) {
$this->checkRequestCount($shipmentNumbers, 'getExportDoc');
foreach($shipmentNumbers as $key => &$number)
$data->shipmentNumber[$key] = $number;
... | [
"private",
"function",
"getExportDocClass_v2",
"(",
"$",
"shipmentNumbers",
")",
"{",
"$",
"data",
"=",
"new",
"StdClass",
";",
"$",
"data",
"->",
"Version",
"=",
"$",
"this",
"->",
"getVersionClass",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"ship... | Creates Data-Object for Export-Document-Request
@param string|string[] $shipmentNumbers - Number(s) of the Shipment(s) (up to 30 Numbers)
@return StdClass - Data-Object | [
"Creates",
"Data",
"-",
"Object",
"for",
"Export",
"-",
"Document",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1638-L1655 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.validateShipment | public function validateShipment() {
switch($this->getMayor()) {
case 1:
$data = null;
break;
case 2:
default:
$data = $this->createShipmentClass_v2();
}
try {
$response = $this->sendValidateShipmentRequest($data);
} catch(Exception $e) {
$this->addError($e->getMessage());
return... | php | public function validateShipment() {
switch($this->getMayor()) {
case 1:
$data = null;
break;
case 2:
default:
$data = $this->createShipmentClass_v2();
}
try {
$response = $this->sendValidateShipmentRequest($data);
} catch(Exception $e) {
$this->addError($e->getMessage());
return... | [
"public",
"function",
"validateShipment",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"$",
"data",
"=",
"null",
";",
"break",
";",
"case",
"2",
":",
"default",
":",
"$",
"data",
"=",
"$",
"th... | Validates a Shipment
@return bool|Response - Response or false on error | [
"Validates",
"a",
"Shipment"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1662-L1686 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.sendValidateShipmentRequest | private function sendValidateShipmentRequest($data) {
switch($this->getMayor()) {
case 1:
throw new Exception(__FUNCTION__ . ': Method doesn\'t exists for Version 1!');
case 2:
default:
return $this->getSoapClient()->validateShipment($data);
}
} | php | private function sendValidateShipmentRequest($data) {
switch($this->getMayor()) {
case 1:
throw new Exception(__FUNCTION__ . ': Method doesn\'t exists for Version 1!');
case 2:
default:
return $this->getSoapClient()->validateShipment($data);
}
} | [
"private",
"function",
"sendValidateShipmentRequest",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"throw",
"new",
"Exception",
"(",
"__FUNCTION__",
".",
"': Method doesn\\'t exists for Version 1... | Requests the Validation of a Shipment via SOAP
@param Object|array $data - Shipment-Data
@return Object - DHL-Response
@throws Exception - Method doesn't exists for Version | [
"Requests",
"the",
"Validation",
"of",
"a",
"Shipment",
"via",
"SOAP"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1695-L1703 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.updateShipmentOrder | public function updateShipmentOrder($shipmentNumber) {
if(is_array($shipmentNumber) || $this->countShipmentOrders() > 1) {
$this->addError(__FUNCTION__ . ': Updating Shipments is a Single-Operation only!');
return false;
}
switch($this->getMayor()) {
case 1:
$data = null;
break;
case 2:
d... | php | public function updateShipmentOrder($shipmentNumber) {
if(is_array($shipmentNumber) || $this->countShipmentOrders() > 1) {
$this->addError(__FUNCTION__ . ': Updating Shipments is a Single-Operation only!');
return false;
}
switch($this->getMayor()) {
case 1:
$data = null;
break;
case 2:
d... | [
"public",
"function",
"updateShipmentOrder",
"(",
"$",
"shipmentNumber",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"shipmentNumber",
")",
"||",
"$",
"this",
"->",
"countShipmentOrders",
"(",
")",
">",
"1",
")",
"{",
"$",
"this",
"->",
"addError",
"(",
"... | Updates the Shipment-Request
@param string $shipmentNumber - Number of the Shipment, which should be updated
@return bool|Response - false on error or DHL-Response Object | [
"Updates",
"the",
"Shipment",
"-",
"Request"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1711-L1747 |
Petschko/dhl-php-sdk | includes/BusinessShipment.php | BusinessShipment.sendUpdateRequest | private function sendUpdateRequest($data) {
switch($this->getMayor()) {
case 1:
throw new Exception(__FUNCTION__ . ': Method doesn\'t exists for Version 1!');
case 2:
default:
return $this->getSoapClient()->updateShipmentOrder($data);
}
} | php | private function sendUpdateRequest($data) {
switch($this->getMayor()) {
case 1:
throw new Exception(__FUNCTION__ . ': Method doesn\'t exists for Version 1!');
case 2:
default:
return $this->getSoapClient()->updateShipmentOrder($data);
}
} | [
"private",
"function",
"sendUpdateRequest",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getMayor",
"(",
")",
")",
"{",
"case",
"1",
":",
"throw",
"new",
"Exception",
"(",
"__FUNCTION__",
".",
"': Method doesn\\'t exists for Version 1!'",
")"... | Requests the Update of a Shipment via SOAP
@param Object|array $data - Shipment-Data
@return Object - DHL-Response
@throws Exception - Method doesn't exists for Version | [
"Requests",
"the",
"Update",
"of",
"a",
"Shipment",
"via",
"SOAP"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BusinessShipment.php#L1756-L1764 |
Petschko/dhl-php-sdk | includes/ProductInfo.php | ProductInfo.init | private static function init() {
self::setInit(true);
// Initiates Products
$obj = new Product(ShipmentDetails::PRODUCT_TYPE_NATIONAL_PACKAGE);
$obj->setName('DHL Paket');
$obj->setMinLength(15);
$obj->setMaxLength(200);
$obj->setMinWidth(11);
$obj->setMaxWidth(200);
$obj->setMinHeight(1);
$obj->se... | php | private static function init() {
self::setInit(true);
// Initiates Products
$obj = new Product(ShipmentDetails::PRODUCT_TYPE_NATIONAL_PACKAGE);
$obj->setName('DHL Paket');
$obj->setMinLength(15);
$obj->setMaxLength(200);
$obj->setMinWidth(11);
$obj->setMaxWidth(200);
$obj->setMinHeight(1);
$obj->se... | [
"private",
"static",
"function",
"init",
"(",
")",
"{",
"self",
"::",
"setInit",
"(",
"true",
")",
";",
"// Initiates Products",
"$",
"obj",
"=",
"new",
"Product",
"(",
"ShipmentDetails",
"::",
"PRODUCT_TYPE_NATIONAL_PACKAGE",
")",
";",
"$",
"obj",
"->",
"se... | Initiates the Class | [
"Initiates",
"the",
"Class"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ProductInfo.php#L80-L314 |
Petschko/dhl-php-sdk | includes/ProductInfo.php | ProductInfo.getInfo | public static function getInfo($productType) {
if(! self::isInit())
self::init();
if(! array_key_exists($productType, self::$dhlProducts))
return null;
return self::$dhlProducts[$productType];
} | php | public static function getInfo($productType) {
if(! self::isInit())
self::init();
if(! array_key_exists($productType, self::$dhlProducts))
return null;
return self::$dhlProducts[$productType];
} | [
"public",
"static",
"function",
"getInfo",
"(",
"$",
"productType",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isInit",
"(",
")",
")",
"self",
"::",
"init",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"productType",
",",
"self",
"::",
... | Get the Product-Object by Type
@param string $productType - ProductType
@return Product|null - DHL-Product Object or null if not exists in Info-Class | [
"Get",
"the",
"Product",
"-",
"Object",
"by",
"Type"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ProductInfo.php#L361-L369 |
Petschko/dhl-php-sdk | includes/ExportDocument.php | ExportDocument.addExportDocPosition | public function addExportDocPosition($exportDocPosition) {
if($this->getExportDocPosition() === null)
$this->setExportDocPosition($exportDocPosition);
else if(is_array($this->getExportDocPosition()))
$this->exportDocPosition[] = $exportDocPosition;
else {
// Convert the first existing entry to an array
... | php | public function addExportDocPosition($exportDocPosition) {
if($this->getExportDocPosition() === null)
$this->setExportDocPosition($exportDocPosition);
else if(is_array($this->getExportDocPosition()))
$this->exportDocPosition[] = $exportDocPosition;
else {
// Convert the first existing entry to an array
... | [
"public",
"function",
"addExportDocPosition",
"(",
"$",
"exportDocPosition",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getExportDocPosition",
"(",
")",
"===",
"null",
")",
"$",
"this",
"->",
"setExportDocPosition",
"(",
"$",
"exportDocPosition",
")",
";",
"else... | Adds an ExportDocPosition-Object to the current Object
If the ExportDocPosition was null before, then it will add the entry normal (backwards compatibility)
If the ExportDocPosition was an array before, it just add it to the array
If the ExportDocPosition was just 1 entry before, it will converted to an array with bot... | [
"Adds",
"an",
"ExportDocPosition",
"-",
"Object",
"to",
"the",
"current",
"Object"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ExportDocument.php#L366-L375 |
Petschko/dhl-php-sdk | includes/ExportDocument.php | ExportDocument.getExportDocumentClass_v2 | public function getExportDocumentClass_v2() {
$class = new StdClass;
// Standard-Export-Stuff
if($this->getInvoiceNumber() !== null)
$class->invoiceNumber = $this->getInvoiceNumber();
$class->exportType = $this->getExportType();
if($this->getExportTypeDescription() !== null)
$class->exportTypeDescrip... | php | public function getExportDocumentClass_v2() {
$class = new StdClass;
// Standard-Export-Stuff
if($this->getInvoiceNumber() !== null)
$class->invoiceNumber = $this->getInvoiceNumber();
$class->exportType = $this->getExportType();
if($this->getExportTypeDescription() !== null)
$class->exportTypeDescrip... | [
"public",
"function",
"getExportDocumentClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"// Standard-Export-Stuff",
"if",
"(",
"$",
"this",
"->",
"getInvoiceNumber",
"(",
")",
"!==",
"null",
")",
"$",
"class",
"->",
"invoiceNumber",
"=",
... | Returns a Class for Export-Document
@return StdClass - DHL-ExportDocument-Class
@throws Exception - Invalid Data-Exception | [
"Returns",
"a",
"Class",
"for",
"Export",
"-",
"Document"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ExportDocument.php#L399-L445 |
Petschko/dhl-php-sdk | includes/ShipmentOrder.php | ShipmentOrder.getShipmentOrderClass_v2 | public function getShipmentOrderClass_v2() {
$class = new StdClass;
$class->sequenceNumber = $this->getSequenceNumber();
// Shipment
$class->Shipment = new StdClass;
$class->Shipment->ShipmentDetails = $this->getShipmentDetails()->getShipmentDetailsClass_v2();
// Shipper
$class->Shipment->Shipper = $thi... | php | public function getShipmentOrderClass_v2() {
$class = new StdClass;
$class->sequenceNumber = $this->getSequenceNumber();
// Shipment
$class->Shipment = new StdClass;
$class->Shipment->ShipmentDetails = $this->getShipmentDetails()->getShipmentDetailsClass_v2();
// Shipper
$class->Shipment->Shipper = $thi... | [
"public",
"function",
"getShipmentOrderClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"$",
"class",
"->",
"sequenceNumber",
"=",
"$",
"this",
"->",
"getSequenceNumber",
"(",
")",
";",
"// Shipment",
"$",
"class",
"->",
"Shipment",
"=",
... | Returns an DHL-Class of this Object for DHL-Shipment Order
@return stdClass - DHL-ShipmentOrder-Class | [
"Returns",
"an",
"DHL",
"-",
"Class",
"of",
"this",
"Object",
"for",
"DHL",
"-",
"Shipment",
"Order"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ShipmentOrder.php#L264-L300 |
Petschko/dhl-php-sdk | includes/Address.php | Address.setCountry | public final function setCountry($country) {
if($country !== null)
$this->country = mb_strtolower($country);
else
$this->country = null;
} | php | public final function setCountry($country) {
if($country !== null)
$this->country = mb_strtolower($country);
else
$this->country = null;
} | [
"public",
"final",
"function",
"setCountry",
"(",
"$",
"country",
")",
"{",
"if",
"(",
"$",
"country",
"!==",
"null",
")",
"$",
"this",
"->",
"country",
"=",
"mb_strtolower",
"(",
"$",
"country",
")",
";",
"else",
"$",
"this",
"->",
"country",
"=",
"... | Set the Country
@param string|null $country - Country or null for none | [
"Set",
"the",
"Country"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Address.php#L279-L284 |
Petschko/dhl-php-sdk | includes/Address.php | Address.setCountryISOCode | public final function setCountryISOCode($countryISOCode) {
if($countryISOCode !== null)
$this->countryISOCode = mb_strtoupper($countryISOCode);
else
$this->countryISOCode = null;
} | php | public final function setCountryISOCode($countryISOCode) {
if($countryISOCode !== null)
$this->countryISOCode = mb_strtoupper($countryISOCode);
else
$this->countryISOCode = null;
} | [
"public",
"final",
"function",
"setCountryISOCode",
"(",
"$",
"countryISOCode",
")",
"{",
"if",
"(",
"$",
"countryISOCode",
"!==",
"null",
")",
"$",
"this",
"->",
"countryISOCode",
"=",
"mb_strtoupper",
"(",
"$",
"countryISOCode",
")",
";",
"else",
"$",
"thi... | Set the Country-ISO-Code
@param string|null $countryISOCode - Country-ISO-Code or null for none | [
"Set",
"the",
"Country",
"-",
"ISO",
"-",
"Code"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Address.php#L300-L305 |
Petschko/dhl-php-sdk | includes/Address.php | Address.setFullStreet | public final function setFullStreet($street) {
trigger_error('[DHL-PHP-SDK]: Called deprecated method ' . __METHOD__ . ': Buggy on some addresses, please separate the number and street by yourself. This method will removed in the future!', E_USER_DEPRECATED);
$match = array();
preg_match('/^([^\d]*[^\d\s]) *(\d... | php | public final function setFullStreet($street) {
trigger_error('[DHL-PHP-SDK]: Called deprecated method ' . __METHOD__ . ': Buggy on some addresses, please separate the number and street by yourself. This method will removed in the future!', E_USER_DEPRECATED);
$match = array();
preg_match('/^([^\d]*[^\d\s]) *(\d... | [
"public",
"final",
"function",
"setFullStreet",
"(",
"$",
"street",
")",
"{",
"trigger_error",
"(",
"'[DHL-PHP-SDK]: Called deprecated method '",
".",
"__METHOD__",
".",
"': Buggy on some addresses, please separate the number and street by yourself. This method will removed in the futu... | Sets Street-Name and Number by Address String
Found here: https://www.tricd.de/php/php-strassenname-und-hausnummer-mit-php-parsen/
@param string $street - Address (Street plus number)
@deprecated - Buggy on some addresses, please separate the number and street by yourself | [
"Sets",
"Street",
"-",
"Name",
"and",
"Number",
"by",
"Address",
"String"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Address.php#L334-L345 |
Petschko/dhl-php-sdk | includes/PackStation.php | PackStation.getClass_v2 | public function getClass_v2() {
$class = new StdClass;
$class->name1 = $this->getName();
$class->Communication = new StdClass;
if($this->getPhone() !== null)
$class->Communication->phone = $this->getPhone();
if($this->getEmail() !== null)
$class->Communication->email = $this->getEmail();
if($this->ge... | php | public function getClass_v2() {
$class = new StdClass;
$class->name1 = $this->getName();
$class->Communication = new StdClass;
if($this->getPhone() !== null)
$class->Communication->phone = $this->getPhone();
if($this->getEmail() !== null)
$class->Communication->email = $this->getEmail();
if($this->ge... | [
"public",
"function",
"getClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"$",
"class",
"->",
"name1",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"$",
"class",
"->",
"Communication",
"=",
"new",
"StdClass",
";",
"if",
"(",... | Returns a Class for the DHL-SendPerson
@return StdClass - DHL-SendPerson-class | [
"Returns",
"a",
"Class",
"for",
"the",
"DHL",
"-",
"SendPerson"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/PackStation.php#L94-L125 |
Petschko/dhl-php-sdk | includes/Service.php | Service.setDayOfDeliveryDate | public function setDayOfDeliveryDate($dayOfDeliveryDate, $useIntTime = false) {
if($useIntTime) {
$dayOfDeliveryDate = date('Y-m-d', $dayOfDeliveryDate);
if($dayOfDeliveryDate === false)
$dayOfDeliveryDate = null;
}
$this->dayOfDeliveryDate = $dayOfDeliveryDate;
} | php | public function setDayOfDeliveryDate($dayOfDeliveryDate, $useIntTime = false) {
if($useIntTime) {
$dayOfDeliveryDate = date('Y-m-d', $dayOfDeliveryDate);
if($dayOfDeliveryDate === false)
$dayOfDeliveryDate = null;
}
$this->dayOfDeliveryDate = $dayOfDeliveryDate;
} | [
"public",
"function",
"setDayOfDeliveryDate",
"(",
"$",
"dayOfDeliveryDate",
",",
"$",
"useIntTime",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"useIntTime",
")",
"{",
"$",
"dayOfDeliveryDate",
"=",
"date",
"(",
"'Y-m-d'",
",",
"$",
"dayOfDeliveryDate",
")",
";... | Set the Date for the Service "DayOfDelivery"
@param null|int|string $dayOfDeliveryDate - The Day of Delivery as ISO-Date-Format (YYYY-MM-DD), the day as time() int value or null for none
@param bool $useIntTime - Use the int Time Value instead of a String | [
"Set",
"the",
"Date",
"for",
"the",
"Service",
"DayOfDelivery"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Service.php#L557-L566 |
Petschko/dhl-php-sdk | includes/Service.php | Service.getServiceClass_v2 | public function getServiceClass_v2($productType) {
$class = new StdClass;
if($this->getDayOfDeliveryEnabled() !== null && in_array(
$productType,
array(
ShipmentDetails::PRODUCT_TYPE_SAME_DAY_MESSENGER,
ShipmentDetails::PRODUCT_TYPE_WISH_TIME_MESSENGER
))) {
$class->DayOfDelivery = new StdClass... | php | public function getServiceClass_v2($productType) {
$class = new StdClass;
if($this->getDayOfDeliveryEnabled() !== null && in_array(
$productType,
array(
ShipmentDetails::PRODUCT_TYPE_SAME_DAY_MESSENGER,
ShipmentDetails::PRODUCT_TYPE_WISH_TIME_MESSENGER
))) {
$class->DayOfDelivery = new StdClass... | [
"public",
"function",
"getServiceClass_v2",
"(",
"$",
"productType",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"if",
"(",
"$",
"this",
"->",
"getDayOfDeliveryEnabled",
"(",
")",
"!==",
"null",
"&&",
"in_array",
"(",
"$",
"productType",
",",
"arr... | Get the Class of this Service-Object
@param string $productType - Type of the Product
@return StdClass - Service-DHL-Class | [
"Get",
"the",
"Class",
"of",
"this",
"Service",
"-",
"Object"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/Service.php#L1451-L1588 |
Petschko/dhl-php-sdk | includes/LabelData.php | LabelData.loadLabelData_v2 | private function loadLabelData_v2($response) {
$labelResponse = $response;
// Check if the tree is correct (and may reconfigure it)
if(isset($response->LabelData))
$labelResponse = $response->LabelData;
// Get Sequence-Number
if(isset($response->sequenceNumber))
$this->setSequenceNumber((string) $respo... | php | private function loadLabelData_v2($response) {
$labelResponse = $response;
// Check if the tree is correct (and may reconfigure it)
if(isset($response->LabelData))
$labelResponse = $response->LabelData;
// Get Sequence-Number
if(isset($response->sequenceNumber))
$this->setSequenceNumber((string) $respo... | [
"private",
"function",
"loadLabelData_v2",
"(",
"$",
"response",
")",
"{",
"$",
"labelResponse",
"=",
"$",
"response",
";",
"// Check if the tree is correct (and may reconfigure it)",
"if",
"(",
"isset",
"(",
"$",
"response",
"->",
"LabelData",
")",
")",
"$",
"lab... | Set all Values of the LabelResponse to this Object
@param Object $response - LabelData-Response | [
"Set",
"all",
"Values",
"of",
"the",
"LabelResponse",
"to",
"this",
"Object"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/LabelData.php#L323-L385 |
Petschko/dhl-php-sdk | includes/BankData.php | BankData.getBankClass_v2 | public function getBankClass_v2() {
$class = new StdClass;
$class->accountOwner = $this->getAccountOwnerName();
$class->bankName = $this->getBankName();
$class->iban = $this->getIban();
if($this->getNote1() !== null)
$class->note1 = $this->getNote1();
if($this->getNote2() !== null)
$class->note2 = $t... | php | public function getBankClass_v2() {
$class = new StdClass;
$class->accountOwner = $this->getAccountOwnerName();
$class->bankName = $this->getBankName();
$class->iban = $this->getIban();
if($this->getNote1() !== null)
$class->note1 = $this->getNote1();
if($this->getNote2() !== null)
$class->note2 = $t... | [
"public",
"function",
"getBankClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"$",
"class",
"->",
"accountOwner",
"=",
"$",
"this",
"->",
"getAccountOwnerName",
"(",
")",
";",
"$",
"class",
"->",
"bankName",
"=",
"$",
"this",
"->",
... | Returns a DHL-Bank-Class for API v2
@return StdClass - DHL-Bank-Class | [
"Returns",
"a",
"DHL",
"-",
"Bank",
"-",
"Class",
"for",
"API",
"v2"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/BankData.php#L263-L279 |
Petschko/dhl-php-sdk | includes/ShipmentDetails.php | ShipmentDetails.getShipmentDate | public function getShipmentDate() {
if($this->shipmentDate === null)
$this->setShipmentDate($this->createDefaultShipmentDate());
return $this->shipmentDate;
} | php | public function getShipmentDate() {
if($this->shipmentDate === null)
$this->setShipmentDate($this->createDefaultShipmentDate());
return $this->shipmentDate;
} | [
"public",
"function",
"getShipmentDate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"shipmentDate",
"===",
"null",
")",
"$",
"this",
"->",
"setShipmentDate",
"(",
"$",
"this",
"->",
"createDefaultShipmentDate",
"(",
")",
")",
";",
"return",
"$",
"this",
... | Get the Shipment-Date (and set the default one -today- if none was set)
@return string - Shipment-Date as ISO-Date String YYYY-MM-DD | [
"Get",
"the",
"Shipment",
"-",
"Date",
"(",
"and",
"set",
"the",
"default",
"one",
"-",
"today",
"-",
"if",
"none",
"was",
"set",
")"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ShipmentDetails.php#L347-L352 |
Petschko/dhl-php-sdk | includes/ShipmentDetails.php | ShipmentDetails.setShipmentDate | public function setShipmentDate($shipmentDate, $useIntTime = false) {
if($useIntTime) {
// Convert Time-Stamp to Date
$shipmentDate = date('Y-m-d', $shipmentDate);
if($shipmentDate === false)
$shipmentDate = null;
}
$this->shipmentDate = $shipmentDate;
} | php | public function setShipmentDate($shipmentDate, $useIntTime = false) {
if($useIntTime) {
// Convert Time-Stamp to Date
$shipmentDate = date('Y-m-d', $shipmentDate);
if($shipmentDate === false)
$shipmentDate = null;
}
$this->shipmentDate = $shipmentDate;
} | [
"public",
"function",
"setShipmentDate",
"(",
"$",
"shipmentDate",
",",
"$",
"useIntTime",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"useIntTime",
")",
"{",
"// Convert Time-Stamp to Date",
"$",
"shipmentDate",
"=",
"date",
"(",
"'Y-m-d'",
",",
"$",
"shipmentDat... | Set the Shipment-Date
@param string|int|null $shipmentDate - Shipment-Date as String YYYY-MM-DD or the int value time() of the date | null for today (+1 Day on Sunday)
@param bool $useIntTime - Use the int Time Value instead of a String | [
"Set",
"the",
"Shipment",
"-",
"Date"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ShipmentDetails.php#L360-L370 |
Petschko/dhl-php-sdk | includes/ShipmentDetails.php | ShipmentDetails.createDefaultShipmentDate | private function createDefaultShipmentDate() {
$now = time();
$weekDay = date('w', $now);
if($weekDay === 0)
$now += 86400; // Increase Day by 1 if Sunday
return date('Y-m-d', $now);
} | php | private function createDefaultShipmentDate() {
$now = time();
$weekDay = date('w', $now);
if($weekDay === 0)
$now += 86400; // Increase Day by 1 if Sunday
return date('Y-m-d', $now);
} | [
"private",
"function",
"createDefaultShipmentDate",
"(",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"$",
"weekDay",
"=",
"date",
"(",
"'w'",
",",
"$",
"now",
")",
";",
"if",
"(",
"$",
"weekDay",
"===",
"0",
")",
"$",
"now",
"+=",
"86400",
... | Creates a Default Shipment-Date (Today or if Sunday the next Day)
@return string - Default-Date as ISO-Date String | [
"Creates",
"a",
"Default",
"Shipment",
"-",
"Date",
"(",
"Today",
"or",
"if",
"Sunday",
"the",
"next",
"Day",
")"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ShipmentDetails.php#L573-L581 |
Petschko/dhl-php-sdk | includes/ShipmentDetails.php | ShipmentDetails.getShipmentDetailsClass_v2 | public function getShipmentDetailsClass_v2() {
$class = new StdClass;
$class->product = $this->getProduct();
$class->accountNumber = $this->getAccountNumber();
if($this->getCustomerReference() !== null)
$class->customerReference = $this->getCustomerReference();
$class->shipmentDate = $this->getShipmentDat... | php | public function getShipmentDetailsClass_v2() {
$class = new StdClass;
$class->product = $this->getProduct();
$class->accountNumber = $this->getAccountNumber();
if($this->getCustomerReference() !== null)
$class->customerReference = $this->getCustomerReference();
$class->shipmentDate = $this->getShipmentDat... | [
"public",
"function",
"getShipmentDetailsClass_v2",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"StdClass",
";",
"$",
"class",
"->",
"product",
"=",
"$",
"this",
"->",
"getProduct",
"(",
")",
";",
"$",
"class",
"->",
"accountNumber",
"=",
"$",
"this",
"->",... | Returns an DHL-Class of this Object for DHL-Shipment Details
@return StdClass - DHL-ShipmentDetails-Class | [
"Returns",
"an",
"DHL",
"-",
"Class",
"of",
"this",
"Object",
"for",
"DHL",
"-",
"Shipment",
"Details"
] | train | https://github.com/Petschko/dhl-php-sdk/blob/a78ea297246a18c280902ec5c78cc60a4858025f/includes/ShipmentDetails.php#L602-L636 |
xPaw/SteamID.php | SteamID.php | SteamID.RenderSteam2 | public function RenderSteam2()
{
switch( $this->GetAccountType() )
{
case self::TypeInvalid:
case self::TypeIndividual:
{
$Universe = $this->GetAccountUniverse();
$AccountID = $this->GetAccountID();
return 'STEAM_' . $Universe . ':' . ( $AccountID & 1 ) . ':' .
( $AccountID >> 1 );
... | php | public function RenderSteam2()
{
switch( $this->GetAccountType() )
{
case self::TypeInvalid:
case self::TypeIndividual:
{
$Universe = $this->GetAccountUniverse();
$AccountID = $this->GetAccountID();
return 'STEAM_' . $Universe . ':' . ( $AccountID & 1 ) . ':' .
( $AccountID >> 1 );
... | [
"public",
"function",
"RenderSteam2",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"GetAccountType",
"(",
")",
")",
"{",
"case",
"self",
"::",
"TypeInvalid",
":",
"case",
"self",
"::",
"TypeIndividual",
":",
"{",
"$",
"Universe",
"=",
"$",
"this",
... | Renders this instance into it's Steam2 "STEAM_" representation.
@return string A string Steam2 "STEAM_" representation of this SteamID. | [
"Renders",
"this",
"instance",
"into",
"it",
"s",
"Steam2",
"STEAM_",
"representation",
"."
] | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L229-L247 |
xPaw/SteamID.php | SteamID.php | SteamID.RenderSteam3 | public function RenderSteam3()
{
$AccountInstance = $this->GetAccountInstance();
$AccountType = $this->GetAccountType();
$AccountTypeChar = isset( self::$AccountTypeChars[ $AccountType ] ) ?
self::$AccountTypeChars[ $AccountType ] :
'i';
$RenderInstance = false;
switch( $AccountType )
{
ca... | php | public function RenderSteam3()
{
$AccountInstance = $this->GetAccountInstance();
$AccountType = $this->GetAccountType();
$AccountTypeChar = isset( self::$AccountTypeChars[ $AccountType ] ) ?
self::$AccountTypeChars[ $AccountType ] :
'i';
$RenderInstance = false;
switch( $AccountType )
{
ca... | [
"public",
"function",
"RenderSteam3",
"(",
")",
"{",
"$",
"AccountInstance",
"=",
"$",
"this",
"->",
"GetAccountInstance",
"(",
")",
";",
"$",
"AccountType",
"=",
"$",
"this",
"->",
"GetAccountType",
"(",
")",
";",
"$",
"AccountTypeChar",
"=",
"isset",
"("... | Renders this instance into its Steam3 representation.
@return string A string Steam3 representation of this SteamID. | [
"Renders",
"this",
"instance",
"into",
"its",
"Steam3",
"representation",
"."
] | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L254-L303 |
xPaw/SteamID.php | SteamID.php | SteamID.RenderSteamInvite | public function RenderSteamInvite()
{
switch( $this->GetAccountType() )
{
case self::TypeInvalid:
case self::TypeIndividual:
{
$Code = dechex( $this->GetAccountID() );
$Code = strtr( $Code, self::$SteamInviteDictionary );
$Length = strlen( $Code );
// TODO: We don't know when Valve st... | php | public function RenderSteamInvite()
{
switch( $this->GetAccountType() )
{
case self::TypeInvalid:
case self::TypeIndividual:
{
$Code = dechex( $this->GetAccountID() );
$Code = strtr( $Code, self::$SteamInviteDictionary );
$Length = strlen( $Code );
// TODO: We don't know when Valve st... | [
"public",
"function",
"RenderSteamInvite",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"GetAccountType",
"(",
")",
")",
"{",
"case",
"self",
"::",
"TypeInvalid",
":",
"case",
"self",
"::",
"TypeIndividual",
":",
"{",
"$",
"Code",
"=",
"dechex",
"(",... | Renders this instance into Steam's new invite code. Which can be formatted as:
http://s.team/p/%s
https://steamcommunity.com/user/%s
@return string A Steam invite code which can be used in a URL. | [
"Renders",
"this",
"instance",
"into",
"Steam",
"s",
"new",
"invite",
"code",
".",
"Which",
"can",
"be",
"formatted",
"as",
":",
"http",
":",
"//",
"s",
".",
"team",
"/",
"p",
"/",
"%s",
"https",
":",
"//",
"steamcommunity",
".",
"com",
"/",
"user",
... | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L312-L336 |
xPaw/SteamID.php | SteamID.php | SteamID.IsValid | public function IsValid()
{
$AccountType = $this->GetAccountType();
if( $AccountType <= self::TypeInvalid || $AccountType >= 11 ) // EAccountType.Max
{
return false;
}
$AccountUniverse = $this->GetAccountUniverse();
if( $AccountUniverse <= self::UniverseInvalid || $AccountUniverse >= self::Univ... | php | public function IsValid()
{
$AccountType = $this->GetAccountType();
if( $AccountType <= self::TypeInvalid || $AccountType >= 11 ) // EAccountType.Max
{
return false;
}
$AccountUniverse = $this->GetAccountUniverse();
if( $AccountUniverse <= self::UniverseInvalid || $AccountUniverse >= self::Univ... | [
"public",
"function",
"IsValid",
"(",
")",
"{",
"$",
"AccountType",
"=",
"$",
"this",
"->",
"GetAccountType",
"(",
")",
";",
"if",
"(",
"$",
"AccountType",
"<=",
"self",
"::",
"TypeInvalid",
"||",
"$",
"AccountType",
">=",
"11",
")",
"// EAccountType.Max",... | Gets a value indicating whether this instance is valid.
@return bool true if this instance is valid; otherwise, false. | [
"Gets",
"a",
"value",
"indicating",
"whether",
"this",
"instance",
"is",
"valid",
"."
] | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L343-L387 |
xPaw/SteamID.php | SteamID.php | SteamID.SetFromURL | public static function SetFromURL( $Value, callable $VanityCallback )
{
if( preg_match( '/^https?:\/\/steamcommunity\.com\/profiles\/(.+?)(?:\/|$)/', $Value, $Matches ) === 1 )
{
$Value = $Matches[ 1 ];
}
else if( preg_match( '/^https?:\/\/steamcommunity\.com\/(id|groups|games)\/([\w-]+)(?:\/|$)/', $Value, ... | php | public static function SetFromURL( $Value, callable $VanityCallback )
{
if( preg_match( '/^https?:\/\/steamcommunity\.com\/profiles\/(.+?)(?:\/|$)/', $Value, $Matches ) === 1 )
{
$Value = $Matches[ 1 ];
}
else if( preg_match( '/^https?:\/\/steamcommunity\.com\/(id|groups|games)\/([\w-]+)(?:\/|$)/', $Value, ... | [
"public",
"static",
"function",
"SetFromURL",
"(",
"$",
"Value",
",",
"callable",
"$",
"VanityCallback",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^https?:\\/\\/steamcommunity\\.com\\/profiles\\/(.+?)(?:\\/|$)/'",
",",
"$",
"Value",
",",
"$",
"Matches",
")",
"===",... | Returns a SteamID instance constructed from a steamcommunity.com
URL form, or simply from a vanity url.
Please note that you must implement vanity lookup function using
ISteamUser/ResolveVanityURL api interface yourself.
Callback function must return resolved SteamID as a string,
or null if API returns success=42 (me... | [
"Returns",
"a",
"SteamID",
"instance",
"constructed",
"from",
"a",
"steamcommunity",
".",
"com",
"URL",
"form",
"or",
"simply",
"from",
"a",
"vanity",
"url",
"."
] | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L412-L465 |
xPaw/SteamID.php | SteamID.php | SteamID.SetFromUInt64 | public function SetFromUInt64( $Value )
{
if( self::IsNumeric( $Value ) )
{
$this->Data = gmp_init( $Value, 10 );
}
else
{
throw new InvalidArgumentException( 'Provided SteamID is not numeric.' );
}
return $this;
} | php | public function SetFromUInt64( $Value )
{
if( self::IsNumeric( $Value ) )
{
$this->Data = gmp_init( $Value, 10 );
}
else
{
throw new InvalidArgumentException( 'Provided SteamID is not numeric.' );
}
return $this;
} | [
"public",
"function",
"SetFromUInt64",
"(",
"$",
"Value",
")",
"{",
"if",
"(",
"self",
"::",
"IsNumeric",
"(",
"$",
"Value",
")",
")",
"{",
"$",
"this",
"->",
"Data",
"=",
"gmp_init",
"(",
"$",
"Value",
",",
"10",
")",
";",
"}",
"else",
"{",
"thr... | Sets the various components of this SteamID from a 64bit integer form.
@param int|string $Value The 64bit integer to assign this SteamID from.
@return SteamID Fluent interface
@throws InvalidArgumentException | [
"Sets",
"the",
"various",
"components",
"of",
"this",
"SteamID",
"from",
"a",
"64bit",
"integer",
"form",
"."
] | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L476-L488 |
xPaw/SteamID.php | SteamID.php | SteamID.Get | private function Get( $BitOffset, $ValueMask )
{
return gmp_and( self::ShiftRight( $this->Data, $BitOffset ), $ValueMask );
} | php | private function Get( $BitOffset, $ValueMask )
{
return gmp_and( self::ShiftRight( $this->Data, $BitOffset ), $ValueMask );
} | [
"private",
"function",
"Get",
"(",
"$",
"BitOffset",
",",
"$",
"ValueMask",
")",
"{",
"return",
"gmp_and",
"(",
"self",
"::",
"ShiftRight",
"(",
"$",
"this",
"->",
"Data",
",",
"$",
"BitOffset",
")",
",",
"$",
"ValueMask",
")",
";",
"}"
] | @param int $BitOffset
@param int|string $ValueMask
@return \GMP | [
"@param",
"int",
"$BitOffset",
"@param",
"int|string",
"$ValueMask"
] | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L603-L606 |
xPaw/SteamID.php | SteamID.php | SteamID.Set | private function Set( $BitOffset, $ValueMask, $Value )
{
$this->Data = gmp_or(
gmp_and( $this->Data, gmp_com( self::ShiftLeft( $ValueMask, $BitOffset ) ) ),
self::ShiftLeft( gmp_and( $Value, $ValueMask ), $BitOffset )
);
} | php | private function Set( $BitOffset, $ValueMask, $Value )
{
$this->Data = gmp_or(
gmp_and( $this->Data, gmp_com( self::ShiftLeft( $ValueMask, $BitOffset ) ) ),
self::ShiftLeft( gmp_and( $Value, $ValueMask ), $BitOffset )
);
} | [
"private",
"function",
"Set",
"(",
"$",
"BitOffset",
",",
"$",
"ValueMask",
",",
"$",
"Value",
")",
"{",
"$",
"this",
"->",
"Data",
"=",
"gmp_or",
"(",
"gmp_and",
"(",
"$",
"this",
"->",
"Data",
",",
"gmp_com",
"(",
"self",
"::",
"ShiftLeft",
"(",
... | @param int $BitOffset
@param int|string $ValueMask
@param int|string $Value
@return void | [
"@param",
"int",
"$BitOffset",
"@param",
"int|string",
"$ValueMask",
"@param",
"int|string",
"$Value"
] | train | https://github.com/xPaw/SteamID.php/blob/1782f0c0bebe16821483dc3ae81075a0f6eb7268/SteamID.php#L615-L621 |
yunpian/yunpian-php-sdk | src/YunpianClient.php | YunpianClient.create | static function create($apikey, array $conf = []) {
$clnt = new YunpianClient();
$clnt->conf->init()->with($apikey, $conf);
$clnt->initHttp($clnt->conf); // YunpianGuzzle->initHttp
return $clnt;
} | php | static function create($apikey, array $conf = []) {
$clnt = new YunpianClient();
$clnt->conf->init()->with($apikey, $conf);
$clnt->initHttp($clnt->conf); // YunpianGuzzle->initHttp
return $clnt;
} | [
"static",
"function",
"create",
"(",
"$",
"apikey",
",",
"array",
"$",
"conf",
"=",
"[",
"]",
")",
"{",
"$",
"clnt",
"=",
"new",
"YunpianClient",
"(",
")",
";",
"$",
"clnt",
"->",
"conf",
"->",
"init",
"(",
")",
"->",
"with",
"(",
"$",
"apikey",
... | Initialize/Create YunpianClient
@param string $apikey
@param array $conf
@return \Yunpian\SDK\YunpianClient | [
"Initialize",
"/",
"Create",
"YunpianClient"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/YunpianClient.php#L39-L44 |
yunpian/yunpian-php-sdk | src/Api/VoiceApi.php | VoiceApi.pull_status | function pull_status(array $param) {
static $must = [self::APIKEY];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
switch ($v) {
case self::V... | php | function pull_status(array $param) {
static $must = [self::APIKEY];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
switch ($v) {
case self::V... | [
"function",
"pull_status",
"(",
"array",
"$",
"param",
")",
"{",
"static",
"$",
"must",
"=",
"[",
"self",
"::",
"APIKEY",
"]",
";",
"$",
"r",
"=",
"$",
"this",
"->",
"verifyParam",
"(",
"$",
"param",
",",
"$",
"must",
")",
";",
"if",
"(",
"!",
... | <h1>获取状态报告</h1>
<p>
参数名 是否必须 描述 示例
</p>
<p>
apikey 是 用户唯一标识 9b11127a9701975c734b8aee81ee3526
</p>
<p>
page_size 否 每页个数,最大100个,默认20个 20
</p>
@param array $param
@return Result | [
"<h1",
">",
"获取状态报告<",
"/",
"h1",
">"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/Api/VoiceApi.php#L93-L109 |
yunpian/yunpian-php-sdk | src/YunpianConf.php | YunpianConf.with | function with($apikey, array $conf = []) {
if (!empty($conf)) foreach ($conf as $key => $value) {
$this->conf[$key] = $value;
}
if (isset($apikey)) $this->conf[self::YP_APIKEY] = $apikey;
return $this;
} | php | function with($apikey, array $conf = []) {
if (!empty($conf)) foreach ($conf as $key => $value) {
$this->conf[$key] = $value;
}
if (isset($apikey)) $this->conf[self::YP_APIKEY] = $apikey;
return $this;
} | [
"function",
"with",
"(",
"$",
"apikey",
",",
"array",
"$",
"conf",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"conf",
")",
")",
"foreach",
"(",
"$",
"conf",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
... | to upsert $conf
@param string $apikey
@param array $conf
@return \Yunpian\Sdk\YunpianConf | [
"to",
"upsert",
"$conf"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/YunpianConf.php#L25-L33 |
yunpian/yunpian-php-sdk | src/YunpianConf.php | YunpianConf.init | function init() {
if (is_null($this->conf)) {
$this->conf = [];
}
$yp = parse_ini_file("yunpian.ini");
foreach ($yp as $key => $value) {
$this->conf[$key] = $value;
}
return $this;
} | php | function init() {
if (is_null($this->conf)) {
$this->conf = [];
}
$yp = parse_ini_file("yunpian.ini");
foreach ($yp as $key => $value) {
$this->conf[$key] = $value;
}
return $this;
} | [
"function",
"init",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"conf",
")",
")",
"{",
"$",
"this",
"->",
"conf",
"=",
"[",
"]",
";",
"}",
"$",
"yp",
"=",
"parse_ini_file",
"(",
"\"yunpian.ini\"",
")",
";",
"foreach",
"(",
"$",
... | load yunpian.ini to initialize YunpianConf firstly:
<p>
</p>
@return Yunpian\Sdk\YunpianConf | [
"load",
"yunpian",
".",
"ini",
"to",
"initialize",
"YunpianConf",
"firstly",
":",
"<p",
">"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/YunpianConf.php#L43-L53 |
yunpian/yunpian-php-sdk | src/Api/SmsApi.php | SmsApi.get_reply | function get_reply(array $param) {
static $must = [self::APIKEY,self::START_TIME,self::END_TIME,self::PAGE_NUM,self::PAGE_SIZE];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ... | php | function get_reply(array $param) {
static $must = [self::APIKEY,self::START_TIME,self::END_TIME,self::PAGE_NUM,self::PAGE_SIZE];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ... | [
"function",
"get_reply",
"(",
"array",
"$",
"param",
")",
"{",
"static",
"$",
"must",
"=",
"[",
"self",
"::",
"APIKEY",
",",
"self",
"::",
"START_TIME",
",",
"self",
"::",
"END_TIME",
",",
"self",
"::",
"PAGE_NUM",
",",
"self",
"::",
"PAGE_SIZE",
"]",
... | <h1>查回复的短信</h1>
<p>
参数名 类型 是否必须 描述 示例
</p>
<p>
apikey String 是 用户唯一标识 9b11127a9701975c734b8aee81ee3526
</p>
<p>
start_time String 是 短信回复开始时间 2013-08-11 00:00:00
</p>
<p>
end_time String 是 短信回复结束时间 2013-08-12 00:00:00
</p>
<p>
page_num Integer 是 页码,默认值为1 1
</p>
<p>
page_size Integer 是 每页个数,最大100个 20
</p>
<p>
mobile Str... | [
"<h1",
">",
"查回复的短信<",
"/",
"h1",
">"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/Api/SmsApi.php#L334-L350 |
yunpian/yunpian-php-sdk | src/Api/SmsApi.php | SmsApi.get_black_word | function get_black_word(array $param) {
static $must = [self::APIKEY,self::TEXT];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
switch ($v) {
... | php | function get_black_word(array $param) {
static $must = [self::APIKEY,self::TEXT];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
switch ($v) {
... | [
"function",
"get_black_word",
"(",
"array",
"$",
"param",
")",
"{",
"static",
"$",
"must",
"=",
"[",
"self",
"::",
"APIKEY",
",",
"self",
"::",
"TEXT",
"]",
";",
"$",
"r",
"=",
"$",
"this",
"->",
"verifyParam",
"(",
"$",
"param",
",",
"$",
"must",
... | <h1>查屏蔽词</h1>
<p>
参数名 类型 是否必须 描述 示例
</p>
<p>
apikey String 是 用户唯一标识 9b11127a9701975c734b8aee81ee3526
</p>
<p>
text String 是 要检查的短信模板或者内容 这是一条测试短信
</p>
@param array $param
@return Result | [
"<h1",
">",
"查屏蔽词<",
"/",
"h1",
">"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/Api/SmsApi.php#L368-L384 |
yunpian/yunpian-php-sdk | src/Api/SmsApi.php | SmsApi.get_record | function get_record(array $param) {
static $must = [self::APIKEY,self::START_TIME,self::END_TIME];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
switch ($v)... | php | function get_record(array $param) {
static $must = [self::APIKEY,self::START_TIME,self::END_TIME];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
switch ($v)... | [
"function",
"get_record",
"(",
"array",
"$",
"param",
")",
"{",
"static",
"$",
"must",
"=",
"[",
"self",
"::",
"APIKEY",
",",
"self",
"::",
"START_TIME",
",",
"self",
"::",
"END_TIME",
"]",
";",
"$",
"r",
"=",
"$",
"this",
"->",
"verifyParam",
"(",
... | <h1>查短信发送记录</h1>
<p>
参数名 类型 是否必须 描述 示例
</p>
<p>
apikey String 是 用户唯一标识 9b11127a9701975c734b8aee81ee3526
</p>
<p>
mobile String 否 需要查询的手机号 15205201314
</p>
<p>
start_time String 是 短信发送开始时间 2013-08-11 00:00:00
</p>
<p>
end_time String 是 短信发送结束时间 2013-08-12 00:00:00
</p>
<p>
page_num Integer 否 页码,默认值为1 1
</p>
<p>
page_si... | [
"<h1",
">",
"查短信发送记录<",
"/",
"h1",
">"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/Api/SmsApi.php#L414-L430 |
yunpian/yunpian-php-sdk | src/Api/SmsApi.php | SmsApi.count | function count(array $param) {
static $must = [self::APIKEY,self::START_TIME,self::END_TIME];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
$total = $rsp[se... | php | function count(array $param) {
static $must = [self::APIKEY,self::START_TIME,self::END_TIME];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
$total = $rsp[se... | [
"function",
"count",
"(",
"array",
"$",
"param",
")",
"{",
"static",
"$",
"must",
"=",
"[",
"self",
"::",
"APIKEY",
",",
"self",
"::",
"START_TIME",
",",
"self",
"::",
"END_TIME",
"]",
";",
"$",
"r",
"=",
"$",
"this",
"->",
"verifyParam",
"(",
"$",... | <h1>统计短信条数</h1>
<p>
参数名 类型 是否必须 描述 示例
</p>
<p>
apikey String 是 用户唯一标识 9b11127a9701975c734b8aee81ee3526
</p>
<p>
start_time String 是 短信发送开始时间 2013-08-11 00:00:00
</p>
<p>
end_time String 是 短信发送结束时间 2013-08-12 00:00:00
</p>
<p>
mobile String 否 需要查询的手机号 15205201314
</p>
<p>
page_num Integer 否 页码,默认值为1 1
</p>
<p>
page_siz... | [
"<h1",
">",
"统计短信条数<",
"/",
"h1",
">"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/Api/SmsApi.php#L460-L471 |
yunpian/yunpian-php-sdk | src/Api/SmsApi.php | SmsApi.tpl_send | function tpl_send(array $param) {
static $must = [self::APIKEY,self::MOBILE,self::TPL_ID,self::TPL_VALUE];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
swi... | php | function tpl_send(array $param) {
static $must = [self::APIKEY,self::MOBILE,self::TPL_ID,self::TPL_VALUE];
$r = $this->verifyParam($param, $must);
if (!$r->isSucc()) return $r;
$v = $this->version();
$h = new CommonResultHandler(function ($rsp) use ($v) {
swi... | [
"function",
"tpl_send",
"(",
"array",
"$",
"param",
")",
"{",
"static",
"$",
"must",
"=",
"[",
"self",
"::",
"APIKEY",
",",
"self",
"::",
"MOBILE",
",",
"self",
"::",
"TPL_ID",
",",
"self",
"::",
"TPL_VALUE",
"]",
";",
"$",
"r",
"=",
"$",
"this",
... | <h1>指定模板发送 only v1</h1>
<p>
参数名 类型 是否必须 描述 示例
</p>
<p>
apikey String 是 用户唯一标识 9b11127a9701975c734b8aee81ee3526
</p>
<p>
mobile String 是 接收的手机号 15205201314
</p>
<p>
tpl_id Long 是 模板id 1
</p>
<p>
tpl_value String 是 变量名和变量值对。请先对您的变量名和变量值分别进行urlencode再传递。使用参考:代码示例。
注:变量名和变量值都不能为空 模板: 【#company#】您的验证码是#code#。 最终发送结果: 【云片网】... | [
"<h1",
">",
"指定模板发送",
"only",
"v1<",
"/",
"h1",
">"
] | train | https://github.com/yunpian/yunpian-php-sdk/blob/b2c06c335807831e6d0f7818873f87735dd1bb0f/src/Api/SmsApi.php#L508-L522 |
vinkla/laravel-facebook | src/FacebookServiceProvider.php | FacebookServiceProvider.registerFactory | protected function registerFactory(): void
{
$this->app->singleton('facebook.factory', function () {
return new FacebookFactory();
});
$this->app->alias('facebook.factory', FacebookFactory::class);
} | php | protected function registerFactory(): void
{
$this->app->singleton('facebook.factory', function () {
return new FacebookFactory();
});
$this->app->alias('facebook.factory', FacebookFactory::class);
} | [
"protected",
"function",
"registerFactory",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'facebook.factory'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"FacebookFactory",
"(",
")",
";",
"}",
")",
";",
"$",
"this",... | Register the factory class.
@return void | [
"Register",
"the",
"factory",
"class",
"."
] | train | https://github.com/vinkla/laravel-facebook/blob/46b5b5363500c397ea8c222331a31c1b5160bda2/src/FacebookServiceProvider.php#L74-L81 |
vinkla/laravel-facebook | src/FacebookFactory.php | FacebookFactory.make | public function make(array $config): Facebook
{
$config = $this->getConfig($config);
return $this->getClient($config);
} | php | public function make(array $config): Facebook
{
$config = $this->getConfig($config);
return $this->getClient($config);
} | [
"public",
"function",
"make",
"(",
"array",
"$",
"config",
")",
":",
"Facebook",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"$",
"config",
")",
";",
"return",
"$",
"this",
"->",
"getClient",
"(",
"$",
"config",
")",
";",
"}"
] | Make a new facebook client.
@param array $config
@return \Facebook\Facebook | [
"Make",
"a",
"new",
"facebook",
"client",
"."
] | train | https://github.com/vinkla/laravel-facebook/blob/46b5b5363500c397ea8c222331a31c1b5160bda2/src/FacebookFactory.php#L33-L38 |
vinkla/laravel-facebook | src/FacebookFactory.php | FacebookFactory.getConfig | protected function getConfig(array $config): array
{
$keys = ['app_id', 'app_secret'];
foreach ($keys as $key) {
if (!array_key_exists($key, $config)) {
throw new InvalidArgumentException("Missing configuration key [$key].");
}
}
return array... | php | protected function getConfig(array $config): array
{
$keys = ['app_id', 'app_secret'];
foreach ($keys as $key) {
if (!array_key_exists($key, $config)) {
throw new InvalidArgumentException("Missing configuration key [$key].");
}
}
return array... | [
"protected",
"function",
"getConfig",
"(",
"array",
"$",
"config",
")",
":",
"array",
"{",
"$",
"keys",
"=",
"[",
"'app_id'",
",",
"'app_secret'",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
... | Get the configuration data.
@param string[] $config
@throws \InvalidArgumentException
@return array | [
"Get",
"the",
"configuration",
"data",
"."
] | train | https://github.com/vinkla/laravel-facebook/blob/46b5b5363500c397ea8c222331a31c1b5160bda2/src/FacebookFactory.php#L49-L69 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.