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
zhouyl/mellivora
Mellivora/Database/Connection.php
Connection.getReadPdo
public function getReadPdo() { if ($this->transactions >= 1) { return $this->getPdo(); } if ($this->readPdo instanceof Closure) { return $this->readPdo = call_user_func($this->readPdo); } return $this->readPdo ?: $this->getPdo(); }
php
public function getReadPdo() { if ($this->transactions >= 1) { return $this->getPdo(); } if ($this->readPdo instanceof Closure) { return $this->readPdo = call_user_func($this->readPdo); } return $this->readPdo ?: $this->getPdo(); }
[ "public", "function", "getReadPdo", "(", ")", "{", "if", "(", "$", "this", "->", "transactions", ">=", "1", ")", "{", "return", "$", "this", "->", "getPdo", "(", ")", ";", "}", "if", "(", "$", "this", "->", "readPdo", "instanceof", "Closure", ")", ...
Get the current PDO connection used for reading. @return \PDO
[ "Get", "the", "current", "PDO", "connection", "used", "for", "reading", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Connection.php#L938-L949
skmetaly/laravel-twitch-restful-api
src/API/Search.php
Search.searchChannels
public function searchChannels($options) { $availableOptions = ['query', 'limit', 'offset']; $parameters = []; // Filter the available options foreach ($availableOptions as $option) { if (isset($options[ $option ])) { $parameters[ $option ] = $options...
php
public function searchChannels($options) { $availableOptions = ['query', 'limit', 'offset']; $parameters = []; // Filter the available options foreach ($availableOptions as $option) { if (isset($options[ $option ])) { $parameters[ $option ] = $options...
[ "public", "function", "searchChannels", "(", "$", "options", ")", "{", "$", "availableOptions", "=", "[", "'query'", ",", "'limit'", ",", "'offset'", "]", ";", "$", "parameters", "=", "[", "]", ";", "// Filter the available options", "foreach", "(", "$", "a...
Returns a list of channel objects matching the search query. @param $options @return json
[ "Returns", "a", "list", "of", "channel", "objects", "matching", "the", "search", "query", "." ]
train
https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Search.php#L22-L40
skmetaly/laravel-twitch-restful-api
src/API/Search.php
Search.streamsChannel
public function streamsChannel($channel) { $response = $this->client->get(config('twitch-api.api_url') . '/kraken/streams/' . $channel); return $response->json(); }
php
public function streamsChannel($channel) { $response = $this->client->get(config('twitch-api.api_url') . '/kraken/streams/' . $channel); return $response->json(); }
[ "public", "function", "streamsChannel", "(", "$", "channel", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "get", "(", "config", "(", "'twitch-api.api_url'", ")", ".", "'/kraken/streams/'", ".", "$", "channel", ")", ";", "return", "$",...
Returns a stream object if live. @param $channel @return json
[ "Returns", "a", "stream", "object", "if", "live", "." ]
train
https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Search.php#L109-L114
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/MethodDescriptor.php
MethodDescriptor.getResponse
public function getResponse() { /** @var Collection|null $returnTags */ $returnTags = $this->getReturn(); return $returnTags instanceof Collection && $returnTags->count() > 0 ? current($returnTags->getAll()) : null; }
php
public function getResponse() { /** @var Collection|null $returnTags */ $returnTags = $this->getReturn(); return $returnTags instanceof Collection && $returnTags->count() > 0 ? current($returnTags->getAll()) : null; }
[ "public", "function", "getResponse", "(", ")", "{", "/** @var Collection|null $returnTags */", "$", "returnTags", "=", "$", "this", "->", "getReturn", "(", ")", ";", "return", "$", "returnTags", "instanceof", "Collection", "&&", "$", "returnTags", "->", "count", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/MethodDescriptor.php#L166-L174
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/MethodDescriptor.php
MethodDescriptor.getInheritedElement
public function getInheritedElement() { if ($this->inheritedElement !== null) { return $this->inheritedElement; } /** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */ $associatedClass = $this->getParent(); if (!$associatedClass instanceof ClassDe...
php
public function getInheritedElement() { if ($this->inheritedElement !== null) { return $this->inheritedElement; } /** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */ $associatedClass = $this->getParent(); if (!$associatedClass instanceof ClassDe...
[ "public", "function", "getInheritedElement", "(", ")", "{", "if", "(", "$", "this", "->", "inheritedElement", "!==", "null", ")", "{", "return", "$", "this", "->", "inheritedElement", ";", "}", "/** @var ClassDescriptor|InterfaceDescriptor|null $associatedClass */", "...
Returns the Method from which this method should inherit its information, if any. The inheritance scheme for a method is more complicated than for most elements; the following business rules apply: 1. if the parent class/interface extends another class or other interfaces (interfaces have multiple inheritance!) then:...
[ "Returns", "the", "Method", "from", "which", "this", "method", "should", "inherit", "its", "information", "if", "any", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/MethodDescriptor.php#L239-L286
GrupaZero/api
src/Gzero/Api/Transformer/ContentTranslationTransformer.php
ContentTranslationTransformer.transform
public function transform($translation) { $translation = $this->entityToArray(ContentTranslation::class, $translation); return [ 'id' => (int) $translation['id'], 'langCode' => $translation['lang_code'], 'title' => $translation['title'],...
php
public function transform($translation) { $translation = $this->entityToArray(ContentTranslation::class, $translation); return [ 'id' => (int) $translation['id'], 'langCode' => $translation['lang_code'], 'title' => $translation['title'],...
[ "public", "function", "transform", "(", "$", "translation", ")", "{", "$", "translation", "=", "$", "this", "->", "entityToArray", "(", "ContentTranslation", "::", "class", ",", "$", "translation", ")", ";", "return", "[", "'id'", "=>", "(", "int", ")", ...
Transforms content translation entity @param ContentTranslation|array $translation ContentTranslation entity @return array
[ "Transforms", "content", "translation", "entity" ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/ContentTranslationTransformer.php#L26-L41
GrupaZero/api
src/Gzero/Api/Controller/Admin/ContentTranslationController.php
ContentTranslationController.index
public function index($id) { $this->authorize('readList', Content::class); $input = $this->validator->validate('list'); $params = $this->processor->process($input)->getProcessedFields(); $content = $this->repository->getById($id); if (!empty($content)) { $resul...
php
public function index($id) { $this->authorize('readList', Content::class); $input = $this->validator->validate('list'); $params = $this->processor->process($input)->getProcessedFields(); $content = $this->repository->getById($id); if (!empty($content)) { $resul...
[ "public", "function", "index", "(", "$", "id", ")", "{", "$", "this", "->", "authorize", "(", "'readList'", ",", "Content", "::", "class", ")", ";", "$", "input", "=", "$", "this", "->", "validator", "->", "validate", "(", "'list'", ")", ";", "$", ...
Display a listing of the resource. @param int|null $id Id used for nested resources @return \Illuminate\Http\JsonResponse
[ "Display", "a", "listing", "of", "the", "resource", "." ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/ContentTranslationController.php#L61-L79
GrupaZero/api
src/Gzero/Api/Controller/Admin/ContentTranslationController.php
ContentTranslationController.show
public function show($id, $translationId) { $content = $this->getContent($id); if (!empty($content)) { $this->authorize('read', $content); $translation = $this->repository->getContentTranslationById($content, $translationId); if (!empty($translation)) { ...
php
public function show($id, $translationId) { $content = $this->getContent($id); if (!empty($content)) { $this->authorize('read', $content); $translation = $this->repository->getContentTranslationById($content, $translationId); if (!empty($translation)) { ...
[ "public", "function", "show", "(", "$", "id", ",", "$", "translationId", ")", "{", "$", "content", "=", "$", "this", "->", "getContent", "(", "$", "id", ")", ";", "if", "(", "!", "empty", "(", "$", "content", ")", ")", "{", "$", "this", "->", "...
Display a specified resource. @param int $id Id of the content @param int $translationId Id of the content translation @return \Illuminate\Http\JsonResponse
[ "Display", "a", "specified", "resource", "." ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/ContentTranslationController.php#L89-L100
GrupaZero/api
src/Gzero/Api/Controller/Admin/ContentTranslationController.php
ContentTranslationController.store
public function store($id) { $content = $this->getContent($id); if (!empty($content)) { $this->authorize('create', $content); $this->authorize('update', $content); $input = $this->validator->validate('create'); $translation = $this->repository->c...
php
public function store($id) { $content = $this->getContent($id); if (!empty($content)) { $this->authorize('create', $content); $this->authorize('update', $content); $input = $this->validator->validate('create'); $translation = $this->repository->c...
[ "public", "function", "store", "(", "$", "id", ")", "{", "$", "content", "=", "$", "this", "->", "getContent", "(", "$", "id", ")", ";", "if", "(", "!", "empty", "(", "$", "content", ")", ")", "{", "$", "this", "->", "authorize", "(", "'create'",...
Stores newly created translation for specified content entity in database. @param int $id Id of the content @return \Illuminate\Http\JsonResponse
[ "Stores", "newly", "created", "translation", "for", "specified", "content", "entity", "in", "database", "." ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/ContentTranslationController.php#L109-L120
GrupaZero/api
src/Gzero/Api/Controller/Admin/ContentTranslationController.php
ContentTranslationController.destroy
public function destroy($id, $translationId) { $content = $this->getContent($id); if (!empty($content)) { $this->authorize('delete', $content); $translation = $this->repository->getContentTranslationById($content, $translationId); if (!empty($translation)) { ...
php
public function destroy($id, $translationId) { $content = $this->getContent($id); if (!empty($content)) { $this->authorize('delete', $content); $translation = $this->repository->getContentTranslationById($content, $translationId); if (!empty($translation)) { ...
[ "public", "function", "destroy", "(", "$", "id", ",", "$", "translationId", ")", "{", "$", "content", "=", "$", "this", "->", "getContent", "(", "$", "id", ")", ";", "if", "(", "!", "empty", "(", "$", "content", ")", ")", "{", "$", "this", "->", ...
Remove the specified resource from database. @param int $id Id of the content @param int $translationId Id of the content translation @return \Illuminate\Http\JsonResponse
[ "Remove", "the", "specified", "resource", "from", "database", "." ]
train
https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/ContentTranslationController.php#L142-L154
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.add
public function add( $id, $parentId, $blockType, array $options = [], $siblingId = null, $prepend = null ) { $this->layoutManipulator->add($id, $parentId, $blockType, $options, $siblingId, $prepend); return $this; }
php
public function add( $id, $parentId, $blockType, array $options = [], $siblingId = null, $prepend = null ) { $this->layoutManipulator->add($id, $parentId, $blockType, $options, $siblingId, $prepend); return $this; }
[ "public", "function", "add", "(", "$", "id", ",", "$", "parentId", ",", "$", "blockType", ",", "array", "$", "options", "=", "[", "]", ",", "$", "siblingId", "=", "null", ",", "$", "prepend", "=", "null", ")", "{", "$", "this", "->", "layoutManipul...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L66-L77
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.move
public function move($id, $parentId = null, $siblingId = null, $prepend = null) { $this->layoutManipulator->move($id, $parentId, $siblingId, $prepend); return $this; }
php
public function move($id, $parentId = null, $siblingId = null, $prepend = null) { $this->layoutManipulator->move($id, $parentId, $siblingId, $prepend); return $this; }
[ "public", "function", "move", "(", "$", "id", ",", "$", "parentId", "=", "null", ",", "$", "siblingId", "=", "null", ",", "$", "prepend", "=", "null", ")", "{", "$", "this", "->", "layoutManipulator", "->", "move", "(", "$", "id", ",", "$", "parent...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L92-L97
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.setOption
public function setOption($id, $optionName, $optionValue) { $this->layoutManipulator->setOption($id, $optionName, $optionValue); return $this; }
php
public function setOption($id, $optionName, $optionValue) { $this->layoutManipulator->setOption($id, $optionName, $optionValue); return $this; }
[ "public", "function", "setOption", "(", "$", "id", ",", "$", "optionName", ",", "$", "optionValue", ")", "{", "$", "this", "->", "layoutManipulator", "->", "setOption", "(", "$", "id", ",", "$", "optionName", ",", "$", "optionValue", ")", ";", "return", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L122-L127
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.appendOption
public function appendOption($id, $optionName, $optionValue) { $this->layoutManipulator->appendOption($id, $optionName, $optionValue); return $this; }
php
public function appendOption($id, $optionName, $optionValue) { $this->layoutManipulator->appendOption($id, $optionName, $optionValue); return $this; }
[ "public", "function", "appendOption", "(", "$", "id", ",", "$", "optionName", ",", "$", "optionValue", ")", "{", "$", "this", "->", "layoutManipulator", "->", "appendOption", "(", "$", "id", ",", "$", "optionName", ",", "$", "optionValue", ")", ";", "ret...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L132-L137
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.subtractOption
public function subtractOption($id, $optionName, $optionValue) { $this->layoutManipulator->subtractOption($id, $optionName, $optionValue); return $this; }
php
public function subtractOption($id, $optionName, $optionValue) { $this->layoutManipulator->subtractOption($id, $optionName, $optionValue); return $this; }
[ "public", "function", "subtractOption", "(", "$", "id", ",", "$", "optionName", ",", "$", "optionValue", ")", "{", "$", "this", "->", "layoutManipulator", "->", "subtractOption", "(", "$", "id", ",", "$", "optionName", ",", "$", "optionValue", ")", ";", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L142-L147
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.replaceOption
public function replaceOption($id, $optionName, $oldOptionValue, $newOptionValue) { $this->layoutManipulator->replaceOption($id, $optionName, $oldOptionValue, $newOptionValue); return $this; }
php
public function replaceOption($id, $optionName, $oldOptionValue, $newOptionValue) { $this->layoutManipulator->replaceOption($id, $optionName, $oldOptionValue, $newOptionValue); return $this; }
[ "public", "function", "replaceOption", "(", "$", "id", ",", "$", "optionName", ",", "$", "oldOptionValue", ",", "$", "newOptionValue", ")", "{", "$", "this", "->", "layoutManipulator", "->", "replaceOption", "(", "$", "id", ",", "$", "optionName", ",", "$"...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L152-L157
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.changeBlockType
public function changeBlockType($id, $blockType, $optionsCallback = null) { $this->layoutManipulator->changeBlockType($id, $blockType, $optionsCallback); return $this; }
php
public function changeBlockType($id, $blockType, $optionsCallback = null) { $this->layoutManipulator->changeBlockType($id, $blockType, $optionsCallback); return $this; }
[ "public", "function", "changeBlockType", "(", "$", "id", ",", "$", "blockType", ",", "$", "optionsCallback", "=", "null", ")", "{", "$", "this", "->", "layoutManipulator", "->", "changeBlockType", "(", "$", "id", ",", "$", "blockType", ",", "$", "optionsCa...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L172-L177
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.setBlockTheme
public function setBlockTheme($themes, $id = null) { $this->layoutManipulator->setBlockTheme($themes, $id); return $this; }
php
public function setBlockTheme($themes, $id = null) { $this->layoutManipulator->setBlockTheme($themes, $id); return $this; }
[ "public", "function", "setBlockTheme", "(", "$", "themes", ",", "$", "id", "=", "null", ")", "{", "$", "this", "->", "layoutManipulator", "->", "setBlockTheme", "(", "$", "themes", ",", "$", "id", ")", ";", "return", "$", "this", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L182-L187
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.getLayout
public function getLayout(ContextInterface $context, $rootId = null) { if (!$context->isResolved()) { $this->registry->configureContext($context); $context->resolve(); } $this->layoutManipulator->applyChanges($context); $rawLayout = $this->rawLayoutBuilder->g...
php
public function getLayout(ContextInterface $context, $rootId = null) { if (!$context->isResolved()) { $this->registry->configureContext($context); $context->resolve(); } $this->layoutManipulator->applyChanges($context); $rawLayout = $this->rawLayoutBuilder->g...
[ "public", "function", "getLayout", "(", "ContextInterface", "$", "context", ",", "$", "rootId", "=", "null", ")", "{", "if", "(", "!", "$", "context", "->", "isResolved", "(", ")", ")", "{", "$", "this", "->", "registry", "->", "configureContext", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L213-L261
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.processBlockViewData
protected function processBlockViewData( BlockView $blockView, ContextInterface $context, DataAccessor $data, $deferred, $encoding ) { if ($deferred) { $this->expressionProcessor->processExpressions($blockView->vars, $context, $data, true, $encoding); ...
php
protected function processBlockViewData( BlockView $blockView, ContextInterface $context, DataAccessor $data, $deferred, $encoding ) { if ($deferred) { $this->expressionProcessor->processExpressions($blockView->vars, $context, $data, true, $encoding); ...
[ "protected", "function", "processBlockViewData", "(", "BlockView", "$", "blockView", ",", "ContextInterface", "$", "context", ",", "DataAccessor", "$", "data", ",", "$", "deferred", ",", "$", "encoding", ")", "{", "if", "(", "$", "deferred", ")", "{", "$", ...
Processes expressions that work with data @param BlockView $blockView @param ContextInterface $context @param DataAccessor $data @param bool $deferred @param string $encoding
[ "Processes", "expressions", "that", "work", "with", "data" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L282-L302
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.getRootView
private function getRootView(BlockView $rootView, $rootId) { if ($rootId !== null) { $rootView = $this->findBlockById($rootView, $rootId); if ($rootView === null) { throw new BlockViewNotFoundException(sprintf("BlockView with id \"%s\" is not found.", $rootId)); ...
php
private function getRootView(BlockView $rootView, $rootId) { if ($rootId !== null) { $rootView = $this->findBlockById($rootView, $rootId); if ($rootView === null) { throw new BlockViewNotFoundException(sprintf("BlockView with id \"%s\" is not found.", $rootId)); ...
[ "private", "function", "getRootView", "(", "BlockView", "$", "rootView", ",", "$", "rootId", ")", "{", "if", "(", "$", "rootId", "!==", "null", ")", "{", "$", "rootView", "=", "$", "this", "->", "findBlockById", "(", "$", "rootView", ",", "$", "rootId"...
@param BlockView $rootView @param int|null $rootId @return BlockView @throws BlockViewNotFoundException
[ "@param", "BlockView", "$rootView", "@param", "int|null", "$rootId" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L326-L336
oroinc/OroLayoutComponent
LayoutBuilder.php
LayoutBuilder.findBlockById
private function findBlockById(BlockView $blockView, $id) { foreach ($blockView->children as $childView) { if ($childView->getId() === $id) { return $childView; } $childView = $this->findBlockById($childView, $id); if ($childView) { ...
php
private function findBlockById(BlockView $blockView, $id) { foreach ($blockView->children as $childView) { if ($childView->getId() === $id) { return $childView; } $childView = $this->findBlockById($childView, $id); if ($childView) { ...
[ "private", "function", "findBlockById", "(", "BlockView", "$", "blockView", ",", "$", "id", ")", "{", "foreach", "(", "$", "blockView", "->", "children", "as", "$", "childView", ")", "{", "if", "(", "$", "childView", "->", "getId", "(", ")", "===", "$"...
@param BlockView $blockView @param int $id @return BlockView|null
[ "@param", "BlockView", "$blockView", "@param", "int", "$id" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutBuilder.php#L344-L358
ekuiter/feature-php
FeaturePhp/Specification/FileSpecification.php
FileSpecification.fromArrayAndSettings
public static function fromArrayAndSettings($cfg, $settings, $artifact = null) { $fileSpecification = new static($cfg, $settings->getDirectory(), $artifact); $fileSpecification->set("relativeSource", $fileSpecification->getSource()); $fileSpecification->set("source", $settings->getPath($fileSpec...
php
public static function fromArrayAndSettings($cfg, $settings, $artifact = null) { $fileSpecification = new static($cfg, $settings->getDirectory(), $artifact); $fileSpecification->set("relativeSource", $fileSpecification->getSource()); $fileSpecification->set("source", $settings->getPath($fileSpec...
[ "public", "static", "function", "fromArrayAndSettings", "(", "$", "cfg", ",", "$", "settings", ",", "$", "artifact", "=", "null", ")", "{", "$", "fileSpecification", "=", "new", "static", "(", "$", "cfg", ",", "$", "settings", "->", "getDirectory", "(", ...
Creates a file specification from a plain settings array. The settings context is taken into consideration to generate paths relative to the settings. @param array $cfg a plain settings array @param \FeaturePhp\Settings $settings the settings context @param \FeaturePhp\Artifact\Artifact $artifact @return FileSpecificat...
[ "Creates", "a", "file", "specification", "from", "a", "plain", "settings", "array", ".", "The", "settings", "context", "is", "taken", "into", "consideration", "to", "generate", "paths", "relative", "to", "the", "settings", "." ]
train
https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Specification/FileSpecification.php#L56-L67
shawm11/iron-crypto-php
src/Iron.php
Iron.normalizePassword
protected function normalizePassword($password) { $obj = []; if (is_array($password)) { $obj['id'] = $password['id']; $obj['encryption'] = (isset($password['secret']) && $password['secret'] !== null) ? $password['secret'] : $password['encrypti...
php
protected function normalizePassword($password) { $obj = []; if (is_array($password)) { $obj['id'] = $password['id']; $obj['encryption'] = (isset($password['secret']) && $password['secret'] !== null) ? $password['secret'] : $password['encrypti...
[ "protected", "function", "normalizePassword", "(", "$", "password", ")", "{", "$", "obj", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "password", ")", ")", "{", "$", "obj", "[", "'id'", "]", "=", "$", "password", "[", "'id'", "]", ";", "...
Normalizes a password parameter into a [ id, encryption, integrity ] object @param string|array $password String or object with [ id, secret ] or [ id, encryption, integrity ] @return array
[ "Normalizes", "a", "password", "parameter", "into", "a", "[", "id", "encryption", "integrity", "]", "object" ]
train
https://github.com/shawm11/iron-crypto-php/blob/854898f24ff4eed945247452f84e9c0636c20233/src/Iron.php#L386-L404
SporkCode/Spork
src/Mvc/Listener/Limit/Limit.php
Limit.setInterval
public function setInterval($interval) { $this->interval = $interval instanceof DateInterval ? $interval : new DateInterval($interval); return $this; }
php
public function setInterval($interval) { $this->interval = $interval instanceof DateInterval ? $interval : new DateInterval($interval); return $this; }
[ "public", "function", "setInterval", "(", "$", "interval", ")", "{", "$", "this", "->", "interval", "=", "$", "interval", "instanceof", "DateInterval", "?", "$", "interval", ":", "new", "DateInterval", "(", "$", "interval", ")", ";", "return", "$", "this",...
Set the limit interval @param string|DateInterval $interval @return \Spork\Mvc\Listener\Limit\Limit
[ "Set", "the", "limit", "interval" ]
train
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Listener/Limit/Limit.php#L115-L119
execut/yii2-base
Bootstrap.php
Bootstrap.bootstrap
public function bootstrap($app) { if ($this->isBootstrapI18n) { $this->bootstrapI18n($app); } $bootstraps = []; foreach ($this->getDepends() as $key => $depends) { foreach ($depends as $name => $depend) { switch ($key) { ca...
php
public function bootstrap($app) { if ($this->isBootstrapI18n) { $this->bootstrapI18n($app); } $bootstraps = []; foreach ($this->getDepends() as $key => $depends) { foreach ($depends as $name => $depend) { switch ($key) { ca...
[ "public", "function", "bootstrap", "(", "$", "app", ")", "{", "if", "(", "$", "this", "->", "isBootstrapI18n", ")", "{", "$", "this", "->", "bootstrapI18n", "(", "$", "app", ")", ";", "}", "$", "bootstraps", "=", "[", "]", ";", "foreach", "(", "$",...
Bootstrap method to be called during application bootstrap stage. @param Application $app the application currently running
[ "Bootstrap", "method", "to", "be", "called", "during", "application", "bootstrap", "stage", "." ]
train
https://github.com/execut/yii2-base/blob/e3634df539b94abb6751581c005a449e769845fa/Bootstrap.php#L59-L122
SporkCode/Spork
src/Mvc/Controller/Plugin/Back.php
Back.attach
public function attach(EventManagerInterface $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array( $this, 'injectPlugin' ), 100); $this->listeners[] = $events->attach(MvcEvent::EVENT_FINISH, array( ...
php
public function attach(EventManagerInterface $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array( $this, 'injectPlugin' ), 100); $this->listeners[] = $events->attach(MvcEvent::EVENT_FINISH, array( ...
[ "public", "function", "attach", "(", "EventManagerInterface", "$", "events", ")", "{", "$", "this", "->", "listeners", "[", "]", "=", "$", "events", "->", "attach", "(", "MvcEvent", "::", "EVENT_DISPATCH", ",", "array", "(", "$", "this", ",", "'injectPlugi...
Attach listeners @see \Zend\EventManager\ListenerAggregateInterface::attach() @param EventManagerInterface $events
[ "Attach", "listeners" ]
train
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/Plugin/Back.php#L53-L65
SporkCode/Spork
src/Mvc/Controller/Plugin/Back.php
Back.redirect
public function redirect($default = 'home') { $redirect = $this->getController()->plugin('redirect'); $route = $this->getSession()->route; if (null === $route) { return $redirect->toRoute($default); } return $redirect->toRoute($route->getMatchedRouteName(), ...
php
public function redirect($default = 'home') { $redirect = $this->getController()->plugin('redirect'); $route = $this->getSession()->route; if (null === $route) { return $redirect->toRoute($default); } return $redirect->toRoute($route->getMatchedRouteName(), ...
[ "public", "function", "redirect", "(", "$", "default", "=", "'home'", ")", "{", "$", "redirect", "=", "$", "this", "->", "getController", "(", ")", "->", "plugin", "(", "'redirect'", ")", ";", "$", "route", "=", "$", "this", "->", "getSession", "(", ...
Redirect to last route @param string $default Default route to use if previous route not found
[ "Redirect", "to", "last", "route" ]
train
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/Plugin/Back.php#L116-L125
SporkCode/Spork
src/Mvc/Controller/Plugin/Back.php
Back.url
public function url($default = 'home') { $url = $this->getController()->plugin('url'); $route = $this->getSession()->route; if (null === $route) { return $url->fromRoute($default); } return $url->fromRoute($route->getMatchedRouteName(), $route->getPar...
php
public function url($default = 'home') { $url = $this->getController()->plugin('url'); $route = $this->getSession()->route; if (null === $route) { return $url->fromRoute($default); } return $url->fromRoute($route->getMatchedRouteName(), $route->getPar...
[ "public", "function", "url", "(", "$", "default", "=", "'home'", ")", "{", "$", "url", "=", "$", "this", "->", "getController", "(", ")", "->", "plugin", "(", "'url'", ")", ";", "$", "route", "=", "$", "this", "->", "getSession", "(", ")", "->", ...
Get last route URL @param string $default
[ "Get", "last", "route", "URL" ]
train
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/Plugin/Back.php#L132-L141
SporkCode/Spork
src/Mvc/Controller/Plugin/Back.php
Back.storeRoute
public function storeRoute(MvcEvent $event) { if ($this->ignore) { return; } $request = $event->getRequest(); if ($request->isXmlHttpRequest()) { return; } $appConfig = $event->getApplication() ->getServiceManager(...
php
public function storeRoute(MvcEvent $event) { if ($this->ignore) { return; } $request = $event->getRequest(); if ($request->isXmlHttpRequest()) { return; } $appConfig = $event->getApplication() ->getServiceManager(...
[ "public", "function", "storeRoute", "(", "MvcEvent", "$", "event", ")", "{", "if", "(", "$", "this", "->", "ignore", ")", "{", "return", ";", "}", "$", "request", "=", "$", "event", "->", "getRequest", "(", ")", ";", "if", "(", "$", "request", "->"...
Store route in session so it can be returned to later. @param MvcEvent $event
[ "Store", "route", "in", "session", "so", "it", "can", "be", "returned", "to", "later", "." ]
train
https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Controller/Plugin/Back.php#L162-L188
HedronDev/hedron
src/Parser/Rsync.php
Rsync.parse
public function parse(GitPostReceiveHandler $handler, CommandStackInterface $commandStack) { $config = $this->getConfiguration(); $environment = $this->getEnvironment(); $commandStack->addCommand("rsync -av --exclude=docker --exclude=.git {$environment->getGitDirectory()}/{$config->getBranch()}/ {$this->get...
php
public function parse(GitPostReceiveHandler $handler, CommandStackInterface $commandStack) { $config = $this->getConfiguration(); $environment = $this->getEnvironment(); $commandStack->addCommand("rsync -av --exclude=docker --exclude=.git {$environment->getGitDirectory()}/{$config->getBranch()}/ {$this->get...
[ "public", "function", "parse", "(", "GitPostReceiveHandler", "$", "handler", ",", "CommandStackInterface", "$", "commandStack", ")", "{", "$", "config", "=", "$", "this", "->", "getConfiguration", "(", ")", ";", "$", "environment", "=", "$", "this", "->", "g...
{@inheritdoc}
[ "{" ]
train
https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Parser/Rsync.php#L18-L23
windwork/wf-db
lib/adapter/PDOMySQL.php
PDOMySQL.commit
public function commit() { if ($this->rollbackAgain) { throw new \wf\db\Exception('Please throw exception after rollback in last catch block'); } --$this->transactions; if($this->transactions == 0 && false === $this->dbh->commit()) { throw new \wf\db\Exc...
php
public function commit() { if ($this->rollbackAgain) { throw new \wf\db\Exception('Please throw exception after rollback in last catch block'); } --$this->transactions; if($this->transactions == 0 && false === $this->dbh->commit()) { throw new \wf\db\Exc...
[ "public", "function", "commit", "(", ")", "{", "if", "(", "$", "this", "->", "rollbackAgain", ")", "{", "throw", "new", "\\", "wf", "\\", "db", "\\", "Exception", "(", "'Please throw exception after rollback in last catch block'", ")", ";", "}", "--", "$", "...
{@inheritDoc} @see \wf\db\DBInterface::commit()
[ "{" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/PDOMySQL.php#L73-L88
windwork/wf-db
lib/adapter/PDOMySQL.php
PDOMySQL.query
public function query($sql, array $args = []) { if ($args) { $sql = \wf\db\QueryBuilder::format($sql, $args); } $sql = \wf\db\QueryBuilder::tablePrefix($sql, $this->cfg['tablePrefix']); // 记录数据库查询次数 $this->execTimes ++; $this->...
php
public function query($sql, array $args = []) { if ($args) { $sql = \wf\db\QueryBuilder::format($sql, $args); } $sql = \wf\db\QueryBuilder::tablePrefix($sql, $this->cfg['tablePrefix']); // 记录数据库查询次数 $this->execTimes ++; $this->...
[ "public", "function", "query", "(", "$", "sql", ",", "array", "$", "args", "=", "[", "]", ")", "{", "if", "(", "$", "args", ")", "{", "$", "sql", "=", "\\", "wf", "\\", "db", "\\", "QueryBuilder", "::", "format", "(", "$", "sql", ",", "$", "a...
{@inheritDoc} @see \wf\db\DBInterface::query()
[ "{" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/PDOMySQL.php#L104-L122
windwork/wf-db
lib/adapter/PDOMySQL.php
PDOMySQL.getAll
public function getAll($sql, array $args = []) { $query = $this->query($sql, $args); if (!$query) { return []; } $rs = $query->fetchAll(\PDO::FETCH_ASSOC); return $rs; }
php
public function getAll($sql, array $args = []) { $query = $this->query($sql, $args); if (!$query) { return []; } $rs = $query->fetchAll(\PDO::FETCH_ASSOC); return $rs; }
[ "public", "function", "getAll", "(", "$", "sql", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "query", "=", "$", "this", "->", "query", "(", "$", "sql", ",", "$", "args", ")", ";", "if", "(", "!", "$", "query", ")", "{", "return",...
{@inheritDoc} @see \wf\db\DBInterface::getAll()
[ "{" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/PDOMySQL.php#L154-L163
windwork/wf-db
lib/adapter/PDOMySQL.php
PDOMySQL.getRow
public function getRow($sql, array $args = []) { $query = $this->query($sql, $args); if (!$query) { return []; } $rs = $query->fetch(\PDO::FETCH_ASSOC); return $rs; }
php
public function getRow($sql, array $args = []) { $query = $this->query($sql, $args); if (!$query) { return []; } $rs = $query->fetch(\PDO::FETCH_ASSOC); return $rs; }
[ "public", "function", "getRow", "(", "$", "sql", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "query", "=", "$", "this", "->", "query", "(", "$", "sql", ",", "$", "args", ")", ";", "if", "(", "!", "$", "query", ")", "{", "return",...
{@inheritDoc} @see \wf\db\DBInterface::getRow()
[ "{" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/PDOMySQL.php#L169-L178
windwork/wf-db
lib/adapter/PDOMySQL.php
PDOMySQL.getColumn
public function getColumn($sql, array $args = []) { $query = $this->query($sql, $args); if (!$query) { return null; } $value = $query->fetchColumn(); return $value; }
php
public function getColumn($sql, array $args = []) { $query = $this->query($sql, $args); if (!$query) { return null; } $value = $query->fetchColumn(); return $value; }
[ "public", "function", "getColumn", "(", "$", "sql", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "query", "=", "$", "this", "->", "query", "(", "$", "sql", ",", "$", "args", ")", ";", "if", "(", "!", "$", "query", ")", "{", "retur...
{@inheritDoc} @see \wf\db\DBInterface::getColumn()
[ "{" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/PDOMySQL.php#L184-L194
windwork/wf-db
lib/adapter/PDOMySQL.php
PDOMySQL.setAutoCommit
public function setAutoCommit($isAutoCommit = false) { $this->dbh->setAttribute(\PDO::ATTR_AUTOCOMMIT, $isAutoCommit); return $this; }
php
public function setAutoCommit($isAutoCommit = false) { $this->dbh->setAttribute(\PDO::ATTR_AUTOCOMMIT, $isAutoCommit); return $this; }
[ "public", "function", "setAutoCommit", "(", "$", "isAutoCommit", "=", "false", ")", "{", "$", "this", "->", "dbh", "->", "setAttribute", "(", "\\", "PDO", "::", "ATTR_AUTOCOMMIT", ",", "$", "isAutoCommit", ")", ";", "return", "$", "this", ";", "}" ]
{@inheritDoc} @see \wf\db\DBInterface::setAutoCommit()
[ "{" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/PDOMySQL.php#L209-L214
windwork/wf-db
lib/adapter/PDOMySQL.php
PDOMySQL.rollback
public function rollback() { // 事务链中一旦出现异常,为避免事务链中异常后面的SQL还执行,应返回到第一个事务再回滚 if ($this->transactions -- > 1) { $this->rollbackAgain = true; return; } $this->rollbackAgain = false; // 出现异常立即回滚,回滚后再出现commit则应该抛出异常 if (false === $this->dbh->rollba...
php
public function rollback() { // 事务链中一旦出现异常,为避免事务链中异常后面的SQL还执行,应返回到第一个事务再回滚 if ($this->transactions -- > 1) { $this->rollbackAgain = true; return; } $this->rollbackAgain = false; // 出现异常立即回滚,回滚后再出现commit则应该抛出异常 if (false === $this->dbh->rollba...
[ "public", "function", "rollback", "(", ")", "{", "// 事务链中一旦出现异常,为避免事务链中异常后面的SQL还执行,应返回到第一个事务再回滚", "if", "(", "$", "this", "->", "transactions", "--", ">", "1", ")", "{", "$", "this", "->", "rollbackAgain", "=", "true", ";", "return", ";", "}", "$", "this", ...
{@inheritDoc} @see \wf\db\DBInterface::rollback()
[ "{" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/PDOMySQL.php#L220-L234
brightmarch/rest-easy
src/Brightmarch/RestEasy/Controller/Controller.php
Controller.resourceSupports
public function resourceSupports() { $this->supportedTypes = array_merge(func_get_args(), $this->supportedTypes); $this->canClientAcceptThisResponse(); return $this; }
php
public function resourceSupports() { $this->supportedTypes = array_merge(func_get_args(), $this->supportedTypes); $this->canClientAcceptThisResponse(); return $this; }
[ "public", "function", "resourceSupports", "(", ")", "{", "$", "this", "->", "supportedTypes", "=", "array_merge", "(", "func_get_args", "(", ")", ",", "$", "this", "->", "supportedTypes", ")", ";", "$", "this", "->", "canClientAcceptThisResponse", "(", ")", ...
Set a list of content types that this resource supports. @param [string, string, ...] @return Controller
[ "Set", "a", "list", "of", "content", "types", "that", "this", "resource", "supports", "." ]
train
https://github.com/brightmarch/rest-easy/blob/a6903cdff0a5de2e4466d3e3438c59b9903049f4/src/Brightmarch/RestEasy/Controller/Controller.php#L42-L48
brightmarch/rest-easy
src/Brightmarch/RestEasy/Controller/Controller.php
Controller.resourceRequires
public function resourceRequires() { $this->requiredTypes = array_merge(func_get_args(), $this->requiredTypes); $this->canServerSupportThisRequest(); return $this; }
php
public function resourceRequires() { $this->requiredTypes = array_merge(func_get_args(), $this->requiredTypes); $this->canServerSupportThisRequest(); return $this; }
[ "public", "function", "resourceRequires", "(", ")", "{", "$", "this", "->", "requiredTypes", "=", "array_merge", "(", "func_get_args", "(", ")", ",", "$", "this", "->", "requiredTypes", ")", ";", "$", "this", "->", "canServerSupportThisRequest", "(", ")", ";...
Set a list of content types this resource requires. @param [string, string, ...] @return Controller
[ "Set", "a", "list", "of", "content", "types", "this", "resource", "requires", "." ]
train
https://github.com/brightmarch/rest-easy/blob/a6903cdff0a5de2e4466d3e3438c59b9903049f4/src/Brightmarch/RestEasy/Controller/Controller.php#L56-L62
brightmarch/rest-easy
src/Brightmarch/RestEasy/Controller/Controller.php
Controller.renderResource
public function renderResource($view, array $parameters=[], $statusCode=200) { $this->findContentType() ->findViewType() ->buildViewTemplate($view) ->checkViewTemplateExists(); $response = $this->createResponse($statusCode); $response->headers ...
php
public function renderResource($view, array $parameters=[], $statusCode=200) { $this->findContentType() ->findViewType() ->buildViewTemplate($view) ->checkViewTemplateExists(); $response = $this->createResponse($statusCode); $response->headers ...
[ "public", "function", "renderResource", "(", "$", "view", ",", "array", "$", "parameters", "=", "[", "]", ",", "$", "statusCode", "=", "200", ")", "{", "$", "this", "->", "findContentType", "(", ")", "->", "findViewType", "(", ")", "->", "buildViewTempla...
Creates a Response object and returns it. @param string $view @param array $parameters @param integer $statusCode @return Symfony\Component\HttpFoundation\Response
[ "Creates", "a", "Response", "object", "and", "returns", "it", "." ]
train
https://github.com/brightmarch/rest-easy/blob/a6903cdff0a5de2e4466d3e3438c59b9903049f4/src/Brightmarch/RestEasy/Controller/Controller.php#L72-L84
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php
TypeCollectionAssembler.create
public function create($data) { $collection = new DescriptorCollection(); foreach ($data as $type) { $collection->add($this->createDescriptorForType($type)); } return $collection; }
php
public function create($data) { $collection = new DescriptorCollection(); foreach ($data as $type) { $collection->add($this->createDescriptorForType($type)); } return $collection; }
[ "public", "function", "create", "(", "$", "data", ")", "{", "$", "collection", "=", "new", "DescriptorCollection", "(", ")", ";", "foreach", "(", "$", "data", "as", "$", "type", ")", "{", "$", "collection", "->", "add", "(", "$", "this", "->", "creat...
Creates a Descriptor from the provided data. @param Collection $data @return DescriptorCollection
[ "Creates", "a", "Descriptor", "from", "the", "provided", "data", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php#L34-L43
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php
TypeCollectionAssembler.createDescriptorForType
protected function createDescriptorForType($type) { if (!$this->isArrayNotation($type)) { $className = $this->findClassNameForType($type); return $className ? new $className() : new UnknownTypeDescriptor($type); } $type = $this->extractTypeFromArrayNotation($t...
php
protected function createDescriptorForType($type) { if (!$this->isArrayNotation($type)) { $className = $this->findClassNameForType($type); return $className ? new $className() : new UnknownTypeDescriptor($type); } $type = $this->extractTypeFromArrayNotation($t...
[ "protected", "function", "createDescriptorForType", "(", "$", "type", ")", "{", "if", "(", "!", "$", "this", "->", "isArrayNotation", "(", "$", "type", ")", ")", "{", "$", "className", "=", "$", "this", "->", "findClassNameForType", "(", "$", "type", ")"...
Creates a Type ValueObject (Descriptor) for the provided type string. @param string $type @return DescriptorAbstract
[ "Creates", "a", "Type", "ValueObject", "(", "Descriptor", ")", "for", "the", "provided", "type", "string", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php#L52-L66
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php
TypeCollectionAssembler.convertToArrayDescriptor
protected function convertToArrayDescriptor($descriptor) { $arrayDescriptor = new CollectionDescriptor('array'); $arrayDescriptor->setTypes(array($descriptor)); $arrayDescriptor->setKeyTypes(array('mixed')); return $arrayDescriptor; }
php
protected function convertToArrayDescriptor($descriptor) { $arrayDescriptor = new CollectionDescriptor('array'); $arrayDescriptor->setTypes(array($descriptor)); $arrayDescriptor->setKeyTypes(array('mixed')); return $arrayDescriptor; }
[ "protected", "function", "convertToArrayDescriptor", "(", "$", "descriptor", ")", "{", "$", "arrayDescriptor", "=", "new", "CollectionDescriptor", "(", "'array'", ")", ";", "$", "arrayDescriptor", "->", "setTypes", "(", "array", "(", "$", "descriptor", ")", ")",...
Wraps the given Descriptor inside a Collection Descriptor of type array and returns that. @param DescriptorAbstract $descriptor @return CollectionDescriptor
[ "Wraps", "the", "given", "Descriptor", "inside", "a", "Collection", "Descriptor", "of", "type", "array", "and", "returns", "that", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php#L99-L106
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php
TypeCollectionAssembler.findClassNameForType
protected function findClassNameForType($type) { $className = (isset($this->typeToValueObjectClassName[$type])) ? $this->typeToValueObjectClassName[$type] : false; return $className; }
php
protected function findClassNameForType($type) { $className = (isset($this->typeToValueObjectClassName[$type])) ? $this->typeToValueObjectClassName[$type] : false; return $className; }
[ "protected", "function", "findClassNameForType", "(", "$", "type", ")", "{", "$", "className", "=", "(", "isset", "(", "$", "this", "->", "typeToValueObjectClassName", "[", "$", "type", "]", ")", ")", "?", "$", "this", "->", "typeToValueObjectClassName", "["...
Returns the class name of the Value Object class associated with a given type or false if the type is unknown. @param string $type @return string|boolean
[ "Returns", "the", "class", "name", "of", "the", "Value", "Object", "class", "associated", "with", "a", "given", "type", "or", "false", "if", "the", "type", "is", "unknown", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/TypeCollectionAssembler.php#L115-L122
tequila/mongodb-odm
src/Metadata/Field/AbstractFieldMetadata.php
AbstractFieldMetadata.generateSetterProxy
protected function generateSetterProxy(AbstractGenerator $proxyGenerator) { $methodName = 'set'.StringUtil::camelize($this->propertyName); if (!$proxyGenerator->getReflection()->hasMethod($methodName)) { $proxyGenerator->addError( sprintf( 'Document cl...
php
protected function generateSetterProxy(AbstractGenerator $proxyGenerator) { $methodName = 'set'.StringUtil::camelize($this->propertyName); if (!$proxyGenerator->getReflection()->hasMethod($methodName)) { $proxyGenerator->addError( sprintf( 'Document cl...
[ "protected", "function", "generateSetterProxy", "(", "AbstractGenerator", "$", "proxyGenerator", ")", "{", "$", "methodName", "=", "'set'", ".", "StringUtil", "::", "camelize", "(", "$", "this", "->", "propertyName", ")", ";", "if", "(", "!", "$", "proxyGenera...
@param AbstractGenerator $proxyGenerator @throws \ReflectionException
[ "@param", "AbstractGenerator", "$proxyGenerator" ]
train
https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Metadata/Field/AbstractFieldMetadata.php#L137-L193
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php
ezcDbFactory.getImplementations
static public function getImplementations() { $list = array(); foreach ( self::$implementations as $name => $className ) { $list[] = $name; } return $list; }
php
static public function getImplementations() { $list = array(); foreach ( self::$implementations as $name => $className ) { $list[] = $name; } return $list; }
[ "static", "public", "function", "getImplementations", "(", ")", "{", "$", "list", "=", "array", "(", ")", ";", "foreach", "(", "self", "::", "$", "implementations", "as", "$", "name", "=>", "$", "className", ")", "{", "$", "list", "[", "]", "=", "$",...
Returns a list with supported database implementations. Example: <code> ezcDbFactory::getImplementations(); </code> @return array(string)
[ "Returns", "a", "list", "with", "supported", "database", "implementations", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php#L101-L109
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php
ezcDbFactory.create
static public function create( $dbParams ) { if ( is_string( $dbParams ) ) { $dbParams = self::parseDSN( $dbParams ); } else if ( !is_array( $dbParams ) ) { throw new ezcBaseValueException( 'dbParams', $dbParams, 'string or array', 'parameter' ); ...
php
static public function create( $dbParams ) { if ( is_string( $dbParams ) ) { $dbParams = self::parseDSN( $dbParams ); } else if ( !is_array( $dbParams ) ) { throw new ezcBaseValueException( 'dbParams', $dbParams, 'string or array', 'parameter' ); ...
[ "static", "public", "function", "create", "(", "$", "dbParams", ")", "{", "if", "(", "is_string", "(", "$", "dbParams", ")", ")", "{", "$", "dbParams", "=", "self", "::", "parseDSN", "(", "$", "dbParams", ")", ";", "}", "else", "if", "(", "!", "is_...
Creates and returns an instance of the specified ezcDbHandler implementation. Supported database parameters are: - phptype|type|handler|driver: Database implementation - user|username: Database user name - pass|password: Database user password - dbname|database: Database name - ...
[ "Creates", "and", "returns", "an", "instance", "of", "the", "specified", "ezcDbHandler", "implementation", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php#L134-L165
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php
ezcDbFactory.parseDSN
public static function parseDSN( $dsn ) { $parsed = array( 'phptype' => false, 'dbsyntax' => false, 'username' => false, 'password' => false, 'protocol' => false, 'hostspec' => false, 'port' => false, 'socke...
php
public static function parseDSN( $dsn ) { $parsed = array( 'phptype' => false, 'dbsyntax' => false, 'username' => false, 'password' => false, 'protocol' => false, 'hostspec' => false, 'port' => false, 'socke...
[ "public", "static", "function", "parseDSN", "(", "$", "dsn", ")", "{", "$", "parsed", "=", "array", "(", "'phptype'", "=>", "false", ",", "'dbsyntax'", "=>", "false", ",", "'username'", "=>", "false", ",", "'password'", "=>", "false", ",", "'protocol'", ...
Returns the Data Source Name as a structure containing the various parts of the DSN. Additional keys can be added by appending a URI query string to the end of the DSN. The format of the supplied DSN is in its fullest form: <code> phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true ...
[ "Returns", "the", "Data", "Source", "Name", "as", "a", "structure", "containing", "the", "various", "parts", "of", "the", "DSN", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/factory.php#L203-L354
gregorybesson/PlaygroundCms
src/Mapper/PageHydrator.php
PageHydrator.extract
public function extract($object) { if (!$object instanceof PageEntityInterface) { throw new Exception\InvalidArgumentException( '$object must be an instance of PlaygroundCms\Entity\PageInterface' ); } /* @var $object PageInterface*/ $data = pa...
php
public function extract($object) { if (!$object instanceof PageEntityInterface) { throw new Exception\InvalidArgumentException( '$object must be an instance of PlaygroundCms\Entity\PageInterface' ); } /* @var $object PageInterface*/ $data = pa...
[ "public", "function", "extract", "(", "$", "object", ")", "{", "if", "(", "!", "$", "object", "instanceof", "PageEntityInterface", ")", "{", "throw", "new", "Exception", "\\", "InvalidArgumentException", "(", "'$object must be an instance of PlaygroundCms\\Entity\\PageI...
Extract values from an object @param object $object @return array @throws Exception\InvalidArgumentException
[ "Extract", "values", "from", "an", "object" ]
train
https://github.com/gregorybesson/PlaygroundCms/blob/e929a283f2a6e82d4f248c930f7aa454ce20cbc3/src/Mapper/PageHydrator.php#L17-L30
EloGank/lol-replay
src/EloGank/Replay/Crypt/ReplayCrypt.php
ReplayCrypt.getBinary
public function getBinary(ReplayInterface $replay, $pathFolder, $fileId, $saveFile = false) { $path = $pathFolder . '/' . $fileId; if (!is_file($path)) { return false; } $decodedKey = base64_decode($replay->getEncryptionKey()); $decodedKey = $this->decrypt($repla...
php
public function getBinary(ReplayInterface $replay, $pathFolder, $fileId, $saveFile = false) { $path = $pathFolder . '/' . $fileId; if (!is_file($path)) { return false; } $decodedKey = base64_decode($replay->getEncryptionKey()); $decodedKey = $this->decrypt($repla...
[ "public", "function", "getBinary", "(", "ReplayInterface", "$", "replay", ",", "$", "pathFolder", ",", "$", "fileId", ",", "$", "saveFile", "=", "false", ")", "{", "$", "path", "=", "$", "pathFolder", ".", "'/'", ".", "$", "fileId", ";", "if", "(", "...
@param ReplayInterface $replay @param string $pathFolder @param int $fileId @param bool $saveFile @return string
[ "@param", "ReplayInterface", "$replay", "@param", "string", "$pathFolder", "@param", "int", "$fileId", "@param", "bool", "$saveFile" ]
train
https://github.com/EloGank/lol-replay/blob/cddfded8a71fe9e24e13624d4eae97e087c7b380/src/EloGank/Replay/Crypt/ReplayCrypt.php#L43-L63
EloGank/lol-replay
src/EloGank/Replay/Crypt/ReplayCrypt.php
ReplayCrypt.encrypt
protected function encrypt($key, $text) { $size = mcrypt_get_block_size('blowfish', 'ecb'); $input = $this->pkcs5_pad($text, $size); $td = mcrypt_module_open('blowfish', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td...
php
protected function encrypt($key, $text) { $size = mcrypt_get_block_size('blowfish', 'ecb'); $input = $this->pkcs5_pad($text, $size); $td = mcrypt_module_open('blowfish', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td...
[ "protected", "function", "encrypt", "(", "$", "key", ",", "$", "text", ")", "{", "$", "size", "=", "mcrypt_get_block_size", "(", "'blowfish'", ",", "'ecb'", ")", ";", "$", "input", "=", "$", "this", "->", "pkcs5_pad", "(", "$", "text", ",", "$", "siz...
@param string $key @param string $text @return string
[ "@param", "string", "$key", "@param", "string", "$text" ]
train
https://github.com/EloGank/lol-replay/blob/cddfded8a71fe9e24e13624d4eae97e087c7b380/src/EloGank/Replay/Crypt/ReplayCrypt.php#L71-L84
EloGank/lol-replay
src/EloGank/Replay/Crypt/ReplayCrypt.php
ReplayCrypt.decrypt
protected function decrypt($key, $text) { $td = mcrypt_module_open('blowfish', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key , $iv); $data = mdecrypt_generic($td, $text); mcrypt_generic_deinit($td); m...
php
protected function decrypt($key, $text) { $td = mcrypt_module_open('blowfish', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key , $iv); $data = mdecrypt_generic($td, $text); mcrypt_generic_deinit($td); m...
[ "protected", "function", "decrypt", "(", "$", "key", ",", "$", "text", ")", "{", "$", "td", "=", "mcrypt_module_open", "(", "'blowfish'", ",", "''", ",", "'ecb'", ",", "''", ")", ";", "$", "iv", "=", "mcrypt_create_iv", "(", "mcrypt_enc_get_iv_size", "("...
@param string $key @param string $text @return bool|string
[ "@param", "string", "$key", "@param", "string", "$text" ]
train
https://github.com/EloGank/lol-replay/blob/cddfded8a71fe9e24e13624d4eae97e087c7b380/src/EloGank/Replay/Crypt/ReplayCrypt.php#L92-L105
EloGank/lol-replay
src/EloGank/Replay/Crypt/ReplayCrypt.php
ReplayCrypt.pkcs5_pad
protected function pkcs5_pad($string) { $blocksize = mcrypt_get_block_size('blowfish', 'ecb'); $pad = $blocksize - (mb_strlen($string) % $blocksize); return $string . str_repeat(chr($pad), $pad); }
php
protected function pkcs5_pad($string) { $blocksize = mcrypt_get_block_size('blowfish', 'ecb'); $pad = $blocksize - (mb_strlen($string) % $blocksize); return $string . str_repeat(chr($pad), $pad); }
[ "protected", "function", "pkcs5_pad", "(", "$", "string", ")", "{", "$", "blocksize", "=", "mcrypt_get_block_size", "(", "'blowfish'", ",", "'ecb'", ")", ";", "$", "pad", "=", "$", "blocksize", "-", "(", "mb_strlen", "(", "$", "string", ")", "%", "$", ...
@param string $string @return string
[ "@param", "string", "$string" ]
train
https://github.com/EloGank/lol-replay/blob/cddfded8a71fe9e24e13624d4eae97e087c7b380/src/EloGank/Replay/Crypt/ReplayCrypt.php#L112-L118
EloGank/lol-replay
src/EloGank/Replay/Crypt/ReplayCrypt.php
ReplayCrypt.pkcs5_unpad
protected function pkcs5_unpad($string) { $pad = ord($string{strlen($string)-1}); if ($pad > strlen($string)) { return false; } if (strspn($string, chr($pad), strlen($string) - $pad) != $pad) { return false; } return substr($string, 0, -1 * $...
php
protected function pkcs5_unpad($string) { $pad = ord($string{strlen($string)-1}); if ($pad > strlen($string)) { return false; } if (strspn($string, chr($pad), strlen($string) - $pad) != $pad) { return false; } return substr($string, 0, -1 * $...
[ "protected", "function", "pkcs5_unpad", "(", "$", "string", ")", "{", "$", "pad", "=", "ord", "(", "$", "string", "{", "strlen", "(", "$", "string", ")", "-", "1", "}", ")", ";", "if", "(", "$", "pad", ">", "strlen", "(", "$", "string", ")", ")...
@param string $string @return bool|string
[ "@param", "string", "$string" ]
train
https://github.com/EloGank/lol-replay/blob/cddfded8a71fe9e24e13624d4eae97e087c7b380/src/EloGank/Replay/Crypt/ReplayCrypt.php#L125-L137
php-lug/lug
src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php
Repository.findForIndex
public function findForIndex(array $criteria, array $orderBy = []) { return new Pagerfanta(new DoctrineODMMongoDBAdapter($this->buildQueryBuilder($criteria, $orderBy, true))); }
php
public function findForIndex(array $criteria, array $orderBy = []) { return new Pagerfanta(new DoctrineODMMongoDBAdapter($this->buildQueryBuilder($criteria, $orderBy, true))); }
[ "public", "function", "findForIndex", "(", "array", "$", "criteria", ",", "array", "$", "orderBy", "=", "[", "]", ")", "{", "return", "new", "Pagerfanta", "(", "new", "DoctrineODMMongoDBAdapter", "(", "$", "this", "->", "buildQueryBuilder", "(", "$", "criter...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php#L55-L58
php-lug/lug
src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php
Repository.findBy
public function findBy(array $criteria, array $orderBy = [], $limit = null, $offset = null) { $queryBuilder = $this->buildQueryBuilder($criteria, $orderBy); if ($limit !== null) { $queryBuilder->limit($limit); } if ($offset !== null) { $queryBuilder->skip($o...
php
public function findBy(array $criteria, array $orderBy = [], $limit = null, $offset = null) { $queryBuilder = $this->buildQueryBuilder($criteria, $orderBy); if ($limit !== null) { $queryBuilder->limit($limit); } if ($offset !== null) { $queryBuilder->skip($o...
[ "public", "function", "findBy", "(", "array", "$", "criteria", ",", "array", "$", "orderBy", "=", "[", "]", ",", "$", "limit", "=", "null", ",", "$", "offset", "=", "null", ")", "{", "$", "queryBuilder", "=", "$", "this", "->", "buildQueryBuilder", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php#L95-L108
php-lug/lug
src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php
Repository.getProperty
public function getProperty($property, $root = null) { if (is_string($root) && !empty($root)) { return $root.'.'.$property; } return $property; }
php
public function getProperty($property, $root = null) { if (is_string($root) && !empty($root)) { return $root.'.'.$property; } return $property; }
[ "public", "function", "getProperty", "(", "$", "property", ",", "$", "root", "=", "null", ")", "{", "if", "(", "is_string", "(", "$", "root", ")", "&&", "!", "empty", "(", "$", "root", ")", ")", "{", "return", "$", "root", ".", "'.'", ".", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php#L129-L136
php-lug/lug
src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php
Repository.buildQueryBuilder
protected function buildQueryBuilder(array $criteria, array $orderBy, $collection = false) { $queryBuilder = $collection ? $this->createQueryBuilderForCollection() : $this->createQueryBuilder(); $this->applyCriteria($queryBuilder, $criteria); $this->applySorting($queryBuilder, $orderBy); ...
php
protected function buildQueryBuilder(array $criteria, array $orderBy, $collection = false) { $queryBuilder = $collection ? $this->createQueryBuilderForCollection() : $this->createQueryBuilder(); $this->applyCriteria($queryBuilder, $criteria); $this->applySorting($queryBuilder, $orderBy); ...
[ "protected", "function", "buildQueryBuilder", "(", "array", "$", "criteria", ",", "array", "$", "orderBy", ",", "$", "collection", "=", "false", ")", "{", "$", "queryBuilder", "=", "$", "collection", "?", "$", "this", "->", "createQueryBuilderForCollection", "...
@param mixed[] $criteria @param string[] $orderBy @param bool $collection @return Builder
[ "@param", "mixed", "[]", "$criteria", "@param", "string", "[]", "$orderBy", "@param", "bool", "$collection" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/MongoDB/Repository.php#L145-L153
sergmoro1/yii2-lookup
src/migrations/m180709_092055_update_lookup.php
m180709_092055_update_lookup.up
public function up() { $this->addColumn(self::TABLE, 'property_id', $this->integer()); $property = null; foreach(Lookup::find()->all() as $item) { if(!($property && $property->name == $item->type)) { if(!($property = Property::findOne(['name' => $item->type]))) { ...
php
public function up() { $this->addColumn(self::TABLE, 'property_id', $this->integer()); $property = null; foreach(Lookup::find()->all() as $item) { if(!($property && $property->name == $item->type)) { if(!($property = Property::findOne(['name' => $item->type]))) { ...
[ "public", "function", "up", "(", ")", "{", "$", "this", "->", "addColumn", "(", "self", "::", "TABLE", ",", "'property_id'", ",", "$", "this", "->", "integer", "(", ")", ")", ";", "$", "property", "=", "null", ";", "foreach", "(", "Lookup", "::", "...
Use up()/down() to run migration code without a transaction.
[ "Use", "up", "()", "/", "down", "()", "to", "run", "migration", "code", "without", "a", "transaction", "." ]
train
https://github.com/sergmoro1/yii2-lookup/blob/deff08a2612b3c54d313a6c60a74fcaae1193b21/src/migrations/m180709_092055_update_lookup.php#L16-L35
frdl/webfan
.ApplicationComposer/lib/webdof/Text/diff/Compare.php
Compare.minimize
public function minimize($diff) { foreach($diff as $step => $d) { if($diff[$step][0] !== self::DEL)$diff[$step][1] = NULL; } return $diff; }
php
public function minimize($diff) { foreach($diff as $step => $d) { if($diff[$step][0] !== self::DEL)$diff[$step][1] = NULL; } return $diff; }
[ "public", "function", "minimize", "(", "$", "diff", ")", "{", "foreach", "(", "$", "diff", "as", "$", "step", "=>", "$", "d", ")", "{", "if", "(", "$", "diff", "[", "$", "step", "]", "[", "0", "]", "!==", "self", "::", "DEL", ")", "$", "diff"...
/* minimize compress the diff data, we only need the the added and equal strings position and length and the value of the deleted strings
[ "/", "*" ]
train
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/Text/diff/Compare.php#L173-L180
frdl/webfan
.ApplicationComposer/lib/webdof/Text/diff/Compare.php
Compare.calcdiffer
public function calcdiffer($a, $b) { $alen = strlen($a); $blen = strlen($b); $aptr = 0; $bptr = 0; $ops = array(); while($aptr < $alen && $bptr < $blen) { $matchlen = $this->matchlen(substr($a, $aptr), substr($b, $bptr)); if($matchlen) { $str = substr($a, $aptr, $matchlen); $ops...
php
public function calcdiffer($a, $b) { $alen = strlen($a); $blen = strlen($b); $aptr = 0; $bptr = 0; $ops = array(); while($aptr < $alen && $bptr < $blen) { $matchlen = $this->matchlen(substr($a, $aptr), substr($b, $bptr)); if($matchlen) { $str = substr($a, $aptr, $matchlen); $ops...
[ "public", "function", "calcdiffer", "(", "$", "a", ",", "$", "b", ")", "{", "$", "alen", "=", "strlen", "(", "$", "a", ")", ";", "$", "blen", "=", "strlen", "(", "$", "b", ")", ";", "$", "aptr", "=", "0", ";", "$", "bptr", "=", "0", ";", ...
/* Returns the differences of $a and $b
[ "/", "*", "Returns", "the", "differences", "of", "$a", "and", "$b" ]
train
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/Text/diff/Compare.php#L186-L258
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.get
public function get($remotepath, $localfile = '.') { $remotepath = self::winslashes($remotepath); $this->execute('get "'.$remotepath.'" "'.$localfile.'"', $output); return $output; }
php
public function get($remotepath, $localfile = '.') { $remotepath = self::winslashes($remotepath); $this->execute('get "'.$remotepath.'" "'.$localfile.'"', $output); return $output; }
[ "public", "function", "get", "(", "$", "remotepath", ",", "$", "localfile", "=", "'.'", ")", "{", "$", "remotepath", "=", "self", "::", "winslashes", "(", "$", "remotepath", ")", ";", "$", "this", "->", "execute", "(", "'get \"'", ".", "$", "remotepath...
gets files from the windows machine to the linux machine @param $remotepath the file path at the windows machine @param $localfile the file path on the local linux box where the file will be placed @return array $output the raw command line output for smbclient
[ "gets", "files", "from", "the", "windows", "machine", "to", "the", "linux", "machine", "@param", "$remotepath", "the", "file", "path", "at", "the", "windows", "machine", "@param", "$localfile", "the", "file", "path", "on", "the", "local", "linux", "box", "wh...
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L92-L98
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.put
public function put($localfile, $remotepath = ".") { $remotepath = self::winslashes($remotepath); $command = 'put "'.$localfile.'" "'.$remotepath.'"'; $this->execute($command, $output); return $output; }
php
public function put($localfile, $remotepath = ".") { $remotepath = self::winslashes($remotepath); $command = 'put "'.$localfile.'" "'.$remotepath.'"'; $this->execute($command, $output); return $output; }
[ "public", "function", "put", "(", "$", "localfile", ",", "$", "remotepath", "=", "\".\"", ")", "{", "$", "remotepath", "=", "self", "::", "winslashes", "(", "$", "remotepath", ")", ";", "$", "command", "=", "'put \"'", ".", "$", "localfile", ".", "'\" ...
Allows the placent of files from the local system to the remote windows system @param $localfile The local file on the linux server @param $remotepath The remote path to use @return array $output
[ "Allows", "the", "placent", "of", "files", "from", "the", "local", "system", "to", "the", "remote", "windows", "system", "@param", "$localfile", "The", "local", "file", "on", "the", "linux", "server", "@param", "$remotepath", "The", "remote", "path", "to", "...
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L107-L114
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.rename
public function rename($remote_file_path, $new_remote_file_path) { //get file string massage $remote_file_path = self::winslashes($remote_file_path); $new_remote_file_path = self::winslashes($new_remote_file_path); $this->execute('rename "'.$remote_file_path.'" "'.$new_remote_file_path.'"', ...
php
public function rename($remote_file_path, $new_remote_file_path) { //get file string massage $remote_file_path = self::winslashes($remote_file_path); $new_remote_file_path = self::winslashes($new_remote_file_path); $this->execute('rename "'.$remote_file_path.'" "'.$new_remote_file_path.'"', ...
[ "public", "function", "rename", "(", "$", "remote_file_path", ",", "$", "new_remote_file_path", ")", "{", "//get file string massage", "$", "remote_file_path", "=", "self", "::", "winslashes", "(", "$", "remote_file_path", ")", ";", "$", "new_remote_file_path", "=",...
rename a remote file @param string $remote_file_path The original file path/name @param string $new_remote_file_path The new file path/name @return array $output
[ "rename", "a", "remote", "file", "@param", "string", "$remote_file_path", "The", "original", "file", "path", "/", "name", "@param", "string", "$new_remote_file_path", "The", "new", "file", "path", "/", "name" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L123-L130
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.delete
public function delete($remote_file_path) { //get file string massage $remote_file_path = self::winslashes($remote_file_path); $this->execute('del "' . $remote_file_path . '"', $output); return $output; }
php
public function delete($remote_file_path) { //get file string massage $remote_file_path = self::winslashes($remote_file_path); $this->execute('del "' . $remote_file_path . '"', $output); return $output; }
[ "public", "function", "delete", "(", "$", "remote_file_path", ")", "{", "//get file string massage", "$", "remote_file_path", "=", "self", "::", "winslashes", "(", "$", "remote_file_path", ")", ";", "$", "this", "->", "execute", "(", "'del \"'", ".", "$", "rem...
delete a remote file @param string $remote_file_path The original file path/name @return array $output
[ "delete", "a", "remote", "file", "@param", "string", "$remote_file_path", "The", "original", "file", "path", "/", "name" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L138-L143
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.execute
public function execute($command, &$output = null) { $cmd = "smbclient '\\\\{$this->host}\\{$this->share}' $this->password -U $this->username -W $this->domain -c '$command' 2>&1"; exec($cmd, $output, $return); if($return === 1){ $errmsg = sprintf("Host: %s / Share: %s / Usernam...
php
public function execute($command, &$output = null) { $cmd = "smbclient '\\\\{$this->host}\\{$this->share}' $this->password -U $this->username -W $this->domain -c '$command' 2>&1"; exec($cmd, $output, $return); if($return === 1){ $errmsg = sprintf("Host: %s / Share: %s / Usernam...
[ "public", "function", "execute", "(", "$", "command", ",", "&", "$", "output", "=", "null", ")", "{", "$", "cmd", "=", "\"smbclient '\\\\\\\\{$this->host}\\\\{$this->share}' $this->password -U $this->username -W $this->domain -c '$command' 2>&1\"", ";", "exec", "(", "$", ...
Executes the command line function that completes the remote windows operations @param $command string the command to issue to the smbclient @param $output array what the command line returns @param $log boolean whether to log this transaction @return int Exit code for smbclient: 0 for success, 1 for error
[ "Executes", "the", "command", "line", "function", "that", "completes", "the", "remote", "windows", "operations" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L152-L180
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.ls
public function ls($subdir = '', &$raw = NULL) { $teststr = str_replace('\\', '-', $subdir); $nub = (preg_match('/[-?|\/?]*([\w \-]+\.\w{1,4})/', $teststr))?'':'\*'; $this->execute("ls $subdir".$nub, $raw_ls); $raw = $raw_ls; $ret = ($raw_ls)? $this->processLS($raw_ls, $...
php
public function ls($subdir = '', &$raw = NULL) { $teststr = str_replace('\\', '-', $subdir); $nub = (preg_match('/[-?|\/?]*([\w \-]+\.\w{1,4})/', $teststr))?'':'\*'; $this->execute("ls $subdir".$nub, $raw_ls); $raw = $raw_ls; $ret = ($raw_ls)? $this->processLS($raw_ls, $...
[ "public", "function", "ls", "(", "$", "subdir", "=", "''", ",", "&", "$", "raw", "=", "NULL", ")", "{", "$", "teststr", "=", "str_replace", "(", "'\\\\'", ",", "'-'", ",", "$", "subdir", ")", ";", "$", "nub", "=", "(", "preg_match", "(", "'/[-?|\...
Returns a list of the contents of the root of the share, or what ever directory is requested in $subdir @param $subdir @return unknown_type
[ "Returns", "a", "list", "of", "the", "contents", "of", "the", "root", "of", "the", "share", "or", "what", "ever", "directory", "is", "requested", "in", "$subdir" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L187-L198
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.processLS
private function processLS($raw_ls, $subdir = '') { $ret = array(); foreach($raw_ls as $listing) { $temp = $this->parseListing($listing, $subdir); if($temp) { $ret[] = $temp; } } return $ret; }
php
private function processLS($raw_ls, $subdir = '') { $ret = array(); foreach($raw_ls as $listing) { $temp = $this->parseListing($listing, $subdir); if($temp) { $ret[] = $temp; } } return $ret; }
[ "private", "function", "processLS", "(", "$", "raw_ls", ",", "$", "subdir", "=", "''", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "foreach", "(", "$", "raw_ls", "as", "$", "listing", ")", "{", "$", "temp", "=", "$", "this", "->", "parseLi...
Internal operation: converts raw commanline ls returns into an array of samba share listing objects @private
[ "Internal", "operation", ":", "converts", "raw", "commanline", "ls", "returns", "into", "an", "array", "of", "samba", "share", "listing", "objects" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L215-L227
surebert/surebert-framework
src/sb/Samba/Connection.php
Connection.parseListing
private function parseListing($listing, $subdir = '') { $ret = new \sb\Samba\Listing(); $exp = '/^\s{2}([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/'; preg_match_all($exp, $listing, $matches); if($matches[0]) { $ret->name = $matches[1][0]; $ret->type...
php
private function parseListing($listing, $subdir = '') { $ret = new \sb\Samba\Listing(); $exp = '/^\s{2}([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/'; preg_match_all($exp, $listing, $matches); if($matches[0]) { $ret->name = $matches[1][0]; $ret->type...
[ "private", "function", "parseListing", "(", "$", "listing", ",", "$", "subdir", "=", "''", ")", "{", "$", "ret", "=", "new", "\\", "sb", "\\", "Samba", "\\", "Listing", "(", ")", ";", "$", "exp", "=", "'/^\\s{2}([\\w \\-]+\\.?\\w{3,4})\\s+([A-Z]?)\\s+(\\d+)\...
Converts a line of returned output into a \sb\Samba_Listing object @param $listing @param $subdir @return \sb\Samba\Listing
[ "Converts", "a", "line", "of", "returned", "output", "into", "a", "\\", "sb", "\\", "Samba_Listing", "object" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Samba/Connection.php#L235-L253
willhoffmann/domuserp-php
src/Resources/Companies/Secondary/Branches.php
Branches.get
public function get($id) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/empresas/' . $this->companyId . '/filiais/' . $id ); return $data; }
php
public function get($id) { $data = $this->execute( self::HTTP_GET, self::DOMUSERP_API_PEDIDOVENDA . '/empresas/' . $this->companyId . '/filiais/' . $id ); return $data; }
[ "public", "function", "get", "(", "$", "id", ")", "{", "$", "data", "=", "$", "this", "->", "execute", "(", "self", "::", "HTTP_GET", ",", "self", "::", "DOMUSERP_API_PEDIDOVENDA", ".", "'/empresas/'", ".", "$", "this", "->", "companyId", ".", "'/filiais...
Gets the branch data according to the id parameter @param int $id @return array|string @throws \GuzzleHttp\Exception\GuzzleException
[ "Gets", "the", "branch", "data", "according", "to", "the", "id", "parameter" ]
train
https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/Companies/Secondary/Branches.php#L52-L60
BugBuster1701/contao-botdetection-bundle
src/Resources/contao/classes/CheckBotReferrer.php
CheckBotReferrer.checkReferrer
public static function checkReferrer($Referrer = false, $Bot_Referrer_List = false, $Bot_Provider_List = false) { $checkOwn = false; $checkLocal = false; $cachePath = false; $rootDir = \System::getContainer()->getParameter('kernel.project_dir'); if (false !== $Referrer...
php
public static function checkReferrer($Referrer = false, $Bot_Referrer_List = false, $Bot_Provider_List = false) { $checkOwn = false; $checkLocal = false; $cachePath = false; $rootDir = \System::getContainer()->getParameter('kernel.project_dir'); if (false !== $Referrer...
[ "public", "static", "function", "checkReferrer", "(", "$", "Referrer", "=", "false", ",", "$", "Bot_Referrer_List", "=", "false", ",", "$", "Bot_Provider_List", "=", "false", ")", "{", "$", "checkOwn", "=", "false", ";", "$", "checkLocal", "=", "false", ";...
checkReferrer @param string $Referrer Referrer of Request @param string $Bot_Referrer_List Bot Referrer List, absolute Path+Filename including TL_ROOT @param array $Bot_Provider_List Referrer Provider List, Name + URL @return boolean true: found, false: not found
[ "checkReferrer" ]
train
https://github.com/BugBuster1701/contao-botdetection-bundle/blob/50c964acc354aa9116fae0e509cd7d075bd52f55/src/Resources/contao/classes/CheckBotReferrer.php#L37-L117
BugBuster1701/contao-botdetection-bundle
src/Resources/contao/classes/CheckBotReferrer.php
CheckBotReferrer.getReferrerLocalList
protected static function getReferrerLocalList() { $botreferrerlist = array(); if (isset($GLOBALS['BOTDETECTION']['BOT_REFERRER']) && \is_array($GLOBALS['BOTDETECTION']['BOT_REFERRER']) ) { foreach ($GLOBALS['BOTDETECTION']['BOT_REFERRER'] as $search) ...
php
protected static function getReferrerLocalList() { $botreferrerlist = array(); if (isset($GLOBALS['BOTDETECTION']['BOT_REFERRER']) && \is_array($GLOBALS['BOTDETECTION']['BOT_REFERRER']) ) { foreach ($GLOBALS['BOTDETECTION']['BOT_REFERRER'] as $search) ...
[ "protected", "static", "function", "getReferrerLocalList", "(", ")", "{", "$", "botreferrerlist", "=", "array", "(", ")", ";", "if", "(", "isset", "(", "$", "GLOBALS", "[", "'BOTDETECTION'", "]", "[", "'BOT_REFERRER'", "]", ")", "&&", "\\", "is_array", "("...
Get Referrer List, self defined over localconfig @param string $Bot_Referrer_List @return boolean|array: false: no list, array: Referrer List
[ "Get", "Referrer", "List", "self", "defined", "over", "localconfig" ]
train
https://github.com/BugBuster1701/contao-botdetection-bundle/blob/50c964acc354aa9116fae0e509cd7d075bd52f55/src/Resources/contao/classes/CheckBotReferrer.php#L159-L175
resume-php/cli
app/Commands/ServeCommand.php
ServeCommand.handle
public function handle(): void { $directory = $this->argument('directory'); if (!is_dir($directory)) { $this->error( sprintf('The directory "%1$s" does not exist. Run `resume make --output=%1$s`.', $directory) ); exit(1); } chdir...
php
public function handle(): void { $directory = $this->argument('directory'); if (!is_dir($directory)) { $this->error( sprintf('The directory "%1$s" does not exist. Run `resume make --output=%1$s`.', $directory) ); exit(1); } chdir...
[ "public", "function", "handle", "(", ")", ":", "void", "{", "$", "directory", "=", "$", "this", "->", "argument", "(", "'directory'", ")", ";", "if", "(", "!", "is_dir", "(", "$", "directory", ")", ")", "{", "$", "this", "->", "error", "(", "sprint...
Execute the console command. @return mixed @throws \InvalidArgumentException
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/resume-php/cli/blob/c85b622378c4b8fdb08839e0cc0ebe5031b05390/app/Commands/ServeCommand.php#L32-L54
resume-php/cli
app/Commands/ServeCommand.php
ServeCommand.command
protected function command($host, $port): string { $php = (new PhpExecutableFinder)->find(false); return vsprintf('%s -S %s:%s index.html', [ $php, $host, $port, ]); }
php
protected function command($host, $port): string { $php = (new PhpExecutableFinder)->find(false); return vsprintf('%s -S %s:%s index.html', [ $php, $host, $port, ]); }
[ "protected", "function", "command", "(", "$", "host", ",", "$", "port", ")", ":", "string", "{", "$", "php", "=", "(", "new", "PhpExecutableFinder", ")", "->", "find", "(", "false", ")", ";", "return", "vsprintf", "(", "'%s -S %s:%s index.html'", ",", "[...
@param string $host @param int $port @return string
[ "@param", "string", "$host", "@param", "int", "$port" ]
train
https://github.com/resume-php/cli/blob/c85b622378c4b8fdb08839e0cc0ebe5031b05390/app/Commands/ServeCommand.php#L62-L69
windwork/wf-db
lib/DBAbstract.php
DBAbstract.getTableSchema
public function getTableSchema($table) { static $tableSchemaList = []; if((!$tableSchemaList || empty($tableSchemaList[$table]))) { $rows = $this->getAll("SHOW COLUMNS FROM %t", [$table]); $tableSchema = array( 'pk' => '', 'ai' => fa...
php
public function getTableSchema($table) { static $tableSchemaList = []; if((!$tableSchemaList || empty($tableSchemaList[$table]))) { $rows = $this->getAll("SHOW COLUMNS FROM %t", [$table]); $tableSchema = array( 'pk' => '', 'ai' => fa...
[ "public", "function", "getTableSchema", "(", "$", "table", ")", "{", "static", "$", "tableSchemaList", "=", "[", "]", ";", "if", "(", "(", "!", "$", "tableSchemaList", "||", "empty", "(", "$", "tableSchemaList", "[", "$", "table", "]", ")", ")", ")", ...
获取模型数据表信息 <pre> arry( 'pk' => '主键', 'ai' => true/false, //主键是否是自动增长 'field' => array( '字段1名' => array( 'field' => '字段1名', 'type' => '字段类型', 'key' => '索引类型', //PKI/MUL/UNI 'default' => '默认值', 'ai' => '是否是自动增长的', ), '字段2' => array( 'field' => $row['Field'], 'type' => $row['Type'], 'key' => $row['K...
[ "获取模型数据表信息" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/DBAbstract.php#L83-L112
windwork/wf-db
lib/DBAbstract.php
DBAbstract.insertRows
public function insertRows(array $rows, $table, $fieldArr = [], $isReplace = false) { $type = $isReplace ? 'REPLACE' : 'INSERT'; // 数据中允许插入的字段 $allowFields = $fieldArr ? $fieldArr : array_keys(current($rows)); $allowFields = QueryBuilder::quoteFieldNames(implode(',', $allowFields));...
php
public function insertRows(array $rows, $table, $fieldArr = [], $isReplace = false) { $type = $isReplace ? 'REPLACE' : 'INSERT'; // 数据中允许插入的字段 $allowFields = $fieldArr ? $fieldArr : array_keys(current($rows)); $allowFields = QueryBuilder::quoteFieldNames(implode(',', $allowFields));...
[ "public", "function", "insertRows", "(", "array", "$", "rows", ",", "$", "table", ",", "$", "fieldArr", "=", "[", "]", ",", "$", "isReplace", "=", "false", ")", "{", "$", "type", "=", "$", "isReplace", "?", "'REPLACE'", ":", "'INSERT'", ";", "// 数据中允...
插入多行数据 过滤掉没有的字段 @param array $rows @param string $table 插入表 @param array $field 允许插入的字段名 @param string $isReplace = false 是否使用 REPLACE INTO插入数据,false为使用 INSERT INTO @return PDOStatement
[ "插入多行数据", "过滤掉没有的字段" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/DBAbstract.php#L124-L149
gruzilla/hydra
src/Hydra/OAuth/YamlTokenStorage.php
YamlTokenStorage.storeAccessToken
public function storeAccessToken($serviceName, TokenInterface $token) { // normalize service name $serviceName = ucfirst($serviceName); parent::storeAccessToken($serviceName, $token); $this->configs[$serviceName][self::ACCES_TOKEN_KEY] = serialize($token); $this->save($serv...
php
public function storeAccessToken($serviceName, TokenInterface $token) { // normalize service name $serviceName = ucfirst($serviceName); parent::storeAccessToken($serviceName, $token); $this->configs[$serviceName][self::ACCES_TOKEN_KEY] = serialize($token); $this->save($serv...
[ "public", "function", "storeAccessToken", "(", "$", "serviceName", ",", "TokenInterface", "$", "token", ")", "{", "// normalize service name", "$", "serviceName", "=", "ucfirst", "(", "$", "serviceName", ")", ";", "parent", "::", "storeAccessToken", "(", "$", "s...
{@inheritDoc}
[ "{" ]
train
https://github.com/gruzilla/hydra/blob/47f381cc48e1a26bfe2e211d8dcb54c787ea0478/src/Hydra/OAuth/YamlTokenStorage.php#L74-L86
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.channelFileList
public function channelFileList($cid, $cpw = "", $path = "/", $recursive = FALSE) { $files = $this->execute("ftgetfilelist", array("cid" => $cid, "cpw" => $cpw, "path" => $path))->toArray(); $count = count($files); for($i = 0; $i < $count; $i++) { $files[$i]["sid"] = $this->getId(); $fil...
php
public function channelFileList($cid, $cpw = "", $path = "/", $recursive = FALSE) { $files = $this->execute("ftgetfilelist", array("cid" => $cid, "cpw" => $cpw, "path" => $path))->toArray(); $count = count($files); for($i = 0; $i < $count; $i++) { $files[$i]["sid"] = $this->getId(); $fil...
[ "public", "function", "channelFileList", "(", "$", "cid", ",", "$", "cpw", "=", "\"\"", ",", "$", "path", "=", "\"/\"", ",", "$", "recursive", "=", "FALSE", ")", "{", "$", "files", "=", "$", "this", "->", "execute", "(", "\"ftgetfilelist\"", ",", "ar...
Returns a list of files and directories stored in the specified channels file repository. @param integer $cid @param string $cpw @param string $path @param boolean $recursive @return array
[ "Returns", "a", "list", "of", "files", "and", "directories", "stored", "in", "the", "specified", "channels", "file", "repository", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L491-L519
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.channelGetById
public function channelGetById($cid) { if(!array_key_exists((string) $cid, $this->channelList())) { throw new Exception("invalid channelID", 0x300); } return $this->channelList[intval((string) $cid)]; }
php
public function channelGetById($cid) { if(!array_key_exists((string) $cid, $this->channelList())) { throw new Exception("invalid channelID", 0x300); } return $this->channelList[intval((string) $cid)]; }
[ "public", "function", "channelGetById", "(", "$", "cid", ")", "{", "if", "(", "!", "array_key_exists", "(", "(", "string", ")", "$", "cid", ",", "$", "this", "->", "channelList", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "\"invalid cha...
Returns the Channel object matching the given ID. @param integer $cid @throws Exception @return Channel
[ "Returns", "the", "Channel", "object", "matching", "the", "given", "ID", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L624-L632
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.channelGetByName
public function channelGetByName($name) { foreach($this->channelList() as $channel) { if($channel["channel_name"] == $name) return $channel; } throw new Exception("invalid channelID", 0x300); }
php
public function channelGetByName($name) { foreach($this->channelList() as $channel) { if($channel["channel_name"] == $name) return $channel; } throw new Exception("invalid channelID", 0x300); }
[ "public", "function", "channelGetByName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "channelList", "(", ")", "as", "$", "channel", ")", "{", "if", "(", "$", "channel", "[", "\"channel_name\"", "]", "==", "$", "name", ")", "return",...
Returns the Channel object matching the given name. @param string $name @throws Exception @return Channel
[ "Returns", "the", "Channel", "object", "matching", "the", "given", "name", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L641-L649
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientList
public function clientList(array $filter = array()) { if($this->clientList === null) { $clients = $this->request("clientlist -uid -away -badges -voice -info -times -groups -icon -country -ip")->toAssocArray("clid"); $this->clientList = array(); foreach($clients as $clid => $client) {...
php
public function clientList(array $filter = array()) { if($this->clientList === null) { $clients = $this->request("clientlist -uid -away -badges -voice -info -times -groups -icon -country -ip")->toAssocArray("clid"); $this->clientList = array(); foreach($clients as $clid => $client) {...
[ "public", "function", "clientList", "(", "array", "$", "filter", "=", "array", "(", ")", ")", "{", "if", "(", "$", "this", "->", "clientList", "===", "null", ")", "{", "$", "clients", "=", "$", "this", "->", "request", "(", "\"clientlist -uid -away -badg...
Returns an array filled with Client objects. @param array $filter @return array|Client[]
[ "Returns", "an", "array", "filled", "with", "Client", "objects", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L657-L678
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientGetByName
public function clientGetByName($name) { foreach($this->clientList() as $client) { if($client["client_nickname"] == $name) return $client; } throw new Exception("invalid clientID", 0x200); }
php
public function clientGetByName($name) { foreach($this->clientList() as $client) { if($client["client_nickname"] == $name) return $client; } throw new Exception("invalid clientID", 0x200); }
[ "public", "function", "clientGetByName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "clientList", "(", ")", "as", "$", "client", ")", "{", "if", "(", "$", "client", "[", "\"client_nickname\"", "]", "==", "$", "name", ")", "return", ...
Returns the Client object matching the given name. @param string $name @throws Exception @return Client
[ "Returns", "the", "Client", "object", "matching", "the", "given", "name", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L785-L793
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientGetByUid
public function clientGetByUid($uid) { foreach($this->clientList() as $client) { if($client["client_unique_identifier"] == $uid) return $client; } throw new Exception("invalid clientID", 0x200); }
php
public function clientGetByUid($uid) { foreach($this->clientList() as $client) { if($client["client_unique_identifier"] == $uid) return $client; } throw new Exception("invalid clientID", 0x200); }
[ "public", "function", "clientGetByUid", "(", "$", "uid", ")", "{", "foreach", "(", "$", "this", "->", "clientList", "(", ")", "as", "$", "client", ")", "{", "if", "(", "$", "client", "[", "\"client_unique_identifier\"", "]", "==", "$", "uid", ")", "ret...
Returns the Client object matching the given unique identifier. @param string $uid @throws Exception @return Client
[ "Returns", "the", "Client", "object", "matching", "the", "given", "unique", "identifier", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L802-L810
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientGetByDbid
public function clientGetByDbid($dbid) { foreach($this->clientList() as $client) { if($client["client_database_id"] == $dbid) return $client; } throw new Exception("invalid clientID", 0x200); }
php
public function clientGetByDbid($dbid) { foreach($this->clientList() as $client) { if($client["client_database_id"] == $dbid) return $client; } throw new Exception("invalid clientID", 0x200); }
[ "public", "function", "clientGetByDbid", "(", "$", "dbid", ")", "{", "foreach", "(", "$", "this", "->", "clientList", "(", ")", "as", "$", "client", ")", "{", "if", "(", "$", "client", "[", "\"client_database_id\"", "]", "==", "$", "dbid", ")", "return...
Returns the Client object matching the given database ID. @param integer $dbid @throws Exception @return Client
[ "Returns", "the", "Client", "object", "matching", "the", "given", "database", "ID", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L819-L827
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.clientMove
public function clientMove($clid, $cid, $cpw = null) { $this->clientListReset(); $this->execute("clientmove", array("clid" => $clid, "cid" => $cid, "cpw" => $cpw)); if($clid instanceof Node) { $clid = $clid->getId(); } if($cid instanceof Node) { $cid = $cid->getId(); } ...
php
public function clientMove($clid, $cid, $cpw = null) { $this->clientListReset(); $this->execute("clientmove", array("clid" => $clid, "cid" => $cid, "cpw" => $cpw)); if($clid instanceof Node) { $clid = $clid->getId(); } if($cid instanceof Node) { $cid = $cid->getId(); } ...
[ "public", "function", "clientMove", "(", "$", "clid", ",", "$", "cid", ",", "$", "cpw", "=", "null", ")", "{", "$", "this", "->", "clientListReset", "(", ")", ";", "$", "this", "->", "execute", "(", "\"clientmove\"", ",", "array", "(", "\"clid\"", "=...
Moves a client to another channel. @param integer $clid @param integer $cid @param string $cpw @return void
[ "Moves", "a", "client", "to", "another", "channel", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L885-L905
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.serverGroupGetById
public function serverGroupGetById($sgid) { if(!array_key_exists((string) $sgid, $this->serverGroupList())) { throw new Exception("invalid groupID", 0xA00); } return $this->sgroupList[intval((string) $sgid)]; }
php
public function serverGroupGetById($sgid) { if(!array_key_exists((string) $sgid, $this->serverGroupList())) { throw new Exception("invalid groupID", 0xA00); } return $this->sgroupList[intval((string) $sgid)]; }
[ "public", "function", "serverGroupGetById", "(", "$", "sgid", ")", "{", "if", "(", "!", "array_key_exists", "(", "(", "string", ")", "$", "sgid", ",", "$", "this", "->", "serverGroupList", "(", ")", ")", ")", "{", "throw", "new", "Exception", "(", "\"i...
Returns the Servergroup object matching the given ID. @param integer $sgid @throws Exception @return ServerGroup
[ "Returns", "the", "Servergroup", "object", "matching", "the", "given", "ID", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L1157-L1165
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.permRemoveAny
public function permRemoveAny($permid) { $assignments = $this->permissionFind($permid); foreach($assignments as $assignment) { switch($assignment["t"]) { case TeamSpeak3::PERM_TYPE_SERVERGROUP: $this->serverGroupPermRemove($assignment["id1"], $assignment["p"]); break; ...
php
public function permRemoveAny($permid) { $assignments = $this->permissionFind($permid); foreach($assignments as $assignment) { switch($assignment["t"]) { case TeamSpeak3::PERM_TYPE_SERVERGROUP: $this->serverGroupPermRemove($assignment["id1"], $assignment["p"]); break; ...
[ "public", "function", "permRemoveAny", "(", "$", "permid", ")", "{", "$", "assignments", "=", "$", "this", "->", "permissionFind", "(", "$", "permid", ")", ";", "foreach", "(", "$", "assignments", "as", "$", "assignment", ")", "{", "switch", "(", "$", ...
Removes any assignment of the permission specified with $permid on the selected virtual server and returns the number of removed assignments on success. @param integer $permid @return integer
[ "Removes", "any", "assignment", "of", "the", "permission", "specified", "with", "$permid", "on", "the", "selected", "virtual", "server", "and", "returns", "the", "number", "of", "removed", "assignments", "on", "success", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L1633-L1667
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.transferInitUpload
public function transferInitUpload($clientftfid, $cid, $name, $size, $cpw = "", $overwrite = FALSE, $resume = FALSE) { $upload = $this->execute("ftinitupload", array("clientftfid" => $clientftfid, "cid" => $cid, "name" => $name, "cpw" => $cpw, "size" => $size, "overwrite" => $overwrite, "resume" => $resume))->toL...
php
public function transferInitUpload($clientftfid, $cid, $name, $size, $cpw = "", $overwrite = FALSE, $resume = FALSE) { $upload = $this->execute("ftinitupload", array("clientftfid" => $clientftfid, "cid" => $cid, "name" => $name, "cpw" => $cpw, "size" => $size, "overwrite" => $overwrite, "resume" => $resume))->toL...
[ "public", "function", "transferInitUpload", "(", "$", "clientftfid", ",", "$", "cid", ",", "$", "name", ",", "$", "size", ",", "$", "cpw", "=", "\"\"", ",", "$", "overwrite", "=", "FALSE", ",", "$", "resume", "=", "FALSE", ")", "{", "$", "upload", ...
Initializes a file transfer upload. $clientftfid is an arbitrary ID to identify the file transfer on client-side. @param integer $clientftfid @param integer $cid @param string $name @param integer $size @param string $cpw @param boolean $overwrite @param boolean $resume @throws Exception @return array
[ "Initializes", "a", "file", "transfer", "upload", ".", "$clientftfid", "is", "an", "arbitrary", "ID", "to", "identify", "the", "file", "transfer", "on", "client", "-", "side", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L1682-L1708
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.sortClientList
protected static function sortClientList(Client $a, Client $b) { if(get_class($a) != get_class($b)) { return 0; /* workaround for PHP bug #50688 */ throw new Exception("invalid parameter", 0x602); } if(!$a instanceof Client) { return 0; /* workaround for PHP bug #5...
php
protected static function sortClientList(Client $a, Client $b) { if(get_class($a) != get_class($b)) { return 0; /* workaround for PHP bug #50688 */ throw new Exception("invalid parameter", 0x602); } if(!$a instanceof Client) { return 0; /* workaround for PHP bug #5...
[ "protected", "static", "function", "sortClientList", "(", "Client", "$", "a", ",", "Client", "$", "b", ")", "{", "if", "(", "get_class", "(", "$", "a", ")", "!=", "get_class", "(", "$", "b", ")", ")", "{", "return", "0", ";", "/* workaround for PHP bug...
Internal callback funtion for sorting of client objects. @param Client $a @param Client $b @return integer
[ "Internal", "callback", "funtion", "for", "sorting", "of", "client", "objects", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L2458-L2487
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.sortGroupList
protected static function sortGroupList(Node $a, Node $b) { if(get_class($a) != get_class($b)) { return 0; /* workaround for PHP bug #50688 */ throw new Exception("invalid parameter", 0x602); } if(!$a instanceof Servergroup && !$a instanceof Channelgroup) { return 0; ...
php
protected static function sortGroupList(Node $a, Node $b) { if(get_class($a) != get_class($b)) { return 0; /* workaround for PHP bug #50688 */ throw new Exception("invalid parameter", 0x602); } if(!$a instanceof Servergroup && !$a instanceof Channelgroup) { return 0; ...
[ "protected", "static", "function", "sortGroupList", "(", "Node", "$", "a", ",", "Node", "$", "b", ")", "{", "if", "(", "get_class", "(", "$", "a", ")", "!=", "get_class", "(", "$", "b", ")", ")", "{", "return", "0", ";", "/* workaround for PHP bug #506...
Internal callback funtion for sorting of group objects. @param Node $a @param Node $b @return integer
[ "Internal", "callback", "funtion", "for", "sorting", "of", "group", "objects", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L2496-L2520
lukasz-adamski/teamspeak3-framework
src/TeamSpeak3/Node/Server.php
Server.sortFileList
protected static function sortFileList(array $a, array $b) { if(!array_key_exists("src", $a) || !array_key_exists("src", $b) || !array_key_exists("type", $a) || !array_key_exists("type", $b)) { return 0; throw new Exception("invalid parameter", 0x602); } if($a["type"] != $b["type"]) ...
php
protected static function sortFileList(array $a, array $b) { if(!array_key_exists("src", $a) || !array_key_exists("src", $b) || !array_key_exists("type", $a) || !array_key_exists("type", $b)) { return 0; throw new Exception("invalid parameter", 0x602); } if($a["type"] != $b["type"]) ...
[ "protected", "static", "function", "sortFileList", "(", "array", "$", "a", ",", "array", "$", "b", ")", "{", "if", "(", "!", "array_key_exists", "(", "\"src\"", ",", "$", "a", ")", "||", "!", "array_key_exists", "(", "\"src\"", ",", "$", "b", ")", "|...
Internal callback funtion for sorting of file list items. @param array $a @param array $b @return integer
[ "Internal", "callback", "funtion", "for", "sorting", "of", "file", "list", "items", "." ]
train
https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Server.php#L2529-L2544
surebert/surebert-framework
src/sb/Memory.php
Memory.getUsage
public static function getUsage($system=false, $peak = true) { if ($peak) { $mem = memory_get_peak_usage($system); } else { $mem = memory_get_usage($system); } $unit=array('b','kb','mb','gb','tb','pb'); return round($mem/pow(1024,($i=floor(log($mem,1024))))...
php
public static function getUsage($system=false, $peak = true) { if ($peak) { $mem = memory_get_peak_usage($system); } else { $mem = memory_get_usage($system); } $unit=array('b','kb','mb','gb','tb','pb'); return round($mem/pow(1024,($i=floor(log($mem,1024))))...
[ "public", "static", "function", "getUsage", "(", "$", "system", "=", "false", ",", "$", "peak", "=", "true", ")", "{", "if", "(", "$", "peak", ")", "{", "$", "mem", "=", "memory_get_peak_usage", "(", "$", "system", ")", ";", "}", "else", "{", "$", ...
Determines the peak memory usage @param boolean $system Set this to TRUE to get the real size of memory allocated from system @param boolean $peak Get peak memory if true, otherwise current memory @return string The value in b, KB, or MB depending on size
[ "Determines", "the", "peak", "memory", "usage" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Memory.php#L15-L24
thienhungho/yii2-product-management
src/modules/ProductManage/search/ProductUnitEquivalentSearch.php
ProductUnitEquivalentSearch.search
public function search($params) { $query = ProductUnitEquivalent::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want t...
php
public function search($params) { $query = ProductUnitEquivalent::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want t...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "query", "=", "ProductUnitEquivalent", "::", "find", "(", ")", ";", "$", "dataProvider", "=", "new", "ActiveDataProvider", "(", "[", "'query'", "=>", "$", "query", ",", "]", ")", ";", "...
Creates data provider instance with search query applied @param array $params @return ActiveDataProvider
[ "Creates", "data", "provider", "instance", "with", "search", "query", "applied" ]
train
https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/search/ProductUnitEquivalentSearch.php#L42-L71
shabbyrobe/amiss
src/Sql/Manager.php
Manager.selectList
public function selectList($meta, ...$args) { if (!$args) { throw new \InvalidArgumentException(); } $fields = null; $query = null; if (!isset($args[1]) && $args[0] instanceof Query\Select) { $query = $args[0]; } elseif ((is_ar...
php
public function selectList($meta, ...$args) { if (!$args) { throw new \InvalidArgumentException(); } $fields = null; $query = null; if (!isset($args[1]) && $args[0] instanceof Query\Select) { $query = $args[0]; } elseif ((is_ar...
[ "public", "function", "selectList", "(", "$", "meta", ",", "...", "$", "args", ")", "{", "if", "(", "!", "$", "args", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", ")", ";", "}", "$", "fields", "=", "null", ";", "$", "query", "="...
Dunno about this. Consider it unstable, don't count on it still being here in v6
[ "Dunno", "about", "this", ".", "Consider", "it", "unstable", "don", "t", "count", "on", "it", "still", "being", "here", "in", "v6" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L217-L270
shabbyrobe/amiss
src/Sql/Manager.php
Manager.count
public function count($meta, ...$args) { $query = $args && $args[0] instanceof Query\Select ? $args[0] : Query\Select::fromParamArgs($args); $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; $table = $query->table ?: $meta->table; list ($where,...
php
public function count($meta, ...$args) { $query = $args && $args[0] instanceof Query\Select ? $args[0] : Query\Select::fromParamArgs($args); $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; $table = $query->table ?: $meta->table; list ($where,...
[ "public", "function", "count", "(", "$", "meta", ",", "...", "$", "args", ")", "{", "$", "query", "=", "$", "args", "&&", "$", "args", "[", "0", "]", "instanceof", "Query", "\\", "Select", "?", "$", "args", "[", "0", "]", ":", "Query", "\\", "S...
count ( $meta ) count ( $meta , string $where [ , array $params ] ) count ( $meta , array $query ) count ( $meta , \Amiss\Sql\Query\Select $query ) @param $meta string|Amiss\Meta @return int
[ "count", "(", "$meta", ")", "count", "(", "$meta", "string", "$where", "[", "array", "$params", "]", ")", "count", "(", "$meta", "array", "$query", ")", "count", "(", "$meta", "\\", "Amiss", "\\", "Sql", "\\", "Query", "\\", "Select", "$query", ")" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L293-L311
shabbyrobe/amiss
src/Sql/Manager.php
Manager.assignRelated
public function assignRelated($source, $relationNames=null, $meta=null) { if (!$source) { return; } $stack = []; $sourceIsArray = is_array($source) || $source instanceof \Traversable; if (!$sourceIsArray) { $source = array($source); } if ($meta !== null)...
php
public function assignRelated($source, $relationNames=null, $meta=null) { if (!$source) { return; } $stack = []; $sourceIsArray = is_array($source) || $source instanceof \Traversable; if (!$sourceIsArray) { $source = array($source); } if ($meta !== null)...
[ "public", "function", "assignRelated", "(", "$", "source", ",", "$", "relationNames", "=", "null", ",", "$", "meta", "=", "null", ")", "{", "if", "(", "!", "$", "source", ")", "{", "return", ";", "}", "$", "stack", "=", "[", "]", ";", "$", "sourc...
Retrieve related objects from the database and assign them to the source if the source field is not yet populated. @param object|array Source objects to assign relations for @param string|array The name of the relation(s) to assign @return void
[ "Retrieve", "related", "objects", "from", "the", "database", "and", "assign", "them", "to", "the", "source", "if", "the", "source", "field", "is", "not", "yet", "populated", "." ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L330-L393
shabbyrobe/amiss
src/Sql/Manager.php
Manager.getRelated
public function getRelated($source, $relationName, $query=null, $meta=null) { if (!$source) { return; } $sourceIsArray = false; $test = $source; if (is_array($test) || $test instanceof \Traversable) { $sourceIsArray = true; $test = $test[0]; } ...
php
public function getRelated($source, $relationName, $query=null, $meta=null) { if (!$source) { return; } $sourceIsArray = false; $test = $source; if (is_array($test) || $test instanceof \Traversable) { $sourceIsArray = true; $test = $test[0]; } ...
[ "public", "function", "getRelated", "(", "$", "source", ",", "$", "relationName", ",", "$", "query", "=", "null", ",", "$", "meta", "=", "null", ")", "{", "if", "(", "!", "$", "source", ")", "{", "return", ";", "}", "$", "sourceIsArray", "=", "fals...
Get related objects from the database Supports the following signatures: - getRelated( object|array $source , string $relationName ) - getRelated( object|array $source , string $relationName , $query ) - getRelated( object|array $source , string $relationName , Meta $meta ) - getRelated( object|array $source , string...
[ "Get", "related", "objects", "from", "the", "database" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L478-L528
shabbyrobe/amiss
src/Sql/Manager.php
Manager.insertTable
public function insertTable($meta, $query) { $meta = $meta instanceof Meta ? $meta : $this->mapper->getMeta($meta); if (!$meta->canInsert) { throw new Exception("Class {$meta->class} prohibits insert"); } $query = $query instanceof Query\Insert ? $query : new Query\Inser...
php
public function insertTable($meta, $query) { $meta = $meta instanceof Meta ? $meta : $this->mapper->getMeta($meta); if (!$meta->canInsert) { throw new Exception("Class {$meta->class} prohibits insert"); } $query = $query instanceof Query\Insert ? $query : new Query\Inser...
[ "public", "function", "insertTable", "(", "$", "meta", ",", "$", "query", ")", "{", "$", "meta", "=", "$", "meta", "instanceof", "Meta", "?", "$", "meta", ":", "$", "this", "->", "mapper", "->", "getMeta", "(", "$", "meta", ")", ";", "if", "(", "...
Insert values into a table insertTable ( $meta , array $propertyValues ); insertTable ( $meta , Query\Insert $query ); - $meta can be an instance of Amiss\Meta or a class name. - $propertyValues keys must exist in the corresponding Meta. @return int|null
[ "Insert", "values", "into", "a", "table" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L541-L561
shabbyrobe/amiss
src/Sql/Manager.php
Manager.insert
public function insert($object, $meta=null) { $query = new Query\Insert; if (is_array($meta)) { throw new \BadMethodCallException("Please use insertTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } el...
php
public function insert($object, $meta=null) { $query = new Query\Insert; if (is_array($meta)) { throw new \BadMethodCallException("Please use insertTable()"); } if ($meta) { $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta; } el...
[ "public", "function", "insert", "(", "$", "object", ",", "$", "meta", "=", "null", ")", "{", "$", "query", "=", "new", "Query", "\\", "Insert", ";", "if", "(", "is_array", "(", "$", "meta", ")", ")", "{", "throw", "new", "\\", "BadMethodCallException...
Insert an object into the database, or values into a table insert($object) insert($object, Meta $meta) @return int|null
[ "Insert", "an", "object", "into", "the", "database", "or", "values", "into", "a", "table" ]
train
https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Manager.php#L571-L634