id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1 value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
46,200 | TypiCMS/Core | src/Commands/Install.php | Install.guessDatabaseName | public function guessDatabaseName()
{
try {
$segments = array_reverse(explode(DIRECTORY_SEPARATOR, app_path()));
$name = explode('.', $segments[1])[0];
return Str::slug($name);
} catch (Exception $e) {
return '';
}
} | php | public function guessDatabaseName()
{
try {
$segments = array_reverse(explode(DIRECTORY_SEPARATOR, app_path()));
$name = explode('.', $segments[1])[0];
return Str::slug($name);
} catch (Exception $e) {
return '';
}
} | [
"public",
"function",
"guessDatabaseName",
"(",
")",
"{",
"try",
"{",
"$",
"segments",
"=",
"array_reverse",
"(",
"explode",
"(",
"DIRECTORY_SEPARATOR",
",",
"app_path",
"(",
")",
")",
")",
";",
"$",
"name",
"=",
"explode",
"(",
"'.'",
",",
"$",
"segment... | Guess database name from app folder.
@return string | [
"Guess",
"database",
"name",
"from",
"app",
"folder",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Commands/Install.php#L101-L111 |
46,201 | TypiCMS/Core | src/Commands/Install.php | Install.createSuperUser | private function createSuperUser()
{
$this->info('Creating a Super User...');
$firstname = $this->ask('Enter your first name');
$lastname = $this->ask('Enter your last name');
$email = $this->ask('Enter your email address');
$password = $this->secret('Enter a password');
$data = [
'first_name' => $firstname,
'last_name' => $lastname,
'email' => $email,
'superuser' => 1,
'activated' => 1,
'password' => Hash::make($password),
'email_verified_at' => Carbon::now(),
];
try {
User::create($data);
$this->info('Superuser created.');
} catch (Exception $e) {
$this->error('User could not be created.');
}
$this->line('------------------');
} | php | private function createSuperUser()
{
$this->info('Creating a Super User...');
$firstname = $this->ask('Enter your first name');
$lastname = $this->ask('Enter your last name');
$email = $this->ask('Enter your email address');
$password = $this->secret('Enter a password');
$data = [
'first_name' => $firstname,
'last_name' => $lastname,
'email' => $email,
'superuser' => 1,
'activated' => 1,
'password' => Hash::make($password),
'email_verified_at' => Carbon::now(),
];
try {
User::create($data);
$this->info('Superuser created.');
} catch (Exception $e) {
$this->error('User could not be created.');
}
$this->line('------------------');
} | [
"private",
"function",
"createSuperUser",
"(",
")",
"{",
"$",
"this",
"->",
"info",
"(",
"'Creating a Super User...'",
")",
";",
"$",
"firstname",
"=",
"$",
"this",
"->",
"ask",
"(",
"'Enter your first name'",
")",
";",
"$",
"lastname",
"=",
"$",
"this",
"... | Create a superuser. | [
"Create",
"a",
"superuser",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Commands/Install.php#L116-L143 |
46,202 | TypiCMS/Core | src/Repositories/EloquentRepository.php | EloquentRepository.next | public function next($model, $category_id = null, array $with = [], $all = false)
{
return $this->adjacent(1, $model, $category_id, $with, $all);
} | php | public function next($model, $category_id = null, array $with = [], $all = false)
{
return $this->adjacent(1, $model, $category_id, $with, $all);
} | [
"public",
"function",
"next",
"(",
"$",
"model",
",",
"$",
"category_id",
"=",
"null",
",",
"array",
"$",
"with",
"=",
"[",
"]",
",",
"$",
"all",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"adjacent",
"(",
"1",
",",
"$",
"model",
",",
... | Get next model.
@param Model $model
@param int $category_id
@param array $with
@param bool $all
@return Model|null | [
"Get",
"next",
"model",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Repositories/EloquentRepository.php#L24-L27 |
46,203 | TypiCMS/Core | src/Repositories/EloquentRepository.php | EloquentRepository.adjacent | public function adjacent($direction, $model, $category_id = null, array $with = [], $all = false)
{
$currentModel = $model;
if ($category_id !== null) {
$models = $this->with('category')->findWhere(['category_id', $category_id], ['id', 'category_id', 'slug']);
} else {
$models = $this->all(['id', 'slug']);
}
foreach ($models as $key => $model) {
if ($currentModel->id == $model->id) {
$adjacentKey = $key + $direction;
return isset($models[$adjacentKey]) ? $models[$adjacentKey] : null;
}
}
} | php | public function adjacent($direction, $model, $category_id = null, array $with = [], $all = false)
{
$currentModel = $model;
if ($category_id !== null) {
$models = $this->with('category')->findWhere(['category_id', $category_id], ['id', 'category_id', 'slug']);
} else {
$models = $this->all(['id', 'slug']);
}
foreach ($models as $key => $model) {
if ($currentModel->id == $model->id) {
$adjacentKey = $key + $direction;
return isset($models[$adjacentKey]) ? $models[$adjacentKey] : null;
}
}
} | [
"public",
"function",
"adjacent",
"(",
"$",
"direction",
",",
"$",
"model",
",",
"$",
"category_id",
"=",
"null",
",",
"array",
"$",
"with",
"=",
"[",
"]",
",",
"$",
"all",
"=",
"false",
")",
"{",
"$",
"currentModel",
"=",
"$",
"model",
";",
"if",
... | Get prev model.
@param int $direction
@param Model $model
@param int $category_id
@param array $with
@param bool $all
@return Model|null | [
"Get",
"prev",
"model",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Repositories/EloquentRepository.php#L55-L70 |
46,204 | TypiCMS/Core | src/Repositories/EloquentRepository.php | EloquentRepository.bySlug | public function bySlug($slug, $attributes = ['*'])
{
if (!request('preview')) {
$this->published();
}
$model = $this->findBy(column('slug'), $slug, $attributes);
if (is_null($model)) {
abort(404);
}
return $model;
} | php | public function bySlug($slug, $attributes = ['*'])
{
if (!request('preview')) {
$this->published();
}
$model = $this->findBy(column('slug'), $slug, $attributes);
if (is_null($model)) {
abort(404);
}
return $model;
} | [
"public",
"function",
"bySlug",
"(",
"$",
"slug",
",",
"$",
"attributes",
"=",
"[",
"'*'",
"]",
")",
"{",
"if",
"(",
"!",
"request",
"(",
"'preview'",
")",
")",
"{",
"$",
"this",
"->",
"published",
"(",
")",
";",
"}",
"$",
"model",
"=",
"$",
"t... | Get single model by Slug.
@param string $slug
@param array $attributes
@return mixed | [
"Get",
"single",
"model",
"by",
"Slug",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Repositories/EloquentRepository.php#L80-L92 |
46,205 | TypiCMS/Core | src/Repositories/EloquentRepository.php | EloquentRepository.allFiltered | public function allFiltered($columns = [], array $with = [])
{
$params = request()->all();
$data = $this->with($with)->select($columns);
$orderBy = $params['orderBy'] ?? null;
$query = $params['query'] ?? null;
$limit = $params['limit'] ?? null;
$page = $params['page'] ?? 1;
$ascending = $params['ascending'] ?? 1;
$byColumn = $params['byColumn'] ?? 0;
if ($query !== null) {
$data = $byColumn == 1 ? $this->filterByColumn($data, $query) :
$this->filter($data, $query, $columns);
}
$count = $data->count();
if ($limit !== null) {
$data->limit($limit)->skip($limit * ($page - 1));
}
if ($orderBy !== null) {
$orderBy .= $this->translatableOperator($orderBy);
$direction = $ascending == 1 ? 'ASC' : 'DESC';
$data->orderBy($orderBy, $direction);
}
$results = $data->get()
->translate(config('typicms.content_locale'));
return [
'data' => $results,
'count' => $count,
];
} | php | public function allFiltered($columns = [], array $with = [])
{
$params = request()->all();
$data = $this->with($with)->select($columns);
$orderBy = $params['orderBy'] ?? null;
$query = $params['query'] ?? null;
$limit = $params['limit'] ?? null;
$page = $params['page'] ?? 1;
$ascending = $params['ascending'] ?? 1;
$byColumn = $params['byColumn'] ?? 0;
if ($query !== null) {
$data = $byColumn == 1 ? $this->filterByColumn($data, $query) :
$this->filter($data, $query, $columns);
}
$count = $data->count();
if ($limit !== null) {
$data->limit($limit)->skip($limit * ($page - 1));
}
if ($orderBy !== null) {
$orderBy .= $this->translatableOperator($orderBy);
$direction = $ascending == 1 ? 'ASC' : 'DESC';
$data->orderBy($orderBy, $direction);
}
$results = $data->get()
->translate(config('typicms.content_locale'));
return [
'data' => $results,
'count' => $count,
];
} | [
"public",
"function",
"allFiltered",
"(",
"$",
"columns",
"=",
"[",
"]",
",",
"array",
"$",
"with",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"request",
"(",
")",
"->",
"all",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"with",
"(",
... | Get all models sorted, filtered and paginated.
@param array $columns
@param array $with
@return array | [
"Get",
"all",
"models",
"sorted",
"filtered",
"and",
"paginated",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Repositories/EloquentRepository.php#L200-L235 |
46,206 | TypiCMS/Core | src/Repositories/EloquentRepository.php | EloquentRepository.sort | public function sort(array $data)
{
foreach ($data['item'] as $position => $item) {
$page = $this->find($item['id']);
$sortData = $this->getSortData($position + 1, $item);
$page->update($sortData);
if ($data['moved'] == $item['id']) {
$this->fireResetChildrenUriEvent($page);
}
}
$this->forgetCache();
} | php | public function sort(array $data)
{
foreach ($data['item'] as $position => $item) {
$page = $this->find($item['id']);
$sortData = $this->getSortData($position + 1, $item);
$page->update($sortData);
if ($data['moved'] == $item['id']) {
$this->fireResetChildrenUriEvent($page);
}
}
$this->forgetCache();
} | [
"public",
"function",
"sort",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"[",
"'item'",
"]",
"as",
"$",
"position",
"=>",
"$",
"item",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"item",
"[",
"'id'",
... | Sort models.
@param array $data updated data
@return null | [
"Sort",
"models",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Repositories/EloquentRepository.php#L288-L302 |
46,207 | TypiCMS/Core | src/Repositories/EloquentRepository.php | EloquentRepository.detachFile | public function detachFile($page, $file)
{
$filesIds = $page->files->pluck('id')->toArray();
$pivotData = [];
$position = 1;
foreach ($filesIds as $fileId) {
if ($fileId != $file->id) {
$pivotData[$fileId] = ['position' => $position++];
}
}
$page->files()->sync($pivotData);
$this->forgetCache();
} | php | public function detachFile($page, $file)
{
$filesIds = $page->files->pluck('id')->toArray();
$pivotData = [];
$position = 1;
foreach ($filesIds as $fileId) {
if ($fileId != $file->id) {
$pivotData[$fileId] = ['position' => $position++];
}
}
$page->files()->sync($pivotData);
$this->forgetCache();
} | [
"public",
"function",
"detachFile",
"(",
"$",
"page",
",",
"$",
"file",
")",
"{",
"$",
"filesIds",
"=",
"$",
"page",
"->",
"files",
"->",
"pluck",
"(",
"'id'",
")",
"->",
"toArray",
"(",
")",
";",
"$",
"pivotData",
"=",
"[",
"]",
";",
"$",
"posit... | Remove files from model. | [
"Remove",
"files",
"from",
"model",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Repositories/EloquentRepository.php#L307-L319 |
46,208 | TypiCMS/Core | src/Repositories/EloquentRepository.php | EloquentRepository.attachFiles | public function attachFiles($model, Request $request)
{
// Get the collection of files to add.
$fileIds = $request->only('files')['files'];
$files = File::whereIn('id', $fileIds)->get();
// Empty collection that will contain files that are in selected directories.
$subFiles = collect();
// Remove folders and build array of ids.
$newFiles = $files->each(function (Model $item) use ($subFiles) {
if ($item->type === 'f') {
foreach ($item->children as $file) {
if ($file->type !== 'f') {
// Add files in this directory to collection of SubFiles
$subFiles->push($file);
}
}
}
})->reject(function (Model $item) {
return $item->type === 'f';
})
->pluck('id')
->toArray();
// Transform subfiles collection to array of ids.
$subFiles = $subFiles->pluck('id')->toArray();
// Merge files with files in directory.
$newFiles = array_merge($newFiles, $subFiles);
// Get files that are already in the gallery.
$filesIds = $model->files->pluck('id')->toArray();
// Merge with new files.
$files = array_unique(array_merge($filesIds, $newFiles));
$number = count($files) - count($filesIds);
// Prepare synchronisation.
$pivotData = [];
$position = 1;
foreach ($files as $fileId) {
$pivotData[$fileId] = ['position' => $position++];
}
// Sync.
$model->files()->sync($pivotData);
$this->forgetCache();
return response()->json([
'number' => $number,
'message' => __(':number items were added.', compact('number')),
'models' => $model->files()->get(),
]);
} | php | public function attachFiles($model, Request $request)
{
// Get the collection of files to add.
$fileIds = $request->only('files')['files'];
$files = File::whereIn('id', $fileIds)->get();
// Empty collection that will contain files that are in selected directories.
$subFiles = collect();
// Remove folders and build array of ids.
$newFiles = $files->each(function (Model $item) use ($subFiles) {
if ($item->type === 'f') {
foreach ($item->children as $file) {
if ($file->type !== 'f') {
// Add files in this directory to collection of SubFiles
$subFiles->push($file);
}
}
}
})->reject(function (Model $item) {
return $item->type === 'f';
})
->pluck('id')
->toArray();
// Transform subfiles collection to array of ids.
$subFiles = $subFiles->pluck('id')->toArray();
// Merge files with files in directory.
$newFiles = array_merge($newFiles, $subFiles);
// Get files that are already in the gallery.
$filesIds = $model->files->pluck('id')->toArray();
// Merge with new files.
$files = array_unique(array_merge($filesIds, $newFiles));
$number = count($files) - count($filesIds);
// Prepare synchronisation.
$pivotData = [];
$position = 1;
foreach ($files as $fileId) {
$pivotData[$fileId] = ['position' => $position++];
}
// Sync.
$model->files()->sync($pivotData);
$this->forgetCache();
return response()->json([
'number' => $number,
'message' => __(':number items were added.', compact('number')),
'models' => $model->files()->get(),
]);
} | [
"public",
"function",
"attachFiles",
"(",
"$",
"model",
",",
"Request",
"$",
"request",
")",
"{",
"// Get the collection of files to add.",
"$",
"fileIds",
"=",
"$",
"request",
"->",
"only",
"(",
"'files'",
")",
"[",
"'files'",
"]",
";",
"$",
"files",
"=",
... | Attach files to a model.
@param \Illuminate\Database\Eloquent\Model $model
@param \Illuminate\Http\Request $request
@return null | [
"Attach",
"files",
"to",
"a",
"model",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Repositories/EloquentRepository.php#L329-L384 |
46,209 | TypiCMS/Core | src/Commands/Publish.php | Publish.uninstallFromComposer | private function uninstallFromComposer()
{
$uninstallCommand = 'composer remove typicms/'.$this->module;
if (function_exists('system')) {
system($uninstallCommand);
} else {
$this->line('You can now run '.$uninstallCommand.'.');
}
} | php | private function uninstallFromComposer()
{
$uninstallCommand = 'composer remove typicms/'.$this->module;
if (function_exists('system')) {
system($uninstallCommand);
} else {
$this->line('You can now run '.$uninstallCommand.'.');
}
} | [
"private",
"function",
"uninstallFromComposer",
"(",
")",
"{",
"$",
"uninstallCommand",
"=",
"'composer remove typicms/'",
".",
"$",
"this",
"->",
"module",
";",
"if",
"(",
"function_exists",
"(",
"'system'",
")",
")",
"{",
"system",
"(",
"$",
"uninstallCommand"... | Remove the module from composer. | [
"Remove",
"the",
"module",
"from",
"composer",
"."
] | 6d312499aa1ade5992780d5fb7b66fc62c7b1071 | https://github.com/TypiCMS/Core/blob/6d312499aa1ade5992780d5fb7b66fc62c7b1071/src/Commands/Publish.php#L165-L173 |
46,210 | hiqdev/hipanel-core | src/widgets/Box.php | Box.beginHeader | public function beginHeader()
{
echo Html::beginTag('div', $this->headerOptions) . "\n";
if ($this->title !== null) {
echo Html::tag('h3', $this->title, ['class' => 'box-title']);
}
if ($this->collapsable) {
echo '<div class="box-tools pull-right">
<button class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-' . ($this->collapsed ? 'plus' : 'minus') . '"></i>
</button>
</div>';
}
} | php | public function beginHeader()
{
echo Html::beginTag('div', $this->headerOptions) . "\n";
if ($this->title !== null) {
echo Html::tag('h3', $this->title, ['class' => 'box-title']);
}
if ($this->collapsable) {
echo '<div class="box-tools pull-right">
<button class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-' . ($this->collapsed ? 'plus' : 'minus') . '"></i>
</button>
</div>';
}
} | [
"public",
"function",
"beginHeader",
"(",
")",
"{",
"echo",
"Html",
"::",
"beginTag",
"(",
"'div'",
",",
"$",
"this",
"->",
"headerOptions",
")",
".",
"\"\\n\"",
";",
"if",
"(",
"$",
"this",
"->",
"title",
"!==",
"null",
")",
"{",
"echo",
"Html",
"::... | Start header section, render title if not exist. | [
"Start",
"header",
"section",
"render",
"title",
"if",
"not",
"exist",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/Box.php#L127-L140 |
46,211 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Formats.php | Formats.suffixToContentType | static public function suffixToContentType($suffix)
{
$types = self::bySuffix();
return isset($types[$suffix]) ? $types[$suffix]['content-type'] : null;
} | php | static public function suffixToContentType($suffix)
{
$types = self::bySuffix();
return isset($types[$suffix]) ? $types[$suffix]['content-type'] : null;
} | [
"static",
"public",
"function",
"suffixToContentType",
"(",
"$",
"suffix",
")",
"{",
"$",
"types",
"=",
"self",
"::",
"bySuffix",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"types",
"[",
"$",
"suffix",
"]",
")",
"?",
"$",
"types",
"[",
"$",
"suffix"... | Obtain Suffix for given content
@param string $suffix
@return string | [
"Obtain",
"Suffix",
"for",
"given",
"content"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Formats.php#L97-L101 |
46,212 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Formats.php | Formats.contentTypeToSuffix | static public function contentTypeToSuffix($contentType)
{
$types = self::byContentType();
return isset($types[$contentType]) ? $types[$contentType]['suffix'] : null;
} | php | static public function contentTypeToSuffix($contentType)
{
$types = self::byContentType();
return isset($types[$contentType]) ? $types[$contentType]['suffix'] : null;
} | [
"static",
"public",
"function",
"contentTypeToSuffix",
"(",
"$",
"contentType",
")",
"{",
"$",
"types",
"=",
"self",
"::",
"byContentType",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"types",
"[",
"$",
"contentType",
"]",
")",
"?",
"$",
"types",
"[",
... | Obtain Content-Type for given suffix
@param string $contentType
@return string | [
"Obtain",
"Content",
"-",
"Type",
"for",
"given",
"suffix"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Formats.php#L109-L113 |
46,213 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/RadaPokladniPohyb.php | RadaPokladniPohyb.getNextRecordCode | public function getNextRecordCode($code = null)
{
if (is_null($code)) {
$code = $this->getMyKey();
}
$crID = null;
if (is_string($code)) {
$sro = $this->performRequest($this->evidence.'/(kod=\''.$code.'\').json');
if (count($sro[$this->evidence])) {
$crID = current(current($sro[$this->evidence]));
}
} else {
$crID = $code;
}
$cr = $this->performRequest($this->evidence.'/'.$crID.'.json');
$radaPokladniPohyb = current($cr[$this->evidence]);
$crInfo = end($radaPokladniPohyb['polozkyRady']);
$cislo = $crInfo['cisAkt'] + 1;
if ($crInfo['zobrazNuly'] == 'true') {
return $crInfo['prefix'].sprintf('%\'.0'.$crInfo['cisDelka'].'d',
$cislo).'/'.date('y');
} else {
return $crInfo['prefix'].$cislo.'/'.date('y');
}
} | php | public function getNextRecordCode($code = null)
{
if (is_null($code)) {
$code = $this->getMyKey();
}
$crID = null;
if (is_string($code)) {
$sro = $this->performRequest($this->evidence.'/(kod=\''.$code.'\').json');
if (count($sro[$this->evidence])) {
$crID = current(current($sro[$this->evidence]));
}
} else {
$crID = $code;
}
$cr = $this->performRequest($this->evidence.'/'.$crID.'.json');
$radaPokladniPohyb = current($cr[$this->evidence]);
$crInfo = end($radaPokladniPohyb['polozkyRady']);
$cislo = $crInfo['cisAkt'] + 1;
if ($crInfo['zobrazNuly'] == 'true') {
return $crInfo['prefix'].sprintf('%\'.0'.$crInfo['cisDelka'].'d',
$cislo).'/'.date('y');
} else {
return $crInfo['prefix'].$cislo.'/'.date('y');
}
} | [
"public",
"function",
"getNextRecordCode",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"code",
")",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"getMyKey",
"(",
")",
";",
"}",
"$",
"crID",
"=",
"null",
";",
"if",
... | Obtain code for new Record
@param string $code
@return string | [
"Obtain",
"code",
"for",
"new",
"Record"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/RadaPokladniPohyb.php#L29-L55 |
46,214 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Kontakt.php | Kontakt.authenticate | public function authenticate($login, $password)
{
$defaultHttpHeaders = $this->defaultHttpHeaders;
$this->defaultHttpHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
$this->setPostFields(http_build_query(['username' => $login, 'password' => $password]));
$result = $this->performRequest('authenticate',
'POST', 'xml');
$this->defaultHttpHeaders = $defaultHttpHeaders;
if (!empty($result['message'])) {
$this->addStatusMessage($result['message'],
$result['success'] == 'true' ? 'success' : 'warning' );
}
return array_key_exists('success', $result) && $result['success'] == 'true';
} | php | public function authenticate($login, $password)
{
$defaultHttpHeaders = $this->defaultHttpHeaders;
$this->defaultHttpHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
$this->setPostFields(http_build_query(['username' => $login, 'password' => $password]));
$result = $this->performRequest('authenticate',
'POST', 'xml');
$this->defaultHttpHeaders = $defaultHttpHeaders;
if (!empty($result['message'])) {
$this->addStatusMessage($result['message'],
$result['success'] == 'true' ? 'success' : 'warning' );
}
return array_key_exists('success', $result) && $result['success'] == 'true';
} | [
"public",
"function",
"authenticate",
"(",
"$",
"login",
",",
"$",
"password",
")",
"{",
"$",
"defaultHttpHeaders",
"=",
"$",
"this",
"->",
"defaultHttpHeaders",
";",
"$",
"this",
"->",
"defaultHttpHeaders",
"[",
"'Content-Type'",
"]",
"=",
"'application/x-www-f... | Authenticate by contact
@link https://www.flexibee.eu/api/dokumentace/ref/autentizace-kontaktu/ Contact Auth
@param string $login
@param string $password
@return boolean | [
"Authenticate",
"by",
"contact"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Kontakt.php#L37-L50 |
46,215 | hiqdev/hipanel-core | src/base/Controller.php | Controller.getActionUrl | public static function getActionUrl($action = 'index', $params = [])
{
$params = is_array($params) ? $params : ['id' => $params];
return array_merge([implode('/', ['', static::moduleId(), static::controllerId(), $action])], $params);
} | php | public static function getActionUrl($action = 'index', $params = [])
{
$params = is_array($params) ? $params : ['id' => $params];
return array_merge([implode('/', ['', static::moduleId(), static::controllerId(), $action])], $params);
} | [
"public",
"static",
"function",
"getActionUrl",
"(",
"$",
"action",
"=",
"'index'",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"is_array",
"(",
"$",
"params",
")",
"?",
"$",
"params",
":",
"[",
"'id'",
"=>",
"$",
"params",
"]"... | Prepares array for building url to action based on given action id and parameters.
@param string $action action id
@param string|int|array $params ID of object to be action'ed or array of parameters
@return array array suitable for Url::to | [
"Prepares",
"array",
"for",
"building",
"url",
"to",
"action",
"based",
"on",
"given",
"action",
"id",
"and",
"parameters",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/base/Controller.php#L241-L246 |
46,216 | hiqdev/hipanel-core | src/behaviors/File.php | File.processFiles | public function processFiles($event = null)
{
/** @var Model $model */
$model = $this->owner;
$ids = [];
if (in_array($model->scenario, $this->scenarios, true)) {
$files = UploadedFile::getInstances($model, $this->attribute);
foreach ($files as $file) {
$model = $this->uploadFile($file);
$ids[] = $model->id;
}
if (!empty($ids)) {
$this->owner->{$this->targetAttribute} = implode(',', $ids);
} else {
// Protect attribute
$model->{$this->attribute} = null;
}
}
} | php | public function processFiles($event = null)
{
/** @var Model $model */
$model = $this->owner;
$ids = [];
if (in_array($model->scenario, $this->scenarios, true)) {
$files = UploadedFile::getInstances($model, $this->attribute);
foreach ($files as $file) {
$model = $this->uploadFile($file);
$ids[] = $model->id;
}
if (!empty($ids)) {
$this->owner->{$this->targetAttribute} = implode(',', $ids);
} else {
// Protect attribute
$model->{$this->attribute} = null;
}
}
} | [
"public",
"function",
"processFiles",
"(",
"$",
"event",
"=",
"null",
")",
"{",
"/** @var Model $model */",
"$",
"model",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"ids",
"=",
"[",
"]",
";",
"if",
"(",
"in_array",
"(",
"$",
"model",
"->",
"scenario",
... | Event handler for beforeInsert and beforeUpdate actions.
@param \yii\base\ModelEvent $event | [
"Event",
"handler",
"for",
"beforeInsert",
"and",
"beforeUpdate",
"actions",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/behaviors/File.php#L53-L74 |
46,217 | hiqdev/hipanel-core | src/behaviors/File.php | File.uploadFile | private function uploadFile(UploadedFile $file)
{
/** @var FileStorage $fileStorage */
$fileStorage = Yii::$app->get('fileStorage');
$filename = $fileStorage->saveUploadedFile($file);
return $fileStorage->put($filename, $file->name);
} | php | private function uploadFile(UploadedFile $file)
{
/** @var FileStorage $fileStorage */
$fileStorage = Yii::$app->get('fileStorage');
$filename = $fileStorage->saveUploadedFile($file);
return $fileStorage->put($filename, $file->name);
} | [
"private",
"function",
"uploadFile",
"(",
"UploadedFile",
"$",
"file",
")",
"{",
"/** @var FileStorage $fileStorage */",
"$",
"fileStorage",
"=",
"Yii",
"::",
"$",
"app",
"->",
"get",
"(",
"'fileStorage'",
")",
";",
"$",
"filename",
"=",
"$",
"fileStorage",
"-... | Uploads file to the API server.
@param UploadedFile $file
@return \hipanel\models\File | [
"Uploads",
"file",
"to",
"the",
"API",
"server",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/behaviors/File.php#L82-L90 |
46,218 | hiqdev/hipanel-core | src/widgets/HiBox.php | HiBox.initBoxTools | protected function initBoxTools()
{
parent::initBoxTools();
if (!isset($this->boxTools['collapse'])) {
$this->boxTools['collapse'] = [
'icon' => 'fa-minus',
'options' => [
'class' => 'btn-default',
'title' => Yii::t('hipanel', 'collapse'),
'data-widget' => 'collapse',
],
];
}
if (!isset($this->boxTools['remove'])) {
$this->boxTools['remove'] = [
'icon' => 'fa-times',
'options' => [
'class' => 'btn-default',
'title' => Yii::t('hipanel', 'remove'),
'data-widget' => 'remove',
],
];
}
} | php | protected function initBoxTools()
{
parent::initBoxTools();
if (!isset($this->boxTools['collapse'])) {
$this->boxTools['collapse'] = [
'icon' => 'fa-minus',
'options' => [
'class' => 'btn-default',
'title' => Yii::t('hipanel', 'collapse'),
'data-widget' => 'collapse',
],
];
}
if (!isset($this->boxTools['remove'])) {
$this->boxTools['remove'] = [
'icon' => 'fa-times',
'options' => [
'class' => 'btn-default',
'title' => Yii::t('hipanel', 'remove'),
'data-widget' => 'remove',
],
];
}
} | [
"protected",
"function",
"initBoxTools",
"(",
")",
"{",
"parent",
"::",
"initBoxTools",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"boxTools",
"[",
"'collapse'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"boxTools",
"[",
"'collapse'",... | Buttons render. | [
"Buttons",
"render",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/HiBox.php#L21-L44 |
46,219 | hiqdev/hipanel-core | src/widgets/HiBox.php | HiBox.renderButtons | protected function renderButtons()
{
// Box tools
if ($this->buttonsTemplate !== null && !empty($this->boxTools)) {
// Begin box tools
echo Html::beginTag('div', ['class' => 'box-tools pull-right']);
echo preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) {
$name = $matches[1];
if (isset($this->boxTools[$name])) {
$label = isset($this->boxTools[$name]['label']) ? $this->boxTools[$name]['label'] : '';
$icon = isset($this->boxTools[$name]['icon']) ? Html::tag('i', '', ['class' => 'fa ' . $this->boxTools[$name]['icon']]) : '';
$label = $icon . ' ' . $label;
$this->boxTools[$name]['options']['class'] = isset($this->boxTools[$name]['options']['class']) ? 'btn btn-sm ' . $this->boxTools[$name]['options']['class'] : 'btn btn-sm';
return Html::button($label, $this->boxTools[$name]['options']);
} else {
return '';
}
}, $this->buttonsTemplate);
// End box tools
echo Html::endTag('div');
}
} | php | protected function renderButtons()
{
// Box tools
if ($this->buttonsTemplate !== null && !empty($this->boxTools)) {
// Begin box tools
echo Html::beginTag('div', ['class' => 'box-tools pull-right']);
echo preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) {
$name = $matches[1];
if (isset($this->boxTools[$name])) {
$label = isset($this->boxTools[$name]['label']) ? $this->boxTools[$name]['label'] : '';
$icon = isset($this->boxTools[$name]['icon']) ? Html::tag('i', '', ['class' => 'fa ' . $this->boxTools[$name]['icon']]) : '';
$label = $icon . ' ' . $label;
$this->boxTools[$name]['options']['class'] = isset($this->boxTools[$name]['options']['class']) ? 'btn btn-sm ' . $this->boxTools[$name]['options']['class'] : 'btn btn-sm';
return Html::button($label, $this->boxTools[$name]['options']);
} else {
return '';
}
}, $this->buttonsTemplate);
// End box tools
echo Html::endTag('div');
}
} | [
"protected",
"function",
"renderButtons",
"(",
")",
"{",
"// Box tools",
"if",
"(",
"$",
"this",
"->",
"buttonsTemplate",
"!==",
"null",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"boxTools",
")",
")",
"{",
"// Begin box tools",
"echo",
"Html",
"::",
"beg... | Render widget tools button. | [
"Render",
"widget",
"tools",
"button",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/HiBox.php#L49-L72 |
46,220 | hiqdev/hipanel-core | src/widgets/AdvancedSearch.php | AdvancedSearch.init | public function init()
{
$this->registerMyJs();
$display_none = '';
if (ArrayHelper::remove($this->options, 'displayNone', true) === true) {
$display_none = Yii::$app->request->get($this->model->formName())['search_form'] ? '' : 'display:none';
}
if ($this->submitButtonWrapperOptions !== false) {
$this->submitButtonWrapperOptions = ArrayHelper::merge([
'class' => 'col-md-12',
], $this->submitButtonWrapperOptions);
}
$tag = ArrayHelper::remove($this->options, 'tag', 'div');
echo Html::beginTag($tag, ArrayHelper::merge([
'id' => $this->getDivId(),
'class' => 'row',
'style' => 'margin-bottom: 1rem; margin-top: 1rem; ' . $display_none,
], $this->options));
$this->_form = ActiveForm::begin([
'id' => 'form-' . $this->getDivId(),
'action' => $this->action,
'method' => $this->method,
'options' => $this->formOptions,
'fieldClass' => AdvancedSearchActiveField::class,
]);
echo Html::hiddenInput(Html::getInputName($this->model, 'search_form'), 1);
} | php | public function init()
{
$this->registerMyJs();
$display_none = '';
if (ArrayHelper::remove($this->options, 'displayNone', true) === true) {
$display_none = Yii::$app->request->get($this->model->formName())['search_form'] ? '' : 'display:none';
}
if ($this->submitButtonWrapperOptions !== false) {
$this->submitButtonWrapperOptions = ArrayHelper::merge([
'class' => 'col-md-12',
], $this->submitButtonWrapperOptions);
}
$tag = ArrayHelper::remove($this->options, 'tag', 'div');
echo Html::beginTag($tag, ArrayHelper::merge([
'id' => $this->getDivId(),
'class' => 'row',
'style' => 'margin-bottom: 1rem; margin-top: 1rem; ' . $display_none,
], $this->options));
$this->_form = ActiveForm::begin([
'id' => 'form-' . $this->getDivId(),
'action' => $this->action,
'method' => $this->method,
'options' => $this->formOptions,
'fieldClass' => AdvancedSearchActiveField::class,
]);
echo Html::hiddenInput(Html::getInputName($this->model, 'search_form'), 1);
} | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"registerMyJs",
"(",
")",
";",
"$",
"display_none",
"=",
"''",
";",
"if",
"(",
"ArrayHelper",
"::",
"remove",
"(",
"$",
"this",
"->",
"options",
",",
"'displayNone'",
",",
"true",
")",
"... | Renders the starting div. | [
"Renders",
"the",
"starting",
"div",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/AdvancedSearch.php#L87-L117 |
46,221 | hiqdev/hipanel-core | src/actions/RenderAction.php | RenderAction.getParams | public function getParams()
{
$res = [];
if ($this->_params instanceof Closure) {
$res = call_user_func($this->_params, $this);
} else {
foreach ($this->_params as $k => $v) {
$res[$k] = $v instanceof Closure ? call_user_func($v, $this, $this->getModel()) : $v;
}
}
return array_merge($res, $this->prepareData($res));
} | php | public function getParams()
{
$res = [];
if ($this->_params instanceof Closure) {
$res = call_user_func($this->_params, $this);
} else {
foreach ($this->_params as $k => $v) {
$res[$k] = $v instanceof Closure ? call_user_func($v, $this, $this->getModel()) : $v;
}
}
return array_merge($res, $this->prepareData($res));
} | [
"public",
"function",
"getParams",
"(",
")",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"_params",
"instanceof",
"Closure",
")",
"{",
"$",
"res",
"=",
"call_user_func",
"(",
"$",
"this",
"->",
"_params",
",",
"$",
"this",
")... | Prepares params for rendering, executing callable functions.
@return array | [
"Prepares",
"params",
"for",
"rendering",
"executing",
"callable",
"functions",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/actions/RenderAction.php#L38-L50 |
46,222 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Zurnal.php | Zurnal.getAllChanges | public function getAllChanges($object)
{
$changesArray = [];
$evidence = $object->getEvidence();
if (array_key_exists($evidence, self::$evidenceToDb)) {
$dbTable = self::$evidenceToDb[$evidence];
$changes = $this->getColumnsFromFlexibee('*',
['tabulka' => $dbTable, 'idZaznamu' => $object->getMyKey()]);
foreach ($changes as $change) {
$changesArray[$change['datCas']][$change['sloupec']] = $change;
}
}
return $changesArray;
} | php | public function getAllChanges($object)
{
$changesArray = [];
$evidence = $object->getEvidence();
if (array_key_exists($evidence, self::$evidenceToDb)) {
$dbTable = self::$evidenceToDb[$evidence];
$changes = $this->getColumnsFromFlexibee('*',
['tabulka' => $dbTable, 'idZaznamu' => $object->getMyKey()]);
foreach ($changes as $change) {
$changesArray[$change['datCas']][$change['sloupec']] = $change;
}
}
return $changesArray;
} | [
"public",
"function",
"getAllChanges",
"(",
"$",
"object",
")",
"{",
"$",
"changesArray",
"=",
"[",
"]",
";",
"$",
"evidence",
"=",
"$",
"object",
"->",
"getEvidence",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"evidence",
",",
"self",
"::... | obtain all record changes array
Note: Do not use this method in production environment!
If you have no other choice pleas add indexes into wzurnal
postgesql table:
CREATE INDEX CONCURRENTLY tname_index ON wzurnal (tabulka);
CREATE INDEX CONCURRENTLY rid_index ON wzurnal (idZaznamu);
@param FlexiBeeRO $object
@return array changes history | [
"obtain",
"all",
"record",
"changes",
"array"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Zurnal.php#L62-L77 |
46,223 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Zurnal.php | Zurnal.getLastChange | public function getLastChange($object)
{
$lastChange = null;
$allChanges = $this->getAllChanges($object);
if (count($allChanges)) {
$lastChange = end($allChanges);
}
return $lastChange;
} | php | public function getLastChange($object)
{
$lastChange = null;
$allChanges = $this->getAllChanges($object);
if (count($allChanges)) {
$lastChange = end($allChanges);
}
return $lastChange;
} | [
"public",
"function",
"getLastChange",
"(",
"$",
"object",
")",
"{",
"$",
"lastChange",
"=",
"null",
";",
"$",
"allChanges",
"=",
"$",
"this",
"->",
"getAllChanges",
"(",
"$",
"object",
")",
";",
"if",
"(",
"count",
"(",
"$",
"allChanges",
")",
")",
... | obtain last change array
@param FlexiBeeRO $object
@return array Old/New values pairs | [
"obtain",
"last",
"change",
"array"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Zurnal.php#L85-L93 |
46,224 | hiqdev/hipanel-core | src/actions/SwitchRule.php | SwitchRule.setAction | public function setAction($action, $postfix = null)
{
if (!$action) {
return;
}
if (!isset($action['parent'])) {
$action['parent'] = $this->switch;
}
$this->switch->controller->setInternalAction($this->getId($postfix), $action);
} | php | public function setAction($action, $postfix = null)
{
if (!$action) {
return;
}
if (!isset($action['parent'])) {
$action['parent'] = $this->switch;
}
$this->switch->controller->setInternalAction($this->getId($postfix), $action);
} | [
"public",
"function",
"setAction",
"(",
"$",
"action",
",",
"$",
"postfix",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"action",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"action",
"[",
"'parent'",
"]",
")",
")",
"{",
"$... | Setter for action. Saves the action to the controller.
@param mixed $action action config
@param null $postfix | [
"Setter",
"for",
"action",
".",
"Saves",
"the",
"action",
"to",
"the",
"controller",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/actions/SwitchRule.php#L96-L105 |
46,225 | hiqdev/hipanel-core | src/components/FileStorage.php | FileStorage.getTemporaryViewUrl | protected function getTemporaryViewUrl($filename)
{
return Url::to([$this->temporaryViewRoute, 'filename' => $filename, 'key' => $this->buildHash($filename)], true);
} | php | protected function getTemporaryViewUrl($filename)
{
return Url::to([$this->temporaryViewRoute, 'filename' => $filename, 'key' => $this->buildHash($filename)], true);
} | [
"protected",
"function",
"getTemporaryViewUrl",
"(",
"$",
"filename",
")",
"{",
"return",
"Url",
"::",
"to",
"(",
"[",
"$",
"this",
"->",
"temporaryViewRoute",
",",
"'filename'",
"=>",
"$",
"filename",
",",
"'key'",
"=>",
"$",
"this",
"->",
"buildHash",
"(... | Return URL to the route that provides access to the temporary file.
@param string $filename the file name
@return string URL
@see temporaryViewRoute | [
"Return",
"URL",
"to",
"the",
"route",
"that",
"provides",
"access",
"to",
"the",
"temporary",
"file",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/components/FileStorage.php#L253-L256 |
46,226 | hiqdev/hipanel-core | src/widgets/BlockModalButton.php | BlockModalButton.modalBegin | protected function modalBegin()
{
$config = ArrayHelper::merge([
'class' => ModalButton::class,
'model' => $this->model,
'scenario' => $this->scenario,
'button' => $this->button,
'form' => [
'enableAjaxValidation' => true,
'validationUrl' => $this->validationUrl,
],
'modal' => [
'header' => Html::tag(ArrayHelper::remove($this->header, 'tag', 'h4'),
ArrayHelper::remove($this->header, 'label')),
'headerOptions' => $this->header,
'footer' => $this->footer,
],
], $this->modal);
$this->modal = call_user_func([ArrayHelper::remove($config, 'class'), 'begin'], $config);
} | php | protected function modalBegin()
{
$config = ArrayHelper::merge([
'class' => ModalButton::class,
'model' => $this->model,
'scenario' => $this->scenario,
'button' => $this->button,
'form' => [
'enableAjaxValidation' => true,
'validationUrl' => $this->validationUrl,
],
'modal' => [
'header' => Html::tag(ArrayHelper::remove($this->header, 'tag', 'h4'),
ArrayHelper::remove($this->header, 'label')),
'headerOptions' => $this->header,
'footer' => $this->footer,
],
], $this->modal);
$this->modal = call_user_func([ArrayHelper::remove($config, 'class'), 'begin'], $config);
} | [
"protected",
"function",
"modalBegin",
"(",
")",
"{",
"$",
"config",
"=",
"ArrayHelper",
"::",
"merge",
"(",
"[",
"'class'",
"=>",
"ModalButton",
"::",
"class",
",",
"'model'",
"=>",
"$",
"this",
"->",
"model",
",",
"'scenario'",
"=>",
"$",
"this",
"->",... | Begins modal.
@throws \yii\base\InvalidConfigException | [
"Begins",
"modal",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/BlockModalButton.php#L197-L217 |
46,227 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.assignResultIDs | public function assignResultIDs($candidates)
{
foreach ($this->chained as $chid => $chained) {
$chainedEvidence = $chained->getEvidence();
$chainedExtid = $chained->getRecordID();
if (is_array($chainedExtid)) { //if there are more IDs
foreach ($chainedExtid as $extId) { //find external ID in format ext:.....
if (stripos($extId, 'ext:') === 0) {
$chainedExtid = $extId;
break;
}
}
}
$chained->getData();
if (isset($candidates[$chainedEvidence][$chainedExtid])) {
$chained->setMyKey($candidates[$chainedEvidence][$chainedExtid]);
$chained->setDataValue('external-ids', [$chainedExtid]);
}
if (count($this->chained[$chid]->chained)) {
$this->chained[$chid]->assignResultIDs($candidates);
}
}
} | php | public function assignResultIDs($candidates)
{
foreach ($this->chained as $chid => $chained) {
$chainedEvidence = $chained->getEvidence();
$chainedExtid = $chained->getRecordID();
if (is_array($chainedExtid)) { //if there are more IDs
foreach ($chainedExtid as $extId) { //find external ID in format ext:.....
if (stripos($extId, 'ext:') === 0) {
$chainedExtid = $extId;
break;
}
}
}
$chained->getData();
if (isset($candidates[$chainedEvidence][$chainedExtid])) {
$chained->setMyKey($candidates[$chainedEvidence][$chainedExtid]);
$chained->setDataValue('external-ids', [$chainedExtid]);
}
if (count($this->chained[$chid]->chained)) {
$this->chained[$chid]->assignResultIDs($candidates);
}
}
} | [
"public",
"function",
"assignResultIDs",
"(",
"$",
"candidates",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"chained",
"as",
"$",
"chid",
"=>",
"$",
"chained",
")",
"{",
"$",
"chainedEvidence",
"=",
"$",
"chained",
"->",
"getEvidence",
"(",
")",
";",
... | Assign result IDs to its source objects
@param array $candidates FlexiBee insert IDs prepared by extractResultIDs() | [
"Assign",
"result",
"IDs",
"to",
"its",
"source",
"objects"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L127-L149 |
46,228 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.extractResultIDs | public function extractResultIDs($resultInfo)
{
$candidates = [];
foreach ($resultInfo as $insertResult) {
$newID = $insertResult['id'];
if (array_key_exists('request-id', $insertResult)) {
$extid = $insertResult['request-id'];
} else {
$extid = null;
}
$evidence = explode('/', $insertResult['ref'])[3];
$candidates[$evidence][$extid] = $newID;
}
return $candidates;
} | php | public function extractResultIDs($resultInfo)
{
$candidates = [];
foreach ($resultInfo as $insertResult) {
$newID = $insertResult['id'];
if (array_key_exists('request-id', $insertResult)) {
$extid = $insertResult['request-id'];
} else {
$extid = null;
}
$evidence = explode('/', $insertResult['ref'])[3];
$candidates[$evidence][$extid] = $newID;
}
return $candidates;
} | [
"public",
"function",
"extractResultIDs",
"(",
"$",
"resultInfo",
")",
"{",
"$",
"candidates",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"resultInfo",
"as",
"$",
"insertResult",
")",
"{",
"$",
"newID",
"=",
"$",
"insertResult",
"[",
"'id'",
"]",
";",
"i... | Extract IDs from FlexiBee response Array
@param array $resultInfo FlexiBee response
@return array List of [ 'evidence1'=>[ 'original-id'=>numericID,'original-id2'=>numericID2 ], 'evidence2'=> ... ] | [
"Extract",
"IDs",
"from",
"FlexiBee",
"response",
"Array"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L158-L172 |
46,229 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.takeData | public function takeData($data)
{
if ($this->debug === true) {
$fbRelations = [];
$fbColumns = $this->getColumnsInfo();
foreach ($this->getRelationsInfo() as $relation) {
if (is_array($relation) && isset($relation['url'])) {
$fbRelations[$relation['url']] = $relation['url'];
}
}
if (count($fbColumns)) {
foreach ($data as $key => $value) {
if (!array_key_exists($key, $fbColumns)) {
if (!array_key_exists($key, $fbRelations)) {
$this->addStatusMessage(sprintf('unknown column %s for evidence %s',
$key, $this->getEvidence()), 'warning');
} else {
if (!is_array($value)) {
$this->addStatusMessage(sprintf('subevidence %s in evidence %s must bee an array',
$key, $this->getEvidence()), 'warning');
}
}
}
}
}
}
return parent::takeData($data);
} | php | public function takeData($data)
{
if ($this->debug === true) {
$fbRelations = [];
$fbColumns = $this->getColumnsInfo();
foreach ($this->getRelationsInfo() as $relation) {
if (is_array($relation) && isset($relation['url'])) {
$fbRelations[$relation['url']] = $relation['url'];
}
}
if (count($fbColumns)) {
foreach ($data as $key => $value) {
if (!array_key_exists($key, $fbColumns)) {
if (!array_key_exists($key, $fbRelations)) {
$this->addStatusMessage(sprintf('unknown column %s for evidence %s',
$key, $this->getEvidence()), 'warning');
} else {
if (!is_array($value)) {
$this->addStatusMessage(sprintf('subevidence %s in evidence %s must bee an array',
$key, $this->getEvidence()), 'warning');
}
}
}
}
}
}
return parent::takeData($data);
} | [
"public",
"function",
"takeData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
"===",
"true",
")",
"{",
"$",
"fbRelations",
"=",
"[",
"]",
";",
"$",
"fbColumns",
"=",
"$",
"this",
"->",
"getColumnsInfo",
"(",
")",
";",
"foreac... | Control for existing column names in evidence and take data
@param array $data Data to keep
@return int number of records taken | [
"Control",
"for",
"existing",
"column",
"names",
"in",
"evidence",
"and",
"take",
"data"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L210-L238 |
46,230 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.controlMandatoryColumns | public function controlMandatoryColumns($data = null)
{
if (is_null($data)) {
$data = $this->getData();
}
$missingMandatoryColumns = [];
if (!empty($data) && count($data)) {
$fbColumns = $this->getColumnsInfo();
if (count($fbColumns)) {
foreach ($fbColumns as $columnName => $columnInfo) {
$mandatory = ($columnInfo['mandatory'] == 'true');
if ($mandatory && !array_key_exists($columnName, $data)) {
$missingMandatoryColumns[$columnName] = $columnInfo['name'];
}
}
}
}
return $missingMandatoryColumns;
} | php | public function controlMandatoryColumns($data = null)
{
if (is_null($data)) {
$data = $this->getData();
}
$missingMandatoryColumns = [];
if (!empty($data) && count($data)) {
$fbColumns = $this->getColumnsInfo();
if (count($fbColumns)) {
foreach ($fbColumns as $columnName => $columnInfo) {
$mandatory = ($columnInfo['mandatory'] == 'true');
if ($mandatory && !array_key_exists($columnName, $data)) {
$missingMandatoryColumns[$columnName] = $columnInfo['name'];
}
}
}
}
return $missingMandatoryColumns;
} | [
"public",
"function",
"controlMandatoryColumns",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getData",
"(",
")",
";",
"}",
"$",
"missingMandatoryColumns",
"=",
... | Control data for mandatory columns presence.
@deprecated since version 1.8.7
@param array $data
@return array List of missing columns. Empty if all is ok | [
"Control",
"data",
"for",
"mandatory",
"columns",
"presence",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L249-L267 |
46,231 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.controlReadOnlyColumns | public function controlReadOnlyColumns($data = null)
{
if (is_null($data)) {
$data = $this->getData();
}
$readonlyColumns = [];
$fbColumns = $this->getColumnsInfo();
if (!empty($fbColumns) && count($fbColumns)) {
foreach ($fbColumns as $columnName => $columnInfo) {
$writable = ($columnInfo['isWritable'] == 'true');
if (!$writable && !array_key_exists($columnName, $data)) {
$readonlyColumns[$columnName] = $columnInfo['name'];
}
}
}
return $readonlyColumns;
} | php | public function controlReadOnlyColumns($data = null)
{
if (is_null($data)) {
$data = $this->getData();
}
$readonlyColumns = [];
$fbColumns = $this->getColumnsInfo();
if (!empty($fbColumns) && count($fbColumns)) {
foreach ($fbColumns as $columnName => $columnInfo) {
$writable = ($columnInfo['isWritable'] == 'true');
if (!$writable && !array_key_exists($columnName, $data)) {
$readonlyColumns[$columnName] = $columnInfo['name'];
}
}
}
return $readonlyColumns;
} | [
"public",
"function",
"controlReadOnlyColumns",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getData",
"(",
")",
";",
"}",
"$",
"readonlyColumns",
"=",
"[",
"]... | Control data for readonly columns presence.
@param array $data
@return array List of ReadOnly columns. Empty if all is ok | [
"Control",
"data",
"for",
"readonly",
"columns",
"presence",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L276-L294 |
46,232 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.timestampToFlexiDate | public static function timestampToFlexiDate($timpestamp = null)
{
$flexiDate = null;
if (!is_null($timpestamp)) {
$date = new \DateTime();
$date->setTimestamp($timpestamp);
$flexiDate = $date->format('Y-m-d');
}
return $flexiDate;
} | php | public static function timestampToFlexiDate($timpestamp = null)
{
$flexiDate = null;
if (!is_null($timpestamp)) {
$date = new \DateTime();
$date->setTimestamp($timpestamp);
$flexiDate = $date->format('Y-m-d');
}
return $flexiDate;
} | [
"public",
"static",
"function",
"timestampToFlexiDate",
"(",
"$",
"timpestamp",
"=",
"null",
")",
"{",
"$",
"flexiDate",
"=",
"null",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"timpestamp",
")",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",... | Convert Timestamp to FlexiBee Date format.
@param int $timpestamp
@return string FlexiBee Date or NULL | [
"Convert",
"Timestamp",
"to",
"FlexiBee",
"Date",
"format",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L303-L312 |
46,233 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.timestampToFlexiDateTime | public static function timestampToFlexiDateTime($timpestamp = null)
{
$flexiDateTime = null;
if (!is_null($timpestamp)) {
$date = new \DateTime();
$date->setTimestamp($timpestamp);
$flexiDateTime = $date->format('Y-m-dTH:i:s');
}
return $flexiDateTime;
} | php | public static function timestampToFlexiDateTime($timpestamp = null)
{
$flexiDateTime = null;
if (!is_null($timpestamp)) {
$date = new \DateTime();
$date->setTimestamp($timpestamp);
$flexiDateTime = $date->format('Y-m-dTH:i:s');
}
return $flexiDateTime;
} | [
"public",
"static",
"function",
"timestampToFlexiDateTime",
"(",
"$",
"timpestamp",
"=",
"null",
")",
"{",
"$",
"flexiDateTime",
"=",
"null",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"timpestamp",
")",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime"... | Convert Timestamp to Flexi DateTime format.
@param int $timpestamp
@return string FlexiBee DateTime or NULL | [
"Convert",
"Timestamp",
"to",
"Flexi",
"DateTime",
"format",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L321-L330 |
46,234 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.sync | public function sync($data = null)
{
$this->insertToFlexiBee($data);
$insertResult = $this->lastResponseCode;
if ($insertResult == 201) {
$this->reload();
}
$loadResult = $this->lastResponseCode;
return ($insertResult + $loadResult) == 401;
} | php | public function sync($data = null)
{
$this->insertToFlexiBee($data);
$insertResult = $this->lastResponseCode;
if ($insertResult == 201) {
$this->reload();
}
$loadResult = $this->lastResponseCode;
return ($insertResult + $loadResult) == 401;
} | [
"public",
"function",
"sync",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"insertToFlexiBee",
"(",
"$",
"data",
")",
";",
"$",
"insertResult",
"=",
"$",
"this",
"->",
"lastResponseCode",
";",
"if",
"(",
"$",
"insertResult",
"==",
"201",... | Insert current data into FlexiBee and load actual record data back
@param array $data Initial data to save
@return boolean Operation success | [
"Insert",
"current",
"data",
"into",
"FlexiBee",
"and",
"load",
"actual",
"record",
"data",
"back"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L455-L464 |
46,235 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.copy | public function copy($source, $overrides = [])
{
$this->sourceId = $source;
return $this->sync($overrides) ? $this : null;
} | php | public function copy($source, $overrides = [])
{
$this->sourceId = $source;
return $this->sync($overrides) ? $this : null;
} | [
"public",
"function",
"copy",
"(",
"$",
"source",
",",
"$",
"overrides",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"sourceId",
"=",
"$",
"source",
";",
"return",
"$",
"this",
"->",
"sync",
"(",
"$",
"overrides",
")",
"?",
"$",
"this",
":",
"nul... | Make Copy of given record with optional modifiactions
!!!Experimental Feature!!!
@param int $source
@param array $overrides
@return FlexiBeeRW|null copied record object or null in case of failure | [
"Make",
"Copy",
"of",
"given",
"record",
"with",
"optional",
"modifiactions"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L476-L480 |
46,236 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRW.php | FlexiBeeRW.changeExternalID | public function changeExternalID($selector, $newValue, $forID = null)
{
$change['@removeExternalIds'] = 'ext:'.$selector.':';
$change['id'] = [is_null($forID) ? $this->getRecordID() : $forID,
'ext:'.$selector.':'.$newValue];
return $this->insertToFlexiBee($change);
} | php | public function changeExternalID($selector, $newValue, $forID = null)
{
$change['@removeExternalIds'] = 'ext:'.$selector.':';
$change['id'] = [is_null($forID) ? $this->getRecordID() : $forID,
'ext:'.$selector.':'.$newValue];
return $this->insertToFlexiBee($change);
} | [
"public",
"function",
"changeExternalID",
"(",
"$",
"selector",
",",
"$",
"newValue",
",",
"$",
"forID",
"=",
"null",
")",
"{",
"$",
"change",
"[",
"'@removeExternalIds'",
"]",
"=",
"'ext:'",
".",
"$",
"selector",
".",
"':'",
";",
"$",
"change",
"[",
"... | Change Value of external id identified by selector. Add new if not exists
@param string $selector ext:$selector:$newValue
@param string|int $newValue string or number
@param string|int $forID Other than current record id
@return array operation result | [
"Change",
"Value",
"of",
"external",
"id",
"identified",
"by",
"selector",
".",
"Add",
"new",
"if",
"not",
"exists"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRW.php#L552-L558 |
46,237 | hiqdev/hipanel-core | src/logic/Impersonator.php | Impersonator.buildAuthUrl | public function buildAuthUrl($user_id)
{
return $this->getClient()->buildAuthUrl([
'redirect_uri' => Url::toRoute(['/site/impersonate-auth', 'authclient' => $this->defaultAuthClient], true),
'user_id' => $user_id,
]);
} | php | public function buildAuthUrl($user_id)
{
return $this->getClient()->buildAuthUrl([
'redirect_uri' => Url::toRoute(['/site/impersonate-auth', 'authclient' => $this->defaultAuthClient], true),
'user_id' => $user_id,
]);
} | [
"public",
"function",
"buildAuthUrl",
"(",
"$",
"user_id",
")",
"{",
"return",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"buildAuthUrl",
"(",
"[",
"'redirect_uri'",
"=>",
"Url",
"::",
"toRoute",
"(",
"[",
"'/site/impersonate-auth'",
",",
"'authclient'",
... | Method should be called to generate URL for user redirect.
@param string $user_id
@return string | [
"Method",
"should",
"be",
"called",
"to",
"generate",
"URL",
"for",
"user",
"redirect",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/logic/Impersonator.php#L48-L54 |
46,238 | hiqdev/hipanel-core | src/logic/Impersonator.php | Impersonator.impersonateUser | public function impersonateUser(HiamClient $client)
{
$attributes = $client->getUserAttributes();
$identity = new User();
foreach ($identity->attributes() as $k) {
if (isset($attributes[$k])) {
$identity->{$k} = $attributes[$k];
}
}
if ($this->user->getId() === $identity->getId()) {
return;
}
$identity->save();
$this->session->set('__realId', $this->user->getId());
$this->user->setIdentity($identity);
$this->session->set($this->user->idParam, $this->user->getId());
} | php | public function impersonateUser(HiamClient $client)
{
$attributes = $client->getUserAttributes();
$identity = new User();
foreach ($identity->attributes() as $k) {
if (isset($attributes[$k])) {
$identity->{$k} = $attributes[$k];
}
}
if ($this->user->getId() === $identity->getId()) {
return;
}
$identity->save();
$this->session->set('__realId', $this->user->getId());
$this->user->setIdentity($identity);
$this->session->set($this->user->idParam, $this->user->getId());
} | [
"public",
"function",
"impersonateUser",
"(",
"HiamClient",
"$",
"client",
")",
"{",
"$",
"attributes",
"=",
"$",
"client",
"->",
"getUserAttributes",
"(",
")",
";",
"$",
"identity",
"=",
"new",
"User",
"(",
")",
";",
"foreach",
"(",
"$",
"identity",
"->... | Method should be called when authentication succeeded.
@param HiamClient $client | [
"Method",
"should",
"be",
"called",
"when",
"authentication",
"succeeded",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/logic/Impersonator.php#L68-L85 |
46,239 | hiqdev/hipanel-core | src/logic/Impersonator.php | Impersonator.unimpersonateUser | public function unimpersonateUser()
{
$realId = $this->session->remove('__realId');
if ($realId !== null) {
$this->user->identity->remove();
$this->session->set($this->user->idParam, $realId);
$identity = User::findOne($realId);
$this->user->setIdentity($identity);
$this->restoreBackedUpToken();
}
} | php | public function unimpersonateUser()
{
$realId = $this->session->remove('__realId');
if ($realId !== null) {
$this->user->identity->remove();
$this->session->set($this->user->idParam, $realId);
$identity = User::findOne($realId);
$this->user->setIdentity($identity);
$this->restoreBackedUpToken();
}
} | [
"public",
"function",
"unimpersonateUser",
"(",
")",
"{",
"$",
"realId",
"=",
"$",
"this",
"->",
"session",
"->",
"remove",
"(",
"'__realId'",
")",
";",
"if",
"(",
"$",
"realId",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"user",
"->",
"identity",
"... | Method should be called when user should be unimpersonated. | [
"Method",
"should",
"be",
"called",
"when",
"user",
"should",
"be",
"unimpersonated",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/logic/Impersonator.php#L90-L100 |
46,240 | hiqdev/hipanel-core | src/widgets/combo/InternalObjectCombo.php | InternalObjectCombo.reset | private function reset(): void
{
$attributes = [
'_primaryFilter' => null,
];
foreach ($attributes as $attribute => $defaultValue) {
$this->$attribute = $defaultValue;
}
} | php | private function reset(): void
{
$attributes = [
'_primaryFilter' => null,
];
foreach ($attributes as $attribute => $defaultValue) {
$this->$attribute = $defaultValue;
}
} | [
"private",
"function",
"reset",
"(",
")",
":",
"void",
"{",
"$",
"attributes",
"=",
"[",
"'_primaryFilter'",
"=>",
"null",
",",
"]",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"attribute",
"=>",
"$",
"defaultValue",
")",
"{",
"$",
"this",
"->",... | Reset attributes which may remains from the previous combo-object which leads to incorrect JS configuration. | [
"Reset",
"attributes",
"which",
"may",
"remains",
"from",
"the",
"previous",
"combo",
"-",
"object",
"which",
"leads",
"to",
"incorrect",
"JS",
"configuration",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/combo/InternalObjectCombo.php#L182-L190 |
46,241 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.setObjectName | public function setObjectName($objectName = null)
{
return parent::setObjectName(is_null($objectName) ? ( empty($this->getRecordIdent())
? $this->getObjectName() : $this->getRecordIdent().'@'.$this->getObjectName() )
: $objectName);
} | php | public function setObjectName($objectName = null)
{
return parent::setObjectName(is_null($objectName) ? ( empty($this->getRecordIdent())
? $this->getObjectName() : $this->getRecordIdent().'@'.$this->getObjectName() )
: $objectName);
} | [
"public",
"function",
"setObjectName",
"(",
"$",
"objectName",
"=",
"null",
")",
"{",
"return",
"parent",
"::",
"setObjectName",
"(",
"is_null",
"(",
"$",
"objectName",
")",
"?",
"(",
"empty",
"(",
"$",
"this",
"->",
"getRecordIdent",
"(",
")",
")",
"?",... | Set internal Object name
@param string $objectName
@return string Jméno objektu | [
"Set",
"internal",
"Object",
"name"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L419-L424 |
46,242 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.setupProperty | public function setupProperty($options, $name, $constant = null)
{
if (array_key_exists($name, $options)) {
$this->$name = $options[$name];
} else {
if (property_exists($this, $name) && !empty($constant) && defined($constant)) {
$this->$name = constant($constant);
}
}
} | php | public function setupProperty($options, $name, $constant = null)
{
if (array_key_exists($name, $options)) {
$this->$name = $options[$name];
} else {
if (property_exists($this, $name) && !empty($constant) && defined($constant)) {
$this->$name = constant($constant);
}
}
} | [
"public",
"function",
"setupProperty",
"(",
"$",
"options",
",",
"$",
"name",
",",
"$",
"constant",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"options",
")",
")",
"{",
"$",
"this",
"->",
"$",
"name",
"=",
"$"... | Set up one of properties
@param array $options array of given properties
@param string $name name of property to process
@param string $constant load default property value from constant | [
"Set",
"up",
"one",
"of",
"properties"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L486-L495 |
46,243 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.companyUrlToOptions | public static function companyUrlToOptions($companyUrl)
{
$urlParts = parse_url($companyUrl);
$scheme = isset($urlParts['scheme']) ? $urlParts['scheme'].'://' : '';
$host = isset($urlParts['host']) ? $urlParts['host'] : '';
$port = isset($urlParts['port']) ? ':'.$urlParts['port'] : '';
$path = isset($urlParts['path']) ? $urlParts['path'] : '';
$options['company'] = basename($path);
$options['url'] = $scheme.$host.$port;
return $options;
} | php | public static function companyUrlToOptions($companyUrl)
{
$urlParts = parse_url($companyUrl);
$scheme = isset($urlParts['scheme']) ? $urlParts['scheme'].'://' : '';
$host = isset($urlParts['host']) ? $urlParts['host'] : '';
$port = isset($urlParts['port']) ? ':'.$urlParts['port'] : '';
$path = isset($urlParts['path']) ? $urlParts['path'] : '';
$options['company'] = basename($path);
$options['url'] = $scheme.$host.$port;
return $options;
} | [
"public",
"static",
"function",
"companyUrlToOptions",
"(",
"$",
"companyUrl",
")",
"{",
"$",
"urlParts",
"=",
"parse_url",
"(",
"$",
"companyUrl",
")",
";",
"$",
"scheme",
"=",
"isset",
"(",
"$",
"urlParts",
"[",
"'scheme'",
"]",
")",
"?",
"$",
"urlPart... | Convert companyUrl provided by CustomButton to options array
@param string $companyUrl
@return array Options | [
"Convert",
"companyUrl",
"provided",
"by",
"CustomButton",
"to",
"options",
"array"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L504-L515 |
46,244 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getConnectionOptions | public function getConnectionOptions()
{
$conOpts = ['url' => $this->url];
if (empty($this->authSessionId)) {
$conOpts ['user'] = $this->user;
$conOpts['password'] = $this->password;
} else {
$conOpts['authSessionId'] = $this->authSessionId;
}
$company = $this->getCompany();
if (!empty($company)) {
$conOpts['company'] = $company;
}
if (!is_null($this->timeout)) {
$conOpts['timeout'] = $this->timeout;
}
return $conOpts;
} | php | public function getConnectionOptions()
{
$conOpts = ['url' => $this->url];
if (empty($this->authSessionId)) {
$conOpts ['user'] = $this->user;
$conOpts['password'] = $this->password;
} else {
$conOpts['authSessionId'] = $this->authSessionId;
}
$company = $this->getCompany();
if (!empty($company)) {
$conOpts['company'] = $company;
}
if (!is_null($this->timeout)) {
$conOpts['timeout'] = $this->timeout;
}
return $conOpts;
} | [
"public",
"function",
"getConnectionOptions",
"(",
")",
"{",
"$",
"conOpts",
"=",
"[",
"'url'",
"=>",
"$",
"this",
"->",
"url",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"authSessionId",
")",
")",
"{",
"$",
"conOpts",
"[",
"'user'",
"]",
... | Get Current connection options for use in another object
@return array usable as second constructor parameter | [
"Get",
"Current",
"connection",
"options",
"for",
"use",
"in",
"another",
"object"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L522-L539 |
46,245 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.setDataValue | public function setDataValue($columnName, $value)
{
switch ($columnName) {
case 'kod':
$value = self::uncode($value); //Alwyas uncode "kod" column
break;
default:
if (is_object($value)) {
switch (get_class($value)) {
case 'DateTime':
$columnInfo = $this->getColumnInfo($columnName);
switch ($columnInfo['type']) {
case 'date':
$value = self::dateToFlexiDate($value);
break;
case 'datetime':
$value = self::dateToFlexiDateTime($value);
break;
}
break;
}
}
$result = parent::setDataValue($columnName, $value);
break;
}
return $result;
} | php | public function setDataValue($columnName, $value)
{
switch ($columnName) {
case 'kod':
$value = self::uncode($value); //Alwyas uncode "kod" column
break;
default:
if (is_object($value)) {
switch (get_class($value)) {
case 'DateTime':
$columnInfo = $this->getColumnInfo($columnName);
switch ($columnInfo['type']) {
case 'date':
$value = self::dateToFlexiDate($value);
break;
case 'datetime':
$value = self::dateToFlexiDateTime($value);
break;
}
break;
}
}
$result = parent::setDataValue($columnName, $value);
break;
}
return $result;
} | [
"public",
"function",
"setDataValue",
"(",
"$",
"columnName",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"columnName",
")",
"{",
"case",
"'kod'",
":",
"$",
"value",
"=",
"self",
"::",
"uncode",
"(",
"$",
"value",
")",
";",
"//Alwyas uncode \"kod\" ... | Set Data Field value
@param string $columnName field name
@param mixed $value field data value
@return bool Success | [
"Set",
"Data",
"Field",
"value"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L600-L626 |
46,246 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.setPrefix | public function setPrefix($prefix)
{
switch ($prefix) {
case 'a': //Access
case 'c': //Company
case 'u': //User
case 'g': //License Groups
case 'admin':
case 'status':
case 'login-logout':
$this->prefix = '/'.$prefix.'/';
break;
case null:
case '':
case '/':
$this->prefix = '';
break;
default:
throw new \Exception(sprintf('Unknown prefix %s', $prefix));
}
} | php | public function setPrefix($prefix)
{
switch ($prefix) {
case 'a': //Access
case 'c': //Company
case 'u': //User
case 'g': //License Groups
case 'admin':
case 'status':
case 'login-logout':
$this->prefix = '/'.$prefix.'/';
break;
case null:
case '':
case '/':
$this->prefix = '';
break;
default:
throw new \Exception(sprintf('Unknown prefix %s', $prefix));
}
} | [
"public",
"function",
"setPrefix",
"(",
"$",
"prefix",
")",
"{",
"switch",
"(",
"$",
"prefix",
")",
"{",
"case",
"'a'",
":",
"//Access",
"case",
"'c'",
":",
"//Company",
"case",
"'u'",
":",
"//User",
"case",
"'g'",
":",
"//License Groups",
"case",
"'admi... | Set URL prefix
@param string $prefix | [
"Set",
"URL",
"prefix"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L653-L673 |
46,247 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.setFormat | public function setFormat($format)
{
$result = true;
if (($this->debug === true) && !empty($this->evidence) && isset(Formats::$$this->evidence)) {
if (array_key_exists($format, array_flip(Formats::$$this->evidence))
=== false) {
$result = false;
}
}
if ($result === true) {
$this->format = $format;
$this->updateApiURL();
}
return $result;
} | php | public function setFormat($format)
{
$result = true;
if (($this->debug === true) && !empty($this->evidence) && isset(Formats::$$this->evidence)) {
if (array_key_exists($format, array_flip(Formats::$$this->evidence))
=== false) {
$result = false;
}
}
if ($result === true) {
$this->format = $format;
$this->updateApiURL();
}
return $result;
} | [
"public",
"function",
"setFormat",
"(",
"$",
"format",
")",
"{",
"$",
"result",
"=",
"true",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"debug",
"===",
"true",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"evidence",
")",
"&&",
"isset",
"(",
"Fo... | Set communication format.
One of html|xml|json|csv|dbf|xls|isdoc|isdocx|edi|pdf|pdf|vcf|ical
@param string $format
@return boolean format is availble | [
"Set",
"communication",
"format",
".",
"One",
"of",
"html|xml|json|csv|dbf|xls|isdoc|isdocx|edi|pdf|pdf|vcf|ical"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L683-L697 |
46,248 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getEvidenceURL | public function getEvidenceURL()
{
$evidenceUrl = $this->url.$this->prefix.$this->company;
$evidence = $this->getEvidence();
if (!empty($evidence)) {
$evidenceUrl .= '/'.$evidence;
}
return $evidenceUrl;
} | php | public function getEvidenceURL()
{
$evidenceUrl = $this->url.$this->prefix.$this->company;
$evidence = $this->getEvidence();
if (!empty($evidence)) {
$evidenceUrl .= '/'.$evidence;
}
return $evidenceUrl;
} | [
"public",
"function",
"getEvidenceURL",
"(",
")",
"{",
"$",
"evidenceUrl",
"=",
"$",
"this",
"->",
"url",
".",
"$",
"this",
"->",
"prefix",
".",
"$",
"this",
"->",
"company",
";",
"$",
"evidence",
"=",
"$",
"this",
"->",
"getEvidence",
"(",
")",
";",... | Return basic URL for used Evidence
@link https://www.flexibee.eu/api/dokumentace/ref/urls/ Sestavování URL
@return string Evidence URL | [
"Return",
"basic",
"URL",
"for",
"used",
"Evidence"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L849-L857 |
46,249 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.evidenceUrlWithSuffix | public function evidenceUrlWithSuffix($urlSuffix)
{
$evidenceUrl = $this->getEvidenceUrl();
if (!empty($urlSuffix)) {
if (($urlSuffix[0] != '/') && ($urlSuffix[0] != ';') && ($urlSuffix[0]
!= '?')) {
$evidenceUrl .= '/';
}
$evidenceUrl .= $urlSuffix;
}
return $evidenceUrl;
} | php | public function evidenceUrlWithSuffix($urlSuffix)
{
$evidenceUrl = $this->getEvidenceUrl();
if (!empty($urlSuffix)) {
if (($urlSuffix[0] != '/') && ($urlSuffix[0] != ';') && ($urlSuffix[0]
!= '?')) {
$evidenceUrl .= '/';
}
$evidenceUrl .= $urlSuffix;
}
return $evidenceUrl;
} | [
"public",
"function",
"evidenceUrlWithSuffix",
"(",
"$",
"urlSuffix",
")",
"{",
"$",
"evidenceUrl",
"=",
"$",
"this",
"->",
"getEvidenceUrl",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"urlSuffix",
")",
")",
"{",
"if",
"(",
"(",
"$",
"urlSuffix"... | Add suffix to Evidence URL
@param string $urlSuffix
@return string | [
"Add",
"suffix",
"to",
"Evidence",
"URL"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L866-L877 |
46,250 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.rawJsonToArray | public function rawJsonToArray($rawJson)
{
$responseDecoded = json_decode($rawJson, true, 10);
$decodeError = json_last_error_msg();
if ($decodeError == 'No error') {
if (array_key_exists($this->nameSpace, $responseDecoded)) {
$responseDecoded = $responseDecoded[$this->nameSpace];
}
} else {
$this->addStatusMessage('JSON Decoder: '.$decodeError, 'error');
$this->addStatusMessage($rawJson, 'debug');
}
return $responseDecoded;
} | php | public function rawJsonToArray($rawJson)
{
$responseDecoded = json_decode($rawJson, true, 10);
$decodeError = json_last_error_msg();
if ($decodeError == 'No error') {
if (array_key_exists($this->nameSpace, $responseDecoded)) {
$responseDecoded = $responseDecoded[$this->nameSpace];
}
} else {
$this->addStatusMessage('JSON Decoder: '.$decodeError, 'error');
$this->addStatusMessage($rawJson, 'debug');
}
return $responseDecoded;
} | [
"public",
"function",
"rawJsonToArray",
"(",
"$",
"rawJson",
")",
"{",
"$",
"responseDecoded",
"=",
"json_decode",
"(",
"$",
"rawJson",
",",
"true",
",",
"10",
")",
";",
"$",
"decodeError",
"=",
"json_last_error_msg",
"(",
")",
";",
"if",
"(",
"$",
"deco... | Convert FlexiBee Response JSON to Array
@param string $rawJson
@return array | [
"Convert",
"FlexiBee",
"Response",
"JSON",
"to",
"Array"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L976-L989 |
46,251 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.parseError | public function parseError(array $responseDecoded)
{
if (array_key_exists('results', $responseDecoded)) {
$this->errors = $responseDecoded['results'][0]['errors'];
foreach ($this->errors as $errorInfo) {
$this->addStatusMessage($errorInfo['message'], 'error');
if (array_key_exists('for', $errorInfo)) {
unset($errorInfo['message']);
$this->addStatusMessage(json_encode($errorInfo), 'debug');
}
}
} else {
if (array_key_exists('message', $responseDecoded)) {
$this->errors = [['message' => $responseDecoded['message']]];
}
}
return count($this->errors);
} | php | public function parseError(array $responseDecoded)
{
if (array_key_exists('results', $responseDecoded)) {
$this->errors = $responseDecoded['results'][0]['errors'];
foreach ($this->errors as $errorInfo) {
$this->addStatusMessage($errorInfo['message'], 'error');
if (array_key_exists('for', $errorInfo)) {
unset($errorInfo['message']);
$this->addStatusMessage(json_encode($errorInfo), 'debug');
}
}
} else {
if (array_key_exists('message', $responseDecoded)) {
$this->errors = [['message' => $responseDecoded['message']]];
}
}
return count($this->errors);
} | [
"public",
"function",
"parseError",
"(",
"array",
"$",
"responseDecoded",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'results'",
",",
"$",
"responseDecoded",
")",
")",
"{",
"$",
"this",
"->",
"errors",
"=",
"$",
"responseDecoded",
"[",
"'results'",
"]",
... | Parse error message response
@param array $responseDecoded
@return int number of errors processed | [
"Parse",
"error",
"message",
"response"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1062-L1079 |
46,252 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.xml2array | public static function xml2array($xml)
{
$arr = [];
if (!empty($xml)) {
if (is_string($xml)) {
$xml = simplexml_load_string($xml);
}
foreach ($xml->attributes() as $a) {
$arr['@'.$a->getName()] = strval($a);
}
foreach ($xml->children() as $r) {
if (count($r->children()) == 0) {
$arr[$r->getName()] = strval($r);
} else {
$arr[$r->getName()][] = self::xml2array($r);
}
}
}
return $arr;
} | php | public static function xml2array($xml)
{
$arr = [];
if (!empty($xml)) {
if (is_string($xml)) {
$xml = simplexml_load_string($xml);
}
foreach ($xml->attributes() as $a) {
$arr['@'.$a->getName()] = strval($a);
}
foreach ($xml->children() as $r) {
if (count($r->children()) == 0) {
$arr[$r->getName()] = strval($r);
} else {
$arr[$r->getName()][] = self::xml2array($r);
}
}
}
return $arr;
} | [
"public",
"static",
"function",
"xml2array",
"(",
"$",
"xml",
")",
"{",
"$",
"arr",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"xml",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"xml",
")",
")",
"{",
"$",
"xml",
"=",
"simplex... | Convert XML to array.
@param string $xml
@return array | [
"Convert",
"XML",
"to",
"array",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1207-L1226 |
46,253 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.reload | public function reload()
{
$id = $this->getRecordIdent();
$this->dataReset();
$this->loadFromFlexiBee($id);
return $this->lastResponseCode == 200;
} | php | public function reload()
{
$id = $this->getRecordIdent();
$this->dataReset();
$this->loadFromFlexiBee($id);
return $this->lastResponseCode == 200;
} | [
"public",
"function",
"reload",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getRecordIdent",
"(",
")",
";",
"$",
"this",
"->",
"dataReset",
"(",
")",
";",
"$",
"this",
"->",
"loadFromFlexiBee",
"(",
"$",
"id",
")",
";",
"return",
"$",
"this"... | Reload current record from FlexiBee
@return boolean | [
"Reload",
"current",
"record",
"from",
"FlexiBee"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1400-L1406 |
46,254 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.setFilter | public function setFilter($filter)
{
return $this->filter = is_array($filter) ? self::flexiUrl($filter) : $filter;
} | php | public function setFilter($filter)
{
return $this->filter = is_array($filter) ? self::flexiUrl($filter) : $filter;
} | [
"public",
"function",
"setFilter",
"(",
"$",
"filter",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"=",
"is_array",
"(",
"$",
"filter",
")",
"?",
"self",
"::",
"flexiUrl",
"(",
"$",
"filter",
")",
":",
"$",
"filter",
";",
"}"
] | Set Filter code for requests
@link https://www.flexibee.eu/api/dokumentace/ref/zamykani-odemykani/
@param array|string $filter filter formula or ['key'=>'value']
@return string Filter code | [
"Set",
"Filter",
"code",
"for",
"requests"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1417-L1420 |
46,255 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.join | public function join(&$object)
{
$result = true;
if (method_exists($object, 'getDataForJSON')) {
$this->chained[] = $object;
} else {
throw new \Ease\Exception('$object->getDataForJSON() does not exist');
}
return $result;
} | php | public function join(&$object)
{
$result = true;
if (method_exists($object, 'getDataForJSON')) {
$this->chained[] = $object;
} else {
throw new \Ease\Exception('$object->getDataForJSON() does not exist');
}
return $result;
} | [
"public",
"function",
"join",
"(",
"&",
"$",
"object",
")",
"{",
"$",
"result",
"=",
"true",
";",
"if",
"(",
"method_exists",
"(",
"$",
"object",
",",
"'getDataForJSON'",
")",
")",
"{",
"$",
"this",
"->",
"chained",
"[",
"]",
"=",
"$",
"object",
";... | Join another FlexiPeeHP Object
@param FlexiBeeRO $object
@return boolean adding to stack success | [
"Join",
"another",
"FlexiPeeHP",
"Object"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1506-L1516 |
46,256 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.urlizeId | public static function urlizeId($id)
{
if (is_array($id)) {
$id = rawurlencode('('.self::flexiUrl($id).')');
} else if (preg_match('/^ext:/', $id)) {
$id = self::urlEncode($id);
} else if (preg_match('/^code:/', $id)) {
$id = self::code(self::urlEncode(self::uncode($id)));
}
return $id;
} | php | public static function urlizeId($id)
{
if (is_array($id)) {
$id = rawurlencode('('.self::flexiUrl($id).')');
} else if (preg_match('/^ext:/', $id)) {
$id = self::urlEncode($id);
} else if (preg_match('/^code:/', $id)) {
$id = self::code(self::urlEncode(self::uncode($id)));
}
return $id;
} | [
"public",
"static",
"function",
"urlizeId",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"id",
")",
")",
"{",
"$",
"id",
"=",
"rawurlencode",
"(",
"'('",
".",
"self",
"::",
"flexiUrl",
"(",
"$",
"id",
")",
".",
"')'",
")",
";",
"}... | Prepare record ID to use in URL
@param mixed $id
@return string id ready for use in URL | [
"Prepare",
"record",
"ID",
"to",
"use",
"in",
"URL"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1525-L1535 |
46,257 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.idExists | public function idExists($identifer = null)
{
if (is_null($identifer)) {
$identifer = $this->getMyKey();
}
$ignorestate = $this->ignore404();
$this->ignore404(true);
$cands = $this->getFlexiData(null,
[
'detail' => 'custom:'.$this->getKeyColumn(),
$this->getKeyColumn() => $identifer
]);
$this->ignore404($ignorestate);
return ($this->lastResponseCode == 200) && !empty($cands);
} | php | public function idExists($identifer = null)
{
if (is_null($identifer)) {
$identifer = $this->getMyKey();
}
$ignorestate = $this->ignore404();
$this->ignore404(true);
$cands = $this->getFlexiData(null,
[
'detail' => 'custom:'.$this->getKeyColumn(),
$this->getKeyColumn() => $identifer
]);
$this->ignore404($ignorestate);
return ($this->lastResponseCode == 200) && !empty($cands);
} | [
"public",
"function",
"idExists",
"(",
"$",
"identifer",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"identifer",
")",
")",
"{",
"$",
"identifer",
"=",
"$",
"this",
"->",
"getMyKey",
"(",
")",
";",
"}",
"$",
"ignorestate",
"=",
"$",
"thi... | Test if given record ID exists in FlexiBee.
@param mixed $identifer presence state
@return boolean | [
"Test",
"if",
"given",
"record",
"ID",
"exists",
"in",
"FlexiBee",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1544-L1558 |
46,258 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.recordExists | public function recordExists($data = [])
{
if (empty($data)) {
$data = $this->getData();
}
$ignorestate = $this->ignore404();
$this->ignore404(true);
$keyColumn = $this->getKeyColumn();
$res = $this->getColumnsFromFlexibee([$keyColumn],
is_array($data) ? $data : [$keyColumn => $data]);
if (empty($res) || (isset($res['success']) && ($res['success'] == 'false'))
|| ((isset($res) && is_array($res)) && !isset($res[0]) )) {
$found = false;
} else {
$found = true;
}
$this->ignore404($ignorestate);
return $found;
} | php | public function recordExists($data = [])
{
if (empty($data)) {
$data = $this->getData();
}
$ignorestate = $this->ignore404();
$this->ignore404(true);
$keyColumn = $this->getKeyColumn();
$res = $this->getColumnsFromFlexibee([$keyColumn],
is_array($data) ? $data : [$keyColumn => $data]);
if (empty($res) || (isset($res['success']) && ($res['success'] == 'false'))
|| ((isset($res) && is_array($res)) && !isset($res[0]) )) {
$found = false;
} else {
$found = true;
}
$this->ignore404($ignorestate);
return $found;
} | [
"public",
"function",
"recordExists",
"(",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getData",
"(",
")",
";",
"}",
"$",
"ignorestate",
"=",
"$",
"this",
"->"... | Test if given record exists in FlexiBee.
@param array|string|int $data ext:id:23|code:ITEM|['id'=>23]|23
@return boolean Record presence status | [
"Test",
"if",
"given",
"record",
"exists",
"in",
"FlexiBee",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1567-L1587 |
46,259 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getSubItems | public function getSubItems()
{
return array_key_exists('polozkyFaktury', $this->getData()) ? $this->getDataValue('polozkyFaktury')
: (array_key_exists('polozkyDokladu', $this->getData()) ? $this->getDataValue('polozkyDokladu')
: null);
} | php | public function getSubItems()
{
return array_key_exists('polozkyFaktury', $this->getData()) ? $this->getDataValue('polozkyFaktury')
: (array_key_exists('polozkyDokladu', $this->getData()) ? $this->getDataValue('polozkyDokladu')
: null);
} | [
"public",
"function",
"getSubItems",
"(",
")",
"{",
"return",
"array_key_exists",
"(",
"'polozkyFaktury'",
",",
"$",
"this",
"->",
"getData",
"(",
")",
")",
"?",
"$",
"this",
"->",
"getDataValue",
"(",
"'polozkyFaktury'",
")",
":",
"(",
"array_key_exists",
"... | Subitems - ex. items of invoice
@return array of document items or null | [
"Subitems",
"-",
"ex",
".",
"items",
"of",
"invoice"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1594-L1599 |
46,260 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.logResult | public function logResult($resultData = null, $url = null)
{
$logResult = false;
if (isset($resultData['success']) && ($resultData['success'] == 'false')) {
if (isset($resultData['message'])) {
$this->addStatusMessage($resultData['message'], 'warning');
}
$this->addStatusMessage('Error '.$this->lastResponseCode.': '.urldecode($url),
'warning');
unset($url);
}
if (is_null($resultData)) {
$resultData = $this->lastResult;
}
if (isset($url)) {
$this->logger->addStatusMessage($this->lastResponseCode.':'.urldecode($url));
}
if (isset($resultData['results'])) {
if ($resultData['success'] == 'false') {
$status = 'error';
} else {
$status = 'success';
}
foreach ($resultData['results'] as $result) {
if (isset($result['request-id'])) {
$rid = $result['request-id'];
} else {
$rid = '';
}
if (isset($result['errors'])) {
foreach ($result['errors'] as $error) {
$message = $error['message'];
if (isset($error['for'])) {
$message .= ' for: '.$error['for'];
}
if (isset($error['value'])) {
$message .= ' value:'.$error['value'];
}
if (isset($error['code'])) {
$message .= ' code:'.$error['code'];
}
$this->addStatusMessage($rid.': '.$message, $status);
}
}
}
}
return $logResult;
} | php | public function logResult($resultData = null, $url = null)
{
$logResult = false;
if (isset($resultData['success']) && ($resultData['success'] == 'false')) {
if (isset($resultData['message'])) {
$this->addStatusMessage($resultData['message'], 'warning');
}
$this->addStatusMessage('Error '.$this->lastResponseCode.': '.urldecode($url),
'warning');
unset($url);
}
if (is_null($resultData)) {
$resultData = $this->lastResult;
}
if (isset($url)) {
$this->logger->addStatusMessage($this->lastResponseCode.':'.urldecode($url));
}
if (isset($resultData['results'])) {
if ($resultData['success'] == 'false') {
$status = 'error';
} else {
$status = 'success';
}
foreach ($resultData['results'] as $result) {
if (isset($result['request-id'])) {
$rid = $result['request-id'];
} else {
$rid = '';
}
if (isset($result['errors'])) {
foreach ($result['errors'] as $error) {
$message = $error['message'];
if (isset($error['for'])) {
$message .= ' for: '.$error['for'];
}
if (isset($error['value'])) {
$message .= ' value:'.$error['value'];
}
if (isset($error['code'])) {
$message .= ' code:'.$error['code'];
}
$this->addStatusMessage($rid.': '.$message, $status);
}
}
}
}
return $logResult;
} | [
"public",
"function",
"logResult",
"(",
"$",
"resultData",
"=",
"null",
",",
"$",
"url",
"=",
"null",
")",
"{",
"$",
"logResult",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"resultData",
"[",
"'success'",
"]",
")",
"&&",
"(",
"$",
"resultData",... | Write Operation Result.
@param array $resultData
@param string $url URL
@return boolean Log save success | [
"Write",
"Operation",
"Result",
"."
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1744-L1792 |
46,261 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.saveDebugFiles | public function saveDebugFiles()
{
$tmpdir = sys_get_temp_dir();
$fname = $this->evidence.'-'.$this->curlInfo['when'].'.'.$this->format;
$reqname = $tmpdir.'/request-'.$fname;
$respname = $tmpdir.'/response-'.$fname;
if (file_put_contents($reqname, $this->postFields)) {
$this->addStatusMessage($reqname, 'debug');
}
if (file_put_contents($respname, $this->lastCurlResponse)) {
$this->addStatusMessage($respname, 'debug');
}
} | php | public function saveDebugFiles()
{
$tmpdir = sys_get_temp_dir();
$fname = $this->evidence.'-'.$this->curlInfo['when'].'.'.$this->format;
$reqname = $tmpdir.'/request-'.$fname;
$respname = $tmpdir.'/response-'.$fname;
if (file_put_contents($reqname, $this->postFields)) {
$this->addStatusMessage($reqname, 'debug');
}
if (file_put_contents($respname, $this->lastCurlResponse)) {
$this->addStatusMessage($respname, 'debug');
}
} | [
"public",
"function",
"saveDebugFiles",
"(",
")",
"{",
"$",
"tmpdir",
"=",
"sys_get_temp_dir",
"(",
")",
";",
"$",
"fname",
"=",
"$",
"this",
"->",
"evidence",
".",
"'-'",
".",
"$",
"this",
"->",
"curlInfo",
"[",
"'when'",
"]",
".",
"'.'",
".",
"$",
... | Save RAW Curl Request & Response to files in Temp directory | [
"Save",
"RAW",
"Curl",
"Request",
"&",
"Response",
"to",
"files",
"in",
"Temp",
"directory"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L1797-L1809 |
46,262 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getFirstRecordID | public function getFirstRecordID()
{
$firstID = null;
$keyColumn = $this->getKeyColumn();
$firstIdRaw = $this->getColumnsFromFlexibee([$keyColumn],
['limit' => 1, 'order' => $keyColumn], $keyColumn);
if (!empty($firstIdRaw) && isset(current($firstIdRaw)[$keyColumn])) {
$firstID = current($firstIdRaw)[$keyColumn];
}
return is_numeric($firstID) ? intval($firstID) : $firstID;
} | php | public function getFirstRecordID()
{
$firstID = null;
$keyColumn = $this->getKeyColumn();
$firstIdRaw = $this->getColumnsFromFlexibee([$keyColumn],
['limit' => 1, 'order' => $keyColumn], $keyColumn);
if (!empty($firstIdRaw) && isset(current($firstIdRaw)[$keyColumn])) {
$firstID = current($firstIdRaw)[$keyColumn];
}
return is_numeric($firstID) ? intval($firstID) : $firstID;
} | [
"public",
"function",
"getFirstRecordID",
"(",
")",
"{",
"$",
"firstID",
"=",
"null",
";",
"$",
"keyColumn",
"=",
"$",
"this",
"->",
"getKeyColumn",
"(",
")",
";",
"$",
"firstIdRaw",
"=",
"$",
"this",
"->",
"getColumnsFromFlexibee",
"(",
"[",
"$",
"keyCo... | Obtain ID of first record in evidence
@return string|null id or null if no records | [
"Obtain",
"ID",
"of",
"first",
"record",
"in",
"evidence"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2002-L2012 |
46,263 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getNextRecordID | function getNextRecordID($conditions = [])
{
$conditions['order'] = 'id@D';
$conditions['limit'] = 1;
$conditions[] = 'id gt '.$this->getRecordID();
$next = $this->getColumnsFromFlexibee(['id'], $conditions);
return (is_array($next) && array_key_exists(0, $next) && array_key_exists('id',
$next[0])) ? intval($next[0]['id']) : null;
} | php | function getNextRecordID($conditions = [])
{
$conditions['order'] = 'id@D';
$conditions['limit'] = 1;
$conditions[] = 'id gt '.$this->getRecordID();
$next = $this->getColumnsFromFlexibee(['id'], $conditions);
return (is_array($next) && array_key_exists(0, $next) && array_key_exists('id',
$next[0])) ? intval($next[0]['id']) : null;
} | [
"function",
"getNextRecordID",
"(",
"$",
"conditions",
"=",
"[",
"]",
")",
"{",
"$",
"conditions",
"[",
"'order'",
"]",
"=",
"'id@D'",
";",
"$",
"conditions",
"[",
"'limit'",
"]",
"=",
"1",
";",
"$",
"conditions",
"[",
"]",
"=",
"'id gt '",
".",
"$",... | Get previous record ID
@param array $conditions optional
@return int|null | [
"Get",
"previous",
"record",
"ID"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2021-L2029 |
46,264 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getPrevRecordID | function getPrevRecordID($conditions = [])
{
$conditions['order'] = 'id@A';
$conditions['limit'] = 1;
$conditions[] = 'id lt '.$this->getRecordID();
$prev = $this->getColumnsFromFlexibee(['id'], $conditions);
return (is_array($prev) && array_key_exists(0, $prev) && array_key_exists('id',
$prev[0])) ? intval($prev[0]['id']) : null;
} | php | function getPrevRecordID($conditions = [])
{
$conditions['order'] = 'id@A';
$conditions['limit'] = 1;
$conditions[] = 'id lt '.$this->getRecordID();
$prev = $this->getColumnsFromFlexibee(['id'], $conditions);
return (is_array($prev) && array_key_exists(0, $prev) && array_key_exists('id',
$prev[0])) ? intval($prev[0]['id']) : null;
} | [
"function",
"getPrevRecordID",
"(",
"$",
"conditions",
"=",
"[",
"]",
")",
"{",
"$",
"conditions",
"[",
"'order'",
"]",
"=",
"'id@A'",
";",
"$",
"conditions",
"[",
"'limit'",
"]",
"=",
"1",
";",
"$",
"conditions",
"[",
"]",
"=",
"'id lt '",
".",
"$",... | Get next record ID
@param array $conditions optional
@return int|null | [
"Get",
"next",
"record",
"ID"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2038-L2046 |
46,265 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getApiURL | public function getApiURL($format = null)
{
$apiUrl = str_replace(['.'.$this->format, '?limit=0'], '', $this->apiURL);
return $apiUrl.(empty($format) ? '' : '.'.$format );
} | php | public function getApiURL($format = null)
{
$apiUrl = str_replace(['.'.$this->format, '?limit=0'], '', $this->apiURL);
return $apiUrl.(empty($format) ? '' : '.'.$format );
} | [
"public",
"function",
"getApiURL",
"(",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"apiUrl",
"=",
"str_replace",
"(",
"[",
"'.'",
".",
"$",
"this",
"->",
"format",
",",
"'?limit=0'",
"]",
",",
"''",
",",
"$",
"this",
"->",
"apiURL",
")",
";",
"retu... | Gives you current ApiURL with given format suffix
@param string $format json|html|xml|...
@return string API URL for current record or object/evidence | [
"Gives",
"you",
"current",
"ApiURL",
"with",
"given",
"format",
"suffix"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2116-L2120 |
46,266 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.unifyResponseFormat | public function unifyResponseFormat($responseBody)
{
if (!is_array($responseBody) || array_key_exists('message',
$responseBody)) { //Unifi response format
$response = $responseBody;
} else {
$evidence = $this->getResponseEvidence();
if (array_key_exists($evidence, $responseBody)) {
$response = [];
$evidenceContent = $responseBody[$evidence];
if (array_key_exists(0, $evidenceContent)) {
$response[$evidence] = $evidenceContent; //Multiplete Results
} else {
$response[$evidence][0] = $evidenceContent; //One result
}
} else {
if (isset($responseBody['priloha'])) {
$response = $responseBody['priloha'];
} else {
if (array_key_exists('results', $responseBody)) {
$response = $responseBody['results'];
} else {
$response = $responseBody;
}
}
}
}
return $response;
} | php | public function unifyResponseFormat($responseBody)
{
if (!is_array($responseBody) || array_key_exists('message',
$responseBody)) { //Unifi response format
$response = $responseBody;
} else {
$evidence = $this->getResponseEvidence();
if (array_key_exists($evidence, $responseBody)) {
$response = [];
$evidenceContent = $responseBody[$evidence];
if (array_key_exists(0, $evidenceContent)) {
$response[$evidence] = $evidenceContent; //Multiplete Results
} else {
$response[$evidence][0] = $evidenceContent; //One result
}
} else {
if (isset($responseBody['priloha'])) {
$response = $responseBody['priloha'];
} else {
if (array_key_exists('results', $responseBody)) {
$response = $responseBody['results'];
} else {
$response = $responseBody;
}
}
}
}
return $response;
} | [
"public",
"function",
"unifyResponseFormat",
"(",
"$",
"responseBody",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"responseBody",
")",
"||",
"array_key_exists",
"(",
"'message'",
",",
"$",
"responseBody",
")",
")",
"{",
"//Unifi response format",
"$",
"re... | Return the same response format for one and multiplete results
@param array $responseBody
@return array | [
"Return",
"the",
"same",
"response",
"format",
"for",
"one",
"and",
"multiplete",
"results"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2139-L2167 |
46,267 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getOnlineColumnsInfo | public function getOnlineColumnsInfo($evidence = null)
{
$properties = [];
$evidence = is_null($evidence) ? $this->getEvidence() : $evidence;
$flexinfo = $this->performRequest('/c/'.$this->company.'/'.$evidence.'/properties.json');
if (count($flexinfo) && array_key_exists('properties', $flexinfo)) {
foreach ($flexinfo['properties']['property'] as $evidenceProperty) {
$key = $evidenceProperty['propertyName'];
$properties[$key] = $evidenceProperty;
$properties[$key]['name'] = $evidenceProperty['name'];
$properties[$key]['type'] = $evidenceProperty['type'];
if (array_key_exists('url', $evidenceProperty)) {
$properties[$key]['url'] = str_replace('?limit=0', '',
$evidenceProperty['url']);
}
}
}
return $properties;
} | php | public function getOnlineColumnsInfo($evidence = null)
{
$properties = [];
$evidence = is_null($evidence) ? $this->getEvidence() : $evidence;
$flexinfo = $this->performRequest('/c/'.$this->company.'/'.$evidence.'/properties.json');
if (count($flexinfo) && array_key_exists('properties', $flexinfo)) {
foreach ($flexinfo['properties']['property'] as $evidenceProperty) {
$key = $evidenceProperty['propertyName'];
$properties[$key] = $evidenceProperty;
$properties[$key]['name'] = $evidenceProperty['name'];
$properties[$key]['type'] = $evidenceProperty['type'];
if (array_key_exists('url', $evidenceProperty)) {
$properties[$key]['url'] = str_replace('?limit=0', '',
$evidenceProperty['url']);
}
}
}
return $properties;
} | [
"public",
"function",
"getOnlineColumnsInfo",
"(",
"$",
"evidence",
"=",
"null",
")",
"{",
"$",
"properties",
"=",
"[",
"]",
";",
"$",
"evidence",
"=",
"is_null",
"(",
"$",
"evidence",
")",
"?",
"$",
"this",
"->",
"getEvidence",
"(",
")",
":",
"$",
"... | Obtain Current evidence Live structure
@param string $evidence
@return array structure | [
"Obtain",
"Current",
"evidence",
"Live",
"structure"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2194-L2212 |
46,268 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.updateColumnsInfo | public function updateColumnsInfo($columnsInfo = null, $evidence = null)
{
$evidence = is_null($evidence) ? $this->getEvidence() : $evidence;
if (is_null($columnsInfo)) {
$this->columnsInfo[$evidence] = $this->offline ? $this->getOfflineColumnsInfo($evidence)
: $this->getOnlineColumnsInfo($evidence);
} else {
$this->columnsInfo[$evidence] = $columnsInfo;
}
} | php | public function updateColumnsInfo($columnsInfo = null, $evidence = null)
{
$evidence = is_null($evidence) ? $this->getEvidence() : $evidence;
if (is_null($columnsInfo)) {
$this->columnsInfo[$evidence] = $this->offline ? $this->getOfflineColumnsInfo($evidence)
: $this->getOnlineColumnsInfo($evidence);
} else {
$this->columnsInfo[$evidence] = $columnsInfo;
}
} | [
"public",
"function",
"updateColumnsInfo",
"(",
"$",
"columnsInfo",
"=",
"null",
",",
"$",
"evidence",
"=",
"null",
")",
"{",
"$",
"evidence",
"=",
"is_null",
"(",
"$",
"evidence",
")",
"?",
"$",
"this",
"->",
"getEvidence",
"(",
")",
":",
"$",
"eviden... | Update evidence info from array or online from properties.json or offline
@param array $columnsInfo
@param string $evidence | [
"Update",
"evidence",
"info",
"from",
"array",
"or",
"online",
"from",
"properties",
".",
"json",
"or",
"offline"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2220-L2229 |
46,269 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.saveResponseToFile | public function saveResponseToFile($destfile)
{
if (strlen($this->lastCurlResponse)) {
$this->doCurlRequest($this->apiURL, 'GET', $this->format);
}
file_put_contents($destfile, $this->lastCurlResponse);
} | php | public function saveResponseToFile($destfile)
{
if (strlen($this->lastCurlResponse)) {
$this->doCurlRequest($this->apiURL, 'GET', $this->format);
}
file_put_contents($destfile, $this->lastCurlResponse);
} | [
"public",
"function",
"saveResponseToFile",
"(",
"$",
"destfile",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"this",
"->",
"lastCurlResponse",
")",
")",
"{",
"$",
"this",
"->",
"doCurlRequest",
"(",
"$",
"this",
"->",
"apiURL",
",",
"'GET'",
",",
"$",
"t... | Save current object to file
@param string $destfile path to file | [
"Save",
"current",
"object",
"to",
"file"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2353-L2359 |
46,270 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getVazby | public function getVazby($id = null)
{
if (is_null($id)) {
$id = $this->getRecordID();
}
if (!empty($id)) {
$vazbyRaw = $this->getColumnsFromFlexibee(['vazby'],
['relations' => 'vazby', 'id' => $id]);
$vazby = array_key_exists('vazby', $vazbyRaw[0]) ? $vazbyRaw[0]['vazby']
: null;
} else {
throw new \Exception(_('ID requied to get record relations '));
}
return $vazby;
} | php | public function getVazby($id = null)
{
if (is_null($id)) {
$id = $this->getRecordID();
}
if (!empty($id)) {
$vazbyRaw = $this->getColumnsFromFlexibee(['vazby'],
['relations' => 'vazby', 'id' => $id]);
$vazby = array_key_exists('vazby', $vazbyRaw[0]) ? $vazbyRaw[0]['vazby']
: null;
} else {
throw new \Exception(_('ID requied to get record relations '));
}
return $vazby;
} | [
"public",
"function",
"getVazby",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"id",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getRecordID",
"(",
")",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"id",
")",
... | Obtain established relations listing
@return array Null or Relations | [
"Obtain",
"established",
"relations",
"listing"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2366-L2380 |
46,271 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getFlexiBeeURL | public function getFlexiBeeURL()
{
$parsed_url = parse_url(str_replace('.'.$this->format, '', $this->apiURL));
$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'].'://'
: '';
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
$port = isset($parsed_url['port']) ? ':'.$parsed_url['port'] : '';
$user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
$pass = isset($parsed_url['pass']) ? ':'.$parsed_url['pass'] : '';
$pass = ($user || $pass) ? "$pass@" : '';
$path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
return $scheme.$user.$pass.$host.$port.$path;
} | php | public function getFlexiBeeURL()
{
$parsed_url = parse_url(str_replace('.'.$this->format, '', $this->apiURL));
$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'].'://'
: '';
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
$port = isset($parsed_url['port']) ? ':'.$parsed_url['port'] : '';
$user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
$pass = isset($parsed_url['pass']) ? ':'.$parsed_url['pass'] : '';
$pass = ($user || $pass) ? "$pass@" : '';
$path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
return $scheme.$user.$pass.$host.$port.$path;
} | [
"public",
"function",
"getFlexiBeeURL",
"(",
")",
"{",
"$",
"parsed_url",
"=",
"parse_url",
"(",
"str_replace",
"(",
"'.'",
".",
"$",
"this",
"->",
"format",
",",
"''",
",",
"$",
"this",
"->",
"apiURL",
")",
")",
";",
"$",
"scheme",
"=",
"isset",
"("... | Gives You URL for Current Record in FlexiBee web interface
@return string url | [
"Gives",
"You",
"URL",
"for",
"Current",
"Record",
"in",
"FlexiBee",
"web",
"interface"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2387-L2399 |
46,272 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.setMyKey | public function setMyKey($myKeyValue)
{
if (substr($myKeyValue, 0, 4) == 'ext:') {
if ($this->evidenceInfo['extIdSupported'] == 'false') {
$this->addStatusMessage(sprintf(_('Evidence %s does not support extIDs'),
$this->getEvidence()), 'warning');
$res = false;
} else {
$extIds = $this->getDataValue('external-ids');
if (!empty($extIds) && count($extIds)) {
$extIds = array_combine($extIds, $extIds);
}
$extIds[$myKeyValue] = $myKeyValue;
$res = $this->setDataValue('external-ids',
$extIds);
}
} else {
$res = parent::setMyKey($myKeyValue);
}
$this->updateApiURL();
return $res;
} | php | public function setMyKey($myKeyValue)
{
if (substr($myKeyValue, 0, 4) == 'ext:') {
if ($this->evidenceInfo['extIdSupported'] == 'false') {
$this->addStatusMessage(sprintf(_('Evidence %s does not support extIDs'),
$this->getEvidence()), 'warning');
$res = false;
} else {
$extIds = $this->getDataValue('external-ids');
if (!empty($extIds) && count($extIds)) {
$extIds = array_combine($extIds, $extIds);
}
$extIds[$myKeyValue] = $myKeyValue;
$res = $this->setDataValue('external-ids',
$extIds);
}
} else {
$res = parent::setMyKey($myKeyValue);
}
$this->updateApiURL();
return $res;
} | [
"public",
"function",
"setMyKey",
"(",
"$",
"myKeyValue",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"myKeyValue",
",",
"0",
",",
"4",
")",
"==",
"'ext:'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"evidenceInfo",
"[",
"'extIdSupported'",
"]",
"==",
"'fa... | Set Record Key
@param int|string $myKeyValue
@return boolean | [
"Set",
"Record",
"Key"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2408-L2430 |
46,273 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.ignore404 | public function ignore404($ignore = null)
{
if (!is_null($ignore)) {
$this->ignoreNotFound = $ignore;
}
return $this->ignoreNotFound;
} | php | public function ignore404($ignore = null)
{
if (!is_null($ignore)) {
$this->ignoreNotFound = $ignore;
}
return $this->ignoreNotFound;
} | [
"public",
"function",
"ignore404",
"(",
"$",
"ignore",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"ignore",
")",
")",
"{",
"$",
"this",
"->",
"ignoreNotFound",
"=",
"$",
"ignore",
";",
"}",
"return",
"$",
"this",
"->",
"ignoreNotFoun... | Set or get ignore not found pages flag
@param boolean $ignore set flag to
@return boolean get flag state | [
"Set",
"or",
"get",
"ignore",
"not",
"found",
"pages",
"flag"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2439-L2445 |
46,274 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.sendByMail | public function sendByMail($to, $subject, $body, $cc = null)
{
$this->setPostFields($body);
$this->performRequest(rawurlencode($this->getRecordID()).'/odeslani-dokladu?to='.$to.'&subject='.urlencode($subject).'&cc='.$cc
, 'PUT', 'xml');
return $this->lastResponseCode == 200;
} | php | public function sendByMail($to, $subject, $body, $cc = null)
{
$this->setPostFields($body);
$this->performRequest(rawurlencode($this->getRecordID()).'/odeslani-dokladu?to='.$to.'&subject='.urlencode($subject).'&cc='.$cc
, 'PUT', 'xml');
return $this->lastResponseCode == 200;
} | [
"public",
"function",
"sendByMail",
"(",
"$",
"to",
",",
"$",
"subject",
",",
"$",
"body",
",",
"$",
"cc",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setPostFields",
"(",
"$",
"body",
")",
";",
"$",
"this",
"->",
"performRequest",
"(",
"rawurlencode"... | Send Document by mail
@url https://www.flexibee.eu/api/dokumentace/ref/odesilani-mailem/
@param string $to Email ecipient
@param string $subject Email Subject
@param string $body Email Text
@return boolean mail sent status | [
"Send",
"Document",
"by",
"mail"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2458-L2466 |
46,275 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.flexiDateToDateTime | public static function flexiDateToDateTime($flexidate)
{
return \DateTime::createFromFormat(strstr($flexidate, '+') ? self::$DateFormat.'O'
: self::$DateFormat, $flexidate)->setTime(0, 0);
} | php | public static function flexiDateToDateTime($flexidate)
{
return \DateTime::createFromFormat(strstr($flexidate, '+') ? self::$DateFormat.'O'
: self::$DateFormat, $flexidate)->setTime(0, 0);
} | [
"public",
"static",
"function",
"flexiDateToDateTime",
"(",
"$",
"flexidate",
")",
"{",
"return",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"strstr",
"(",
"$",
"flexidate",
",",
"'+'",
")",
"?",
"self",
"::",
"$",
"DateFormat",
".",
"'O'",
":",
"sel... | FlexiBee date to PHP DateTime conversion
@param string $flexidate 2017-05-26 or 2017-05-26+02:00
@return \DateTime | false | [
"FlexiBee",
"date",
"to",
"PHP",
"DateTime",
"conversion"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2488-L2492 |
46,276 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.flexiDateTimeToDateTime | public static function flexiDateTimeToDateTime($flexidatetime)
{
if (strchr($flexidatetime, '.')) { //NewFormat
$format = self::$DateTimeFormat;
} else { // Old format
$format = 'Y-m-d\TH:i:s+P';
}
return \DateTime::createFromFormat($format, $flexidatetime);
} | php | public static function flexiDateTimeToDateTime($flexidatetime)
{
if (strchr($flexidatetime, '.')) { //NewFormat
$format = self::$DateTimeFormat;
} else { // Old format
$format = 'Y-m-d\TH:i:s+P';
}
return \DateTime::createFromFormat($format, $flexidatetime);
} | [
"public",
"static",
"function",
"flexiDateTimeToDateTime",
"(",
"$",
"flexidatetime",
")",
"{",
"if",
"(",
"strchr",
"(",
"$",
"flexidatetime",
",",
"'.'",
")",
")",
"{",
"//NewFormat",
"$",
"format",
"=",
"self",
"::",
"$",
"DateTimeFormat",
";",
"}",
"el... | FlexiBee dateTime to PHP DateTime conversion
@param string $flexidatetime 2017-09-26T10:00:53.755+02:00 or older 2017-05-19T00:00:00+02:00
@return \DateTime | false | [
"FlexiBee",
"dateTime",
"to",
"PHP",
"DateTime",
"conversion"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2501-L2509 |
46,277 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.takeData | public function takeData($data)
{
$keyColumn = $this->getKeyColumn();
if (array_key_exists($keyColumn, $data) && is_array($data[$keyColumn])) {
foreach ($data[$keyColumn] as $recPos => $recordKey) {
if (substr($recordKey, 0, 4) == 'ext:') {
$data['external-ids'][] = $recordKey;
unset($data[$keyColumn][$recPos]);
}
}
if (count($data[$keyColumn]) == 1) {
$data[$keyColumn] = current($data[$keyColumn]);
}
}
$result = parent::takeData($data);
if (array_key_exists($keyColumn, $data) || array_key_exists('kod', $data)) {
$this->updateApiURL();
}
return $result;
} | php | public function takeData($data)
{
$keyColumn = $this->getKeyColumn();
if (array_key_exists($keyColumn, $data) && is_array($data[$keyColumn])) {
foreach ($data[$keyColumn] as $recPos => $recordKey) {
if (substr($recordKey, 0, 4) == 'ext:') {
$data['external-ids'][] = $recordKey;
unset($data[$keyColumn][$recPos]);
}
}
if (count($data[$keyColumn]) == 1) {
$data[$keyColumn] = current($data[$keyColumn]);
}
}
$result = parent::takeData($data);
if (array_key_exists($keyColumn, $data) || array_key_exists('kod', $data)) {
$this->updateApiURL();
}
return $result;
} | [
"public",
"function",
"takeData",
"(",
"$",
"data",
")",
"{",
"$",
"keyColumn",
"=",
"$",
"this",
"->",
"getKeyColumn",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"keyColumn",
",",
"$",
"data",
")",
"&&",
"is_array",
"(",
"$",
"data",
"[... | Take data for object. separate external IDs
@param array $data Data to keep
@return int number of records taken | [
"Take",
"data",
"for",
"object",
".",
"separate",
"external",
"IDs"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2599-L2620 |
46,278 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.getReportsInfo | public function getReportsInfo()
{
$reports = [];
$reportsRaw = $this->getFlexiData($this->getEvidenceURL().'/reports');
if (!empty($reportsRaw) && array_key_exists('reports', $reportsRaw) && !empty($reportsRaw['reports'])
&& array_key_exists('report', $reportsRaw['reports']) &&
!empty($reportsRaw['reports']['report'])) {
if (\Ease\jQuery\Part::isAssoc($reportsRaw['reports']['report'])) {
$reports = [$reportsRaw['reports']['report']['reportId'] => $reportsRaw['reports']['report']];
} else {
$reports = self::reindexArrayBy($reportsRaw['reports']['report'],
'reportId');
}
}
return $reports;
} | php | public function getReportsInfo()
{
$reports = [];
$reportsRaw = $this->getFlexiData($this->getEvidenceURL().'/reports');
if (!empty($reportsRaw) && array_key_exists('reports', $reportsRaw) && !empty($reportsRaw['reports'])
&& array_key_exists('report', $reportsRaw['reports']) &&
!empty($reportsRaw['reports']['report'])) {
if (\Ease\jQuery\Part::isAssoc($reportsRaw['reports']['report'])) {
$reports = [$reportsRaw['reports']['report']['reportId'] => $reportsRaw['reports']['report']];
} else {
$reports = self::reindexArrayBy($reportsRaw['reports']['report'],
'reportId');
}
}
return $reports;
} | [
"public",
"function",
"getReportsInfo",
"(",
")",
"{",
"$",
"reports",
"=",
"[",
"]",
";",
"$",
"reportsRaw",
"=",
"$",
"this",
"->",
"getFlexiData",
"(",
"$",
"this",
"->",
"getEvidenceURL",
"(",
")",
".",
"'/reports'",
")",
";",
"if",
"(",
"!",
"em... | Get Current Evidence reports listing
@link https://www.flexibee.eu/api/dokumentace/casto-kladene-dotazy-pro-api/vyber-reportu-do-pdf/ Výběr reportu do PDF
@return array | [
"Get",
"Current",
"Evidence",
"reports",
"listing"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2629-L2644 |
46,279 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.requestAuthSessionID | public function requestAuthSessionID($username, $password, $otp = null)
{
$this->postFields = http_build_query(is_null($otp) ? ['username' => $username,
'password' => $password] : ['username' => $username, 'password' => $password,
'otp' => $otp]);
$response = $this->performRequest('/login-logout/login', 'POST',
'json');
if (array_key_exists('refreshToken', $response)) {
$this->refreshToken = $response['refreshToken'];
} else {
$this->refreshToken = null;
}
return array_key_exists('authSessionId', $response) ? $response['authSessionId']
: null;
} | php | public function requestAuthSessionID($username, $password, $otp = null)
{
$this->postFields = http_build_query(is_null($otp) ? ['username' => $username,
'password' => $password] : ['username' => $username, 'password' => $password,
'otp' => $otp]);
$response = $this->performRequest('/login-logout/login', 'POST',
'json');
if (array_key_exists('refreshToken', $response)) {
$this->refreshToken = $response['refreshToken'];
} else {
$this->refreshToken = null;
}
return array_key_exists('authSessionId', $response) ? $response['authSessionId']
: null;
} | [
"public",
"function",
"requestAuthSessionID",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"otp",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"postFields",
"=",
"http_build_query",
"(",
"is_null",
"(",
"$",
"otp",
")",
"?",
"[",
"'username'",
"=>"... | Request authSessionId from current server
@link https://www.flexibee.eu/api/dokumentace/ref/login/ description
@param string $username
@param string $password
@param string $otp optional onetime password
@return string authUserId or null in case of problems | [
"Request",
"authSessionId",
"from",
"current",
"server"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2657-L2671 |
46,280 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.login | public function login()
{
$this->authSessionId = $this->requestAuthSessionID($this->user,
$this->password);
return $this->lastResponseCode == 200;
} | php | public function login()
{
$this->authSessionId = $this->requestAuthSessionID($this->user,
$this->password);
return $this->lastResponseCode == 200;
} | [
"public",
"function",
"login",
"(",
")",
"{",
"$",
"this",
"->",
"authSessionId",
"=",
"$",
"this",
"->",
"requestAuthSessionID",
"(",
"$",
"this",
"->",
"user",
",",
"$",
"this",
"->",
"password",
")",
";",
"return",
"$",
"this",
"->",
"lastResponseCode... | Try to Sign in current user to FlexiBee and keep authSessionId
@return boolean sign in success | [
"Try",
"to",
"Sign",
"in",
"current",
"user",
"to",
"FlexiBee",
"and",
"keep",
"authSessionId"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2678-L2683 |
46,281 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/FlexiBeeRO.php | FlexiBeeRO.logBanner | public function logBanner($additions = null)
{
$this->addStatusMessage('FlexiBee '.str_replace('://',
'://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\Ease\Atom::$frameworkVersion.' '.$additions,
'debug');
} | php | public function logBanner($additions = null)
{
$this->addStatusMessage('FlexiBee '.str_replace('://',
'://'.$this->user.'@', $this->getApiUrl()).' FlexiPeeHP v'.self::$libVersion.' (FlexiBee '.EvidenceList::$version.') EasePHP Framework v'.\Ease\Atom::$frameworkVersion.' '.$additions,
'debug');
} | [
"public",
"function",
"logBanner",
"(",
"$",
"additions",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addStatusMessage",
"(",
"'FlexiBee '",
".",
"str_replace",
"(",
"'://'",
",",
"'://'",
".",
"$",
"this",
"->",
"user",
".",
"'@'",
",",
"$",
"this",
"-... | Add Info about used user, server and libraries
@param string $additions Additional note text | [
"Add",
"Info",
"about",
"used",
"user",
"server",
"and",
"libraries"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/FlexiBeeRO.php#L2819-L2824 |
46,282 | hiqdev/hipanel-core | src/base/Model.php | Model.defaultAttributeLabels | public function defaultAttributeLabels()
{
return [
'id' => Yii::t('hipanel', 'ID'),
'remoteid' => Yii::t('hipanel', 'Remote ID'),
'client' => Yii::t('hipanel', 'Client'),
'client_id' => Yii::t('hipanel', 'Client'),
'seller' => Yii::t('hipanel', 'Reseller'),
'seller_id' => Yii::t('hipanel', 'Reseller'),
'domain' => Yii::t('hipanel', 'Domain name'),
'hdomain' => Yii::t('hipanel', 'Domain name'),
'ns' => Yii::t('hipanel', 'Name Server'),
'nss' => Yii::t('hipanel', 'Name Servers'),
'server' => Yii::t('hipanel', 'Server'),
'account' => Yii::t('hipanel', 'Account'),
'service' => Yii::t('hipanel', 'Service'),
'tariff' => Yii::t('hipanel', 'Tariff'),
'contact' => Yii::t('hipanel', 'Contact'),
'article' => Yii::t('hipanel', 'Article'),
'host' => Yii::t('hipanel', 'Host'),
'bill' => Yii::t('hipanel', 'Bill'),
'backup' => Yii::t('hipanel', 'Backup'),
'backuping' => Yii::t('hipanel', 'Backuping'),
'crontab' => Yii::t('hipanel', 'Crontab'),
'ip' => Yii::t('hipanel', 'IP'),
'ips' => Yii::t('hipanel', 'IPs'),
'mail' => Yii::t('hipanel', 'Mail'),
'request' => Yii::t('hipanel', 'Request'),
'db' => Yii::t('hipanel', 'Database'),
'state' => Yii::t('hipanel', 'Status'),
'status' => Yii::t('hipanel', 'Status'),
'states' => Yii::t('hipanel', 'Statuses'),
'type' => Yii::t('hipanel', 'Type'),
'types' => Yii::t('hipanel', 'Types'),
'note' => Yii::t('hipanel', 'Note'),
'descr' => Yii::t('hipanel', 'Description'),
'comment' => Yii::t('hipanel', 'Comment'),
'created_date' => Yii::t('hipanel', 'Registered'),
'updated_date' => Yii::t('hipanel', 'Last update'),
];
} | php | public function defaultAttributeLabels()
{
return [
'id' => Yii::t('hipanel', 'ID'),
'remoteid' => Yii::t('hipanel', 'Remote ID'),
'client' => Yii::t('hipanel', 'Client'),
'client_id' => Yii::t('hipanel', 'Client'),
'seller' => Yii::t('hipanel', 'Reseller'),
'seller_id' => Yii::t('hipanel', 'Reseller'),
'domain' => Yii::t('hipanel', 'Domain name'),
'hdomain' => Yii::t('hipanel', 'Domain name'),
'ns' => Yii::t('hipanel', 'Name Server'),
'nss' => Yii::t('hipanel', 'Name Servers'),
'server' => Yii::t('hipanel', 'Server'),
'account' => Yii::t('hipanel', 'Account'),
'service' => Yii::t('hipanel', 'Service'),
'tariff' => Yii::t('hipanel', 'Tariff'),
'contact' => Yii::t('hipanel', 'Contact'),
'article' => Yii::t('hipanel', 'Article'),
'host' => Yii::t('hipanel', 'Host'),
'bill' => Yii::t('hipanel', 'Bill'),
'backup' => Yii::t('hipanel', 'Backup'),
'backuping' => Yii::t('hipanel', 'Backuping'),
'crontab' => Yii::t('hipanel', 'Crontab'),
'ip' => Yii::t('hipanel', 'IP'),
'ips' => Yii::t('hipanel', 'IPs'),
'mail' => Yii::t('hipanel', 'Mail'),
'request' => Yii::t('hipanel', 'Request'),
'db' => Yii::t('hipanel', 'Database'),
'state' => Yii::t('hipanel', 'Status'),
'status' => Yii::t('hipanel', 'Status'),
'states' => Yii::t('hipanel', 'Statuses'),
'type' => Yii::t('hipanel', 'Type'),
'types' => Yii::t('hipanel', 'Types'),
'note' => Yii::t('hipanel', 'Note'),
'descr' => Yii::t('hipanel', 'Description'),
'comment' => Yii::t('hipanel', 'Comment'),
'created_date' => Yii::t('hipanel', 'Registered'),
'updated_date' => Yii::t('hipanel', 'Last update'),
];
} | [
"public",
"function",
"defaultAttributeLabels",
"(",
")",
"{",
"return",
"[",
"'id'",
"=>",
"Yii",
"::",
"t",
"(",
"'hipanel'",
",",
"'ID'",
")",
",",
"'remoteid'",
"=>",
"Yii",
"::",
"t",
"(",
"'hipanel'",
",",
"'Remote ID'",
")",
",",
"'client'",
"=>",... | return default labels for attribute. | [
"return",
"default",
"labels",
"for",
"attribute",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/base/Model.php#L34-L74 |
46,283 | hiqdev/hipanel-core | src/base/Model.php | Model.mergeAttributeLabels | public function mergeAttributeLabels($labels)
{
if (!isset(static::$mergedLabels[static::class])) {
$default = $this->defaultAttributeLabels();
foreach ($this->attributes() as $k) {
$label = $labels[$k] ?: $default[$k];
if (!$label) {
if (preg_match('/(.+)_[a-z]+$/', $k, $m)) {
if (isset($labels[$m[1]])) {
$label = $labels[$m[1]];
}
}
}
if (!$label) {
$toTranslate = preg_replace(['/_id$/', '/_label$/', '/_ids$/', '/_like$/'], [' ID', '', ' IDs', ''], $k);
$toTranslate = preg_replace('/_/', ' ', $toTranslate);
$label = Yii::t(static::$i18nDictionary, ucfirst($toTranslate));
}
$labels[$k] = $label;
}
static::$mergedLabels[static::class] = $labels;
}
return static::$mergedLabels[static::class];
} | php | public function mergeAttributeLabels($labels)
{
if (!isset(static::$mergedLabels[static::class])) {
$default = $this->defaultAttributeLabels();
foreach ($this->attributes() as $k) {
$label = $labels[$k] ?: $default[$k];
if (!$label) {
if (preg_match('/(.+)_[a-z]+$/', $k, $m)) {
if (isset($labels[$m[1]])) {
$label = $labels[$m[1]];
}
}
}
if (!$label) {
$toTranslate = preg_replace(['/_id$/', '/_label$/', '/_ids$/', '/_like$/'], [' ID', '', ' IDs', ''], $k);
$toTranslate = preg_replace('/_/', ' ', $toTranslate);
$label = Yii::t(static::$i18nDictionary, ucfirst($toTranslate));
}
$labels[$k] = $label;
}
static::$mergedLabels[static::class] = $labels;
}
return static::$mergedLabels[static::class];
} | [
"public",
"function",
"mergeAttributeLabels",
"(",
"$",
"labels",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"mergedLabels",
"[",
"static",
"::",
"class",
"]",
")",
")",
"{",
"$",
"default",
"=",
"$",
"this",
"->",
"defaultAttributeLabe... | Merge Attribute labels for Model. | [
"Merge",
"Attribute",
"labels",
"for",
"Model",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/base/Model.php#L86-L110 |
46,284 | hiqdev/hipanel-core | src/widgets/LinkSorter.php | LinkSorter.renderSortLinks | protected function renderSortLinks()
{
$attributes = empty($this->attributes) ? array_keys($this->sort->attributes) : $this->attributes;
$links = [];
foreach ($attributes as $name) {
$links[] = $this->sort->link($name);
}
return $this->render('LinkSorterView', [
'id' => $this->id,
'links' => $links,
'attributes' => $this->sort->attributes,
'options' => array_merge($this->options, ['encode' => false]),
'containerClass' => $this->containerClass,
'buttonClass' => $this->buttonClass,
'uiModel' => $this->uiModel,
]);
} | php | protected function renderSortLinks()
{
$attributes = empty($this->attributes) ? array_keys($this->sort->attributes) : $this->attributes;
$links = [];
foreach ($attributes as $name) {
$links[] = $this->sort->link($name);
}
return $this->render('LinkSorterView', [
'id' => $this->id,
'links' => $links,
'attributes' => $this->sort->attributes,
'options' => array_merge($this->options, ['encode' => false]),
'containerClass' => $this->containerClass,
'buttonClass' => $this->buttonClass,
'uiModel' => $this->uiModel,
]);
} | [
"protected",
"function",
"renderSortLinks",
"(",
")",
"{",
"$",
"attributes",
"=",
"empty",
"(",
"$",
"this",
"->",
"attributes",
")",
"?",
"array_keys",
"(",
"$",
"this",
"->",
"sort",
"->",
"attributes",
")",
":",
"$",
"this",
"->",
"attributes",
";",
... | Renders the sort links.
@return string the rendering result | [
"Renders",
"the",
"sort",
"links",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/LinkSorter.php#L48-L65 |
46,285 | hiqdev/hipanel-core | src/widgets/ChartOptions.php | ChartOptions.initDefaults | protected function initDefaults()
{
$id = $this->getId();
$this->hiddenInputs = ArrayHelper::merge([
'id' => ['value' => null, 'options' => []],
'from' => ['value' => null, 'options' => []],
'till' => ['value' => null, 'options' => []],
], $this->hiddenInputs);
$this->form = ArrayHelper::merge([
'action' => '#',
'method' => 'post',
'options' => [
'class' => ['form-inline', $this->getId()],
],
], $this->form);
$this->pickerOptions = ArrayHelper::merge([
'class' => DateRangePicker::class,
'name' => '',
'options' => [
'tag' => false,
'id' => "{$id}-period-btn",
],
'clientEvents' => [
'apply.daterangepicker' => new JsExpression(/** @lang JavaScript */"
function (event, picker) {
var form = $(picker.element[0]).closest('form');
var span = form.find('#{$id}-period-btn span');
span.text(picker.startDate.format('ll') + ' - ' + picker.endDate.format('ll'));
form.find('input[name=from]').val(picker.startDate.format());
form.find('input[name=till]').val(picker.endDate.format());
form.trigger('change.updateChart');
}
"),
'cancel.daterangepicker' => new JsExpression(/** @lang JavaScript */"
function (event, picker) {
var form = $(event.element[0]).closest('form');
var span = form.find('#{$id}-period-btn span');
span.text(span.data('prompt'));
form.find('input[name=from]').val('');
form.find('input[name=till]').val('');
form.trigger('change.updateChart');
}
"),
],
'clientOptions' => [
'ranges' => [
Yii::t('hipanel', 'Current Month') => new JsExpression('[moment().startOf("month"), new Date()]'),
Yii::t('hipanel', 'Previous Month') => new JsExpression('[moment().subtract(1, "month").startOf("month"), moment().subtract(1, "month").endOf("month")]'),
Yii::t('hipanel', 'Last 3 months') => new JsExpression('[moment().subtract(3, "month").startOf("month"), new Date()]'),
Yii::t('hipanel', 'Last year') => new JsExpression('[moment().subtract(1, "year").startOf("year"), new Date()]'),
],
],
], $this->pickerOptions);
} | php | protected function initDefaults()
{
$id = $this->getId();
$this->hiddenInputs = ArrayHelper::merge([
'id' => ['value' => null, 'options' => []],
'from' => ['value' => null, 'options' => []],
'till' => ['value' => null, 'options' => []],
], $this->hiddenInputs);
$this->form = ArrayHelper::merge([
'action' => '#',
'method' => 'post',
'options' => [
'class' => ['form-inline', $this->getId()],
],
], $this->form);
$this->pickerOptions = ArrayHelper::merge([
'class' => DateRangePicker::class,
'name' => '',
'options' => [
'tag' => false,
'id' => "{$id}-period-btn",
],
'clientEvents' => [
'apply.daterangepicker' => new JsExpression(/** @lang JavaScript */"
function (event, picker) {
var form = $(picker.element[0]).closest('form');
var span = form.find('#{$id}-period-btn span');
span.text(picker.startDate.format('ll') + ' - ' + picker.endDate.format('ll'));
form.find('input[name=from]').val(picker.startDate.format());
form.find('input[name=till]').val(picker.endDate.format());
form.trigger('change.updateChart');
}
"),
'cancel.daterangepicker' => new JsExpression(/** @lang JavaScript */"
function (event, picker) {
var form = $(event.element[0]).closest('form');
var span = form.find('#{$id}-period-btn span');
span.text(span.data('prompt'));
form.find('input[name=from]').val('');
form.find('input[name=till]').val('');
form.trigger('change.updateChart');
}
"),
],
'clientOptions' => [
'ranges' => [
Yii::t('hipanel', 'Current Month') => new JsExpression('[moment().startOf("month"), new Date()]'),
Yii::t('hipanel', 'Previous Month') => new JsExpression('[moment().subtract(1, "month").startOf("month"), moment().subtract(1, "month").endOf("month")]'),
Yii::t('hipanel', 'Last 3 months') => new JsExpression('[moment().subtract(3, "month").startOf("month"), new Date()]'),
Yii::t('hipanel', 'Last year') => new JsExpression('[moment().subtract(1, "year").startOf("year"), new Date()]'),
],
],
], $this->pickerOptions);
} | [
"protected",
"function",
"initDefaults",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"$",
"this",
"->",
"hiddenInputs",
"=",
"ArrayHelper",
"::",
"merge",
"(",
"[",
"'id'",
"=>",
"[",
"'value'",
"=>",
"null",
",",
"'opti... | Initializes default values for the widget properties.
@void | [
"Initializes",
"default",
"values",
"for",
"the",
"widget",
"properties",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/ChartOptions.php#L105-L165 |
46,286 | hiqdev/hipanel-core | src/widgets/ChartOptions.php | ChartOptions.registerClientScript | protected function registerClientScript()
{
$id = $this->getId();
$options = Json::encode($this->ajaxOptions);
$this->getView()->registerJs(/** @lang JavaScript */"
$('.{$id}').on('change.updateChart', function (event) {
var defaultOptions = {
url: $(this).attr('action'),
data: $(this).serializeArray(),
type: 'post',
success: function (html) {
$('.{$id}-chart-wrapper').closest('.box').find('.box-body').html(html);
}
};
event.preventDefault();
var options = $.extend(defaultOptions, $options, true)
$.ajax(options);
});
");
} | php | protected function registerClientScript()
{
$id = $this->getId();
$options = Json::encode($this->ajaxOptions);
$this->getView()->registerJs(/** @lang JavaScript */"
$('.{$id}').on('change.updateChart', function (event) {
var defaultOptions = {
url: $(this).attr('action'),
data: $(this).serializeArray(),
type: 'post',
success: function (html) {
$('.{$id}-chart-wrapper').closest('.box').find('.box-body').html(html);
}
};
event.preventDefault();
var options = $.extend(defaultOptions, $options, true)
$.ajax(options);
});
");
} | [
"protected",
"function",
"registerClientScript",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"$",
"options",
"=",
"Json",
"::",
"encode",
"(",
"$",
"this",
"->",
"ajaxOptions",
")",
";",
"$",
"this",
"->",
"getView",
"("... | Registers JS event listener to re-draw the chart upon demand.
@void
@see ajaxOptions | [
"Registers",
"JS",
"event",
"listener",
"to",
"re",
"-",
"draw",
"the",
"chart",
"upon",
"demand",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/widgets/ChartOptions.php#L279-L298 |
46,287 | hiqdev/hipanel-core | src/actions/RedirectAction.php | RedirectAction.getUrl | public function getUrl()
{
if ($this->_url instanceof Closure) {
return call_user_func($this->_url, $this);
}
return $this->_url ?: Yii::$app->request->referrer;
} | php | public function getUrl()
{
if ($this->_url instanceof Closure) {
return call_user_func($this->_url, $this);
}
return $this->_url ?: Yii::$app->request->referrer;
} | [
"public",
"function",
"getUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_url",
"instanceof",
"Closure",
")",
"{",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"_url",
",",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
"_url",
... | Collects the URL array, executing callable functions.
@return string|array default return to previous page (referer) | [
"Collects",
"the",
"URL",
"array",
"executing",
"callable",
"functions",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/actions/RedirectAction.php#L32-L39 |
46,288 | hiqdev/hipanel-core | src/filters/EasyAccessControl.php | EasyAccessControl.init | public function init()
{
parent::init();
if ($this->user !== false) {
$this->user = Instance::ensure($this->user, User::class);
}
} | php | public function init()
{
parent::init();
if ($this->user !== false) {
$this->user = Instance::ensure($this->user, User::class);
}
} | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"user",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
"user",
"=",
"Instance",
"::",
"ensure",
"(",
"$",
"this",
"->",
"user",
",",
... | Initializes user. | [
"Initializes",
"user",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/filters/EasyAccessControl.php#L61-L67 |
46,289 | hiqdev/hipanel-core | src/helpers/Url.php | Url.toSearch | public static function toSearch(string $modelName, array $params = [], string $action = 'index')
{
$formName = Inflector::id2camel($modelName) . 'Search';
return static::toAction($modelName, [$formName => $params], $action);
} | php | public static function toSearch(string $modelName, array $params = [], string $action = 'index')
{
$formName = Inflector::id2camel($modelName) . 'Search';
return static::toAction($modelName, [$formName => $params], $action);
} | [
"public",
"static",
"function",
"toSearch",
"(",
"string",
"$",
"modelName",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"string",
"$",
"action",
"=",
"'index'",
")",
"{",
"$",
"formName",
"=",
"Inflector",
"::",
"id2camel",
"(",
"$",
"modelName",
... | Build search url.
@param string $modelName
@param array $params
@param string $action
@return array|string | [
"Build",
"search",
"url",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/helpers/Url.php#L43-L48 |
46,290 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Priloha.php | Priloha.getDownloadUrl | public static function getDownloadUrl($object)
{
$urlParts = parse_url($object->apiURL);
$pathParts = pathinfo($urlParts['path']);
return $urlParts['scheme'].'://'.$urlParts['host'] .( array_key_exists('port',$urlParts) ? ':'.$urlParts['port'] : '') .$pathParts['dirname'].'/'.$pathParts['filename'].'/content';
} | php | public static function getDownloadUrl($object)
{
$urlParts = parse_url($object->apiURL);
$pathParts = pathinfo($urlParts['path']);
return $urlParts['scheme'].'://'.$urlParts['host'] .( array_key_exists('port',$urlParts) ? ':'.$urlParts['port'] : '') .$pathParts['dirname'].'/'.$pathParts['filename'].'/content';
} | [
"public",
"static",
"function",
"getDownloadUrl",
"(",
"$",
"object",
")",
"{",
"$",
"urlParts",
"=",
"parse_url",
"(",
"$",
"object",
"->",
"apiURL",
")",
";",
"$",
"pathParts",
"=",
"pathinfo",
"(",
"$",
"urlParts",
"[",
"'path'",
"]",
")",
";",
"ret... | Obtain url for Attachment Download
@param FlexiBeeRO $object Source object
@return string url | [
"Obtain",
"url",
"for",
"Attachment",
"Download"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Priloha.php#L75-L80 |
46,291 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Priloha.php | Priloha.getFirstAttachment | public static function getFirstAttachment($object)
{
$attachments = self::getAttachmentsList($object);
return count($attachments) ? current($attachments) : null;
} | php | public static function getFirstAttachment($object)
{
$attachments = self::getAttachmentsList($object);
return count($attachments) ? current($attachments) : null;
} | [
"public",
"static",
"function",
"getFirstAttachment",
"(",
"$",
"object",
")",
"{",
"$",
"attachments",
"=",
"self",
"::",
"getAttachmentsList",
"(",
"$",
"object",
")",
";",
"return",
"count",
"(",
"$",
"attachments",
")",
"?",
"current",
"(",
"$",
"attac... | Obtain first attachment for given object
@param FlexiBeeRO $object
@return array | [
"Obtain",
"first",
"attachment",
"for",
"given",
"object"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Priloha.php#L88-L92 |
46,292 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Priloha.php | Priloha.getAttachment | public static function getAttachment($attachmentID,$options = [])
{
$result = null;
$downloader = new Priloha($attachmentID,$options);
if ($downloader->lastResponseCode == 200) {
$downloader->doCurlRequest(self::getDownloadURL($downloader), 'GET');
if ($downloader->lastResponseCode == 200) {
$result = $downloader->lastCurlResponse;
}
}
return $result;
} | php | public static function getAttachment($attachmentID,$options = [])
{
$result = null;
$downloader = new Priloha($attachmentID,$options);
if ($downloader->lastResponseCode == 200) {
$downloader->doCurlRequest(self::getDownloadURL($downloader), 'GET');
if ($downloader->lastResponseCode == 200) {
$result = $downloader->lastCurlResponse;
}
}
return $result;
} | [
"public",
"static",
"function",
"getAttachment",
"(",
"$",
"attachmentID",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"downloader",
"=",
"new",
"Priloha",
"(",
"$",
"attachmentID",
",",
"$",
"options",
")",
";",... | Gives you attachment body as return value
@param int $attachmentID
@param array $options Additional Connection Options
@return string | [
"Gives",
"you",
"attachment",
"body",
"as",
"return",
"value"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Priloha.php#L102-L114 |
46,293 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Priloha.php | Priloha.download | public static function download($object, $format = 'pdf',
$attachmentID = null)
{
$attachments = self::getAttachmentsList($object);
if (isset($attachmentID) && !array_key_exists($attachmentID,
$attachments)) {
$object->addStatusMessage(sprintf(_('Attagment %s does no exist'),
$attachmentID), 'warning');
}
$attachmentBody = $object->doCurlRequest(self::getDownloadUrl($object),
'GET');
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Disposition: attachment; filename='.$object->getEvidence().'_'.$object.'.'.$format);
header('Content-Length: '.strlen($attachmentBody));
echo $attachmentBody;
} | php | public static function download($object, $format = 'pdf',
$attachmentID = null)
{
$attachments = self::getAttachmentsList($object);
if (isset($attachmentID) && !array_key_exists($attachmentID,
$attachments)) {
$object->addStatusMessage(sprintf(_('Attagment %s does no exist'),
$attachmentID), 'warning');
}
$attachmentBody = $object->doCurlRequest(self::getDownloadUrl($object),
'GET');
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Disposition: attachment; filename='.$object->getEvidence().'_'.$object.'.'.$format);
header('Content-Length: '.strlen($attachmentBody));
echo $attachmentBody;
} | [
"public",
"static",
"function",
"download",
"(",
"$",
"object",
",",
"$",
"format",
"=",
"'pdf'",
",",
"$",
"attachmentID",
"=",
"null",
")",
"{",
"$",
"attachments",
"=",
"self",
"::",
"getAttachmentsList",
"(",
"$",
"object",
")",
";",
"if",
"(",
"is... | Send "download" headers first and then file itself
@param FlexiBeeRO $object
@param int|string $attachmentID | [
"Send",
"download",
"headers",
"first",
"and",
"then",
"file",
"itself"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Priloha.php#L122-L144 |
46,294 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Priloha.php | Priloha.saveToFile | public static function saveToFile($attachmentID, $destination)
{
$result = 0;
$downloader = new Priloha($attachmentID);
if ($downloader->lastResponseCode == 200) {
$downloader->doCurlRequest(self::getDownloadURL($downloader), 'GET');
if ($downloader->lastResponseCode == 200) {
if (is_dir($destination)) {
$destination .= '/'.$downloader->getDataValue('nazSoub');
}
$result = file_put_contents($destination,
$downloader->lastCurlResponse);
}
}
return $result;
} | php | public static function saveToFile($attachmentID, $destination)
{
$result = 0;
$downloader = new Priloha($attachmentID);
if ($downloader->lastResponseCode == 200) {
$downloader->doCurlRequest(self::getDownloadURL($downloader), 'GET');
if ($downloader->lastResponseCode == 200) {
if (is_dir($destination)) {
$destination .= '/'.$downloader->getDataValue('nazSoub');
}
$result = file_put_contents($destination,
$downloader->lastCurlResponse);
}
}
return $result;
} | [
"public",
"static",
"function",
"saveToFile",
"(",
"$",
"attachmentID",
",",
"$",
"destination",
")",
"{",
"$",
"result",
"=",
"0",
";",
"$",
"downloader",
"=",
"new",
"Priloha",
"(",
"$",
"attachmentID",
")",
";",
"if",
"(",
"$",
"downloader",
"->",
"... | Save attachment to file
@param int $attachmentID
@param string $destination directory or filename with path
@return int | [
"Save",
"attachment",
"to",
"file"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Priloha.php#L153-L169 |
46,295 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Priloha.php | Priloha.addAttachmentFromFile | public static function addAttachmentFromFile($object, $filename)
{
return self::addAttachment($object, basename($filename),
file_get_contents($filename), mime_content_type($filename));
} | php | public static function addAttachmentFromFile($object, $filename)
{
return self::addAttachment($object, basename($filename),
file_get_contents($filename), mime_content_type($filename));
} | [
"public",
"static",
"function",
"addAttachmentFromFile",
"(",
"$",
"object",
",",
"$",
"filename",
")",
"{",
"return",
"self",
"::",
"addAttachment",
"(",
"$",
"object",
",",
"basename",
"(",
"$",
"filename",
")",
",",
"file_get_contents",
"(",
"$",
"filenam... | Add Attachment from File
@param FlexiBeeRW $object
@param string $filename
@return int HTTP response code | [
"Add",
"Attachment",
"from",
"File"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Priloha.php#L179-L183 |
46,296 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Priloha.php | Priloha.getAttachmentsList | public static function getAttachmentsList($object)
{
$fburl = $object->getFlexiBeeURL();
$attachments = [];
$oFormat = $object->format;
$object->setFormat('json');
$atch = $object->getFlexiData($fburl.'/prilohy'.(count($object->defaultUrlParams)
? '?'.http_build_query($object->defaultUrlParams) : ''));
$object->setFormat($oFormat);
if (count($atch) && ($object->lastResponseCode == 200)) {
foreach ($atch as $attachmentID => $attachmentData) {
$attachments[$attachmentID] = $attachmentData;
$attachments[$attachmentID]['url'] = $object->url.'/c/'.$object->company.'/priloha/'.$attachmentData['id'];
}
}
return $attachments;
} | php | public static function getAttachmentsList($object)
{
$fburl = $object->getFlexiBeeURL();
$attachments = [];
$oFormat = $object->format;
$object->setFormat('json');
$atch = $object->getFlexiData($fburl.'/prilohy'.(count($object->defaultUrlParams)
? '?'.http_build_query($object->defaultUrlParams) : ''));
$object->setFormat($oFormat);
if (count($atch) && ($object->lastResponseCode == 200)) {
foreach ($atch as $attachmentID => $attachmentData) {
$attachments[$attachmentID] = $attachmentData;
$attachments[$attachmentID]['url'] = $object->url.'/c/'.$object->company.'/priloha/'.$attachmentData['id'];
}
}
return $attachments;
} | [
"public",
"static",
"function",
"getAttachmentsList",
"(",
"$",
"object",
")",
"{",
"$",
"fburl",
"=",
"$",
"object",
"->",
"getFlexiBeeURL",
"(",
")",
";",
"$",
"attachments",
"=",
"[",
"]",
";",
"$",
"oFormat",
"=",
"$",
"object",
"->",
"format",
";"... | Obtain Record related attachments list
@param FlexiBeeRO $object
@return array | [
"Obtain",
"Record",
"related",
"attachments",
"list"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Priloha.php#L215-L231 |
46,297 | hiqdev/hipanel-core | src/helpers/FileHelper.php | FileHelper.getContentMimeType | public static function getContentMimeType($content)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimeType = finfo_buffer($finfo, $content);
finfo_close($finfo);
return $mimeType;
} | php | public static function getContentMimeType($content)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimeType = finfo_buffer($finfo, $content);
finfo_close($finfo);
return $mimeType;
} | [
"public",
"static",
"function",
"getContentMimeType",
"(",
"$",
"content",
")",
"{",
"$",
"finfo",
"=",
"finfo_open",
"(",
"FILEINFO_MIME_TYPE",
")",
";",
"$",
"mimeType",
"=",
"finfo_buffer",
"(",
"$",
"finfo",
",",
"$",
"content",
")",
";",
"finfo_close",
... | Returns the MIME-type of content in string.
@param string $content
@return string Content mime-type | [
"Returns",
"the",
"MIME",
"-",
"type",
"of",
"content",
"in",
"string",
"."
] | 090eb4b95dd731b338cd661b569f6b9b999f95e4 | https://github.com/hiqdev/hipanel-core/blob/090eb4b95dd731b338cd661b569f6b9b999f95e4/src/helpers/FileHelper.php#L23-L30 |
46,298 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Adresar.php | Adresar.getNotificationEmailAddress | public function getNotificationEmailAddress()
{
$email = null;
$emailsRaw = $this->getFlexiData($this->getApiURL(),
['detail' => 'custom:id,email,kontakty(primarni,email)', 'relations' => 'kontakty']);
if (is_array($emailsRaw) && !empty($emailsRaw[0])) {
$emails = $emailsRaw[0];
if (array_key_exists('email', $emails) && strlen(trim($emails['email']))) {
$email = $emails['email'];
}
if (array_key_exists('kontakty', $emails) && !empty($emails['kontakty'])) {
foreach ($emails['kontakty'] as $kontakt) {
if (($kontakt['primarni'] == 'true') && strlen(trim($kontakt['email']))) {
$email = $kontakt['email'];
break;
}
}
}
}
return $email;
} | php | public function getNotificationEmailAddress()
{
$email = null;
$emailsRaw = $this->getFlexiData($this->getApiURL(),
['detail' => 'custom:id,email,kontakty(primarni,email)', 'relations' => 'kontakty']);
if (is_array($emailsRaw) && !empty($emailsRaw[0])) {
$emails = $emailsRaw[0];
if (array_key_exists('email', $emails) && strlen(trim($emails['email']))) {
$email = $emails['email'];
}
if (array_key_exists('kontakty', $emails) && !empty($emails['kontakty'])) {
foreach ($emails['kontakty'] as $kontakt) {
if (($kontakt['primarni'] == 'true') && strlen(trim($kontakt['email']))) {
$email = $kontakt['email'];
break;
}
}
}
}
return $email;
} | [
"public",
"function",
"getNotificationEmailAddress",
"(",
")",
"{",
"$",
"email",
"=",
"null",
";",
"$",
"emailsRaw",
"=",
"$",
"this",
"->",
"getFlexiData",
"(",
"$",
"this",
"->",
"getApiURL",
"(",
")",
",",
"[",
"'detail'",
"=>",
"'custom:id,email,kontakt... | get Email address for Customer with primary contact prefered
@return string email of primary contact or address email or null | [
"get",
"Email",
"address",
"for",
"Customer",
"with",
"primary",
"contact",
"prefered"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Adresar.php#L32-L52 |
46,299 | Spoje-NET/FlexiPeeHP | src/FlexiPeeHP/Adresar.php | Adresar.getCellPhoneNumber | public function getCellPhoneNumber()
{
$mobil = null;
$mobilsRaw = $this->getFlexiData($this->getApiURL(),
['detail' => 'custom:id,mobil,kontakty(primarni,mobil)', 'relations' => 'kontakty']);
if (is_array($mobilsRaw)) {
$mobils = $mobilsRaw[0];
if (array_key_exists('mobil', $mobils) && strlen(trim($mobils['mobil']))) {
$mobil = $mobils['mobil'];
}
if (array_key_exists('kontakty', $mobils) && !empty($mobils['kontakty'])) {
foreach ($mobils['kontakty'] as $kontakt) {
if (($kontakt['primarni'] == 'true') && strlen(trim($kontakt['mobil']))) {
$mobil = $kontakt['mobil'];
break;
}
}
}
}
return $mobil;
} | php | public function getCellPhoneNumber()
{
$mobil = null;
$mobilsRaw = $this->getFlexiData($this->getApiURL(),
['detail' => 'custom:id,mobil,kontakty(primarni,mobil)', 'relations' => 'kontakty']);
if (is_array($mobilsRaw)) {
$mobils = $mobilsRaw[0];
if (array_key_exists('mobil', $mobils) && strlen(trim($mobils['mobil']))) {
$mobil = $mobils['mobil'];
}
if (array_key_exists('kontakty', $mobils) && !empty($mobils['kontakty'])) {
foreach ($mobils['kontakty'] as $kontakt) {
if (($kontakt['primarni'] == 'true') && strlen(trim($kontakt['mobil']))) {
$mobil = $kontakt['mobil'];
break;
}
}
}
}
return $mobil;
} | [
"public",
"function",
"getCellPhoneNumber",
"(",
")",
"{",
"$",
"mobil",
"=",
"null",
";",
"$",
"mobilsRaw",
"=",
"$",
"this",
"->",
"getFlexiData",
"(",
"$",
"this",
"->",
"getApiURL",
"(",
")",
",",
"[",
"'detail'",
"=>",
"'custom:id,mobil,kontakty(primarn... | get cell phone Number for Customer with primary contact prefered
@return string cell phone number of primary contact or address cell number or null | [
"get",
"cell",
"phone",
"Number",
"for",
"Customer",
"with",
"primary",
"contact",
"prefered"
] | 8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73 | https://github.com/Spoje-NET/FlexiPeeHP/blob/8c1d8d39e6d2d23a85ec5ef7afbb9f040fbaba73/src/FlexiPeeHP/Adresar.php#L59-L79 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.