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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
16,800 | MinecraftJP/minecraftjp-php-sdk | src/MinecraftJP.php | MinecraftJP.getCurrentUrl | protected function getCurrentUrl() {
$isHttps = $this->getServerVar('HTTPS');
$forwardedProto = $this->getServerVar('HTTP_X_FORWARDED_PROTO');
if ($isHttps == 'on' || $forwardedProto === 'https') {
$schema = 'https://';
} else {
$schema = 'http://';
}
... | php | protected function getCurrentUrl() {
$isHttps = $this->getServerVar('HTTPS');
$forwardedProto = $this->getServerVar('HTTP_X_FORWARDED_PROTO');
if ($isHttps == 'on' || $forwardedProto === 'https') {
$schema = 'https://';
} else {
$schema = 'http://';
}
... | [
"protected",
"function",
"getCurrentUrl",
"(",
")",
"{",
"$",
"isHttps",
"=",
"$",
"this",
"->",
"getServerVar",
"(",
"'HTTPS'",
")",
";",
"$",
"forwardedProto",
"=",
"$",
"this",
"->",
"getServerVar",
"(",
"'HTTP_X_FORWARDED_PROTO'",
")",
";",
"if",
"(",
... | Get Current Url
@return string | [
"Get",
"Current",
"Url"
] | ecc592c9b6d33eb0c896210f7c9948672db54728 | https://github.com/MinecraftJP/minecraftjp-php-sdk/blob/ecc592c9b6d33eb0c896210f7c9948672db54728/src/MinecraftJP.php#L367-L389 |
16,801 | MinecraftJP/minecraftjp-php-sdk | src/MinecraftJP.php | MinecraftJP.validateIdToken | protected function validateIdToken($idToken) {
$segments = explode('.', $idToken);
if (count($segments) != 3) {
throw new InvalidIdTokenException('Invalid Token');
}
$header = json_decode($this->decodeBase64Url($segments[0]), true);
if (empty($header)) {
t... | php | protected function validateIdToken($idToken) {
$segments = explode('.', $idToken);
if (count($segments) != 3) {
throw new InvalidIdTokenException('Invalid Token');
}
$header = json_decode($this->decodeBase64Url($segments[0]), true);
if (empty($header)) {
t... | [
"protected",
"function",
"validateIdToken",
"(",
"$",
"idToken",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"'.'",
",",
"$",
"idToken",
")",
";",
"if",
"(",
"count",
"(",
"$",
"segments",
")",
"!=",
"3",
")",
"{",
"throw",
"new",
"InvalidIdTokenEx... | Validate ID Token
@param $idToken
@return mixed
@throws Exception | [
"Validate",
"ID",
"Token"
] | ecc592c9b6d33eb0c896210f7c9948672db54728 | https://github.com/MinecraftJP/minecraftjp-php-sdk/blob/ecc592c9b6d33eb0c896210f7c9948672db54728/src/MinecraftJP.php#L436-L495 |
16,802 | MinecraftJP/minecraftjp-php-sdk | src/MinecraftJP.php | PHPSessionStorage.read | public function read($key) {
return isset($_SESSION[$this->prefix . $key]) ? $_SESSION[$this->prefix . $key] : null;
} | php | public function read($key) {
return isset($_SESSION[$this->prefix . $key]) ? $_SESSION[$this->prefix . $key] : null;
} | [
"public",
"function",
"read",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"prefix",
".",
"$",
"key",
"]",
")",
"?",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"prefix",
".",
"$",
"key",
"]",
":",
"n... | Read from session
@param $key string
@return mixed | [
"Read",
"from",
"session"
] | ecc592c9b6d33eb0c896210f7c9948672db54728 | https://github.com/MinecraftJP/minecraftjp-php-sdk/blob/ecc592c9b6d33eb0c896210f7c9948672db54728/src/MinecraftJP.php#L681-L683 |
16,803 | parsnick/steak | src/Build/Builder.php | Builder.build | public function build($sourceDir, $outputDir)
{
$sourceList = $this->findSources($sourceDir, $outputDir);
return array_walk($sourceList, [$this, 'publish']);
} | php | public function build($sourceDir, $outputDir)
{
$sourceList = $this->findSources($sourceDir, $outputDir);
return array_walk($sourceList, [$this, 'publish']);
} | [
"public",
"function",
"build",
"(",
"$",
"sourceDir",
",",
"$",
"outputDir",
")",
"{",
"$",
"sourceList",
"=",
"$",
"this",
"->",
"findSources",
"(",
"$",
"sourceDir",
",",
"$",
"outputDir",
")",
";",
"return",
"array_walk",
"(",
"$",
"sourceList",
",",
... | Build the site.
@param string $sourceDir
@param string $outputDir
@return bool | [
"Build",
"the",
"site",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Build/Builder.php#L43-L48 |
16,804 | parsnick/steak | src/Build/Builder.php | Builder.findSources | protected function findSources($searchIn, $outputTo)
{
$files = iterator_to_array(new FilesystemIterator($searchIn));
return array_map(function (SplFileInfo $file) use ($outputTo) {
return $this->makeSource($file, $outputTo);
}, $files);
} | php | protected function findSources($searchIn, $outputTo)
{
$files = iterator_to_array(new FilesystemIterator($searchIn));
return array_map(function (SplFileInfo $file) use ($outputTo) {
return $this->makeSource($file, $outputTo);
}, $files);
} | [
"protected",
"function",
"findSources",
"(",
"$",
"searchIn",
",",
"$",
"outputTo",
")",
"{",
"$",
"files",
"=",
"iterator_to_array",
"(",
"new",
"FilesystemIterator",
"(",
"$",
"searchIn",
")",
")",
";",
"return",
"array_map",
"(",
"function",
"(",
"SplFile... | Create array of Sources from the given input directory.
@param string $searchIn
@param string $outputTo
@return array | [
"Create",
"array",
"of",
"Sources",
"from",
"the",
"given",
"input",
"directory",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Build/Builder.php#L57-L66 |
16,805 | parsnick/steak | src/Build/Builder.php | Builder.makeSource | public function makeSource(SplFileInfo $file, $outputDir)
{
return new Source($file->getPathname(), $outputDir . DIRECTORY_SEPARATOR . $file->getFilename());
} | php | public function makeSource(SplFileInfo $file, $outputDir)
{
return new Source($file->getPathname(), $outputDir . DIRECTORY_SEPARATOR . $file->getFilename());
} | [
"public",
"function",
"makeSource",
"(",
"SplFileInfo",
"$",
"file",
",",
"$",
"outputDir",
")",
"{",
"return",
"new",
"Source",
"(",
"$",
"file",
"->",
"getPathname",
"(",
")",
",",
"$",
"outputDir",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"file",
"->",
"... | Create a Source from the given file and output dir.
@param SplFileInfo $file
@param string $outputDir
@return Source | [
"Create",
"a",
"Source",
"from",
"the",
"given",
"file",
"and",
"output",
"dir",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Build/Builder.php#L75-L78 |
16,806 | parsnick/steak | src/Build/Builder.php | Builder.clean | public function clean($dir, $preserveGit = false)
{
$filesystem = new Filesystem();
if ( ! $filesystem->exists($dir)) {
return $filesystem->makeDirectory($dir, 0755, true);
}
foreach (new FilesystemIterator($dir) as $file) {
if ($preserveGit && $file->getFil... | php | public function clean($dir, $preserveGit = false)
{
$filesystem = new Filesystem();
if ( ! $filesystem->exists($dir)) {
return $filesystem->makeDirectory($dir, 0755, true);
}
foreach (new FilesystemIterator($dir) as $file) {
if ($preserveGit && $file->getFil... | [
"public",
"function",
"clean",
"(",
"$",
"dir",
",",
"$",
"preserveGit",
"=",
"false",
")",
"{",
"$",
"filesystem",
"=",
"new",
"Filesystem",
"(",
")",
";",
"if",
"(",
"!",
"$",
"filesystem",
"->",
"exists",
"(",
"$",
"dir",
")",
")",
"{",
"return"... | Remove the contents of a directory, but not the directory itself.
@param string $dir
@param bool $preserveGit
@return bool | [
"Remove",
"the",
"contents",
"of",
"a",
"directory",
"but",
"not",
"the",
"directory",
"itself",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Build/Builder.php#L105-L125 |
16,807 | simple-php-mvc/simple-php-mvc | src/MVC/DataBase/PDO.php | PDO.prepare | public function prepare($sql, array $driverOptions = array())
{
$this->numStatements++;
$pdos = $this->_pdo->prepare($sql, $driverOptions);
return new PDOStatement($this, $pdos);
} | php | public function prepare($sql, array $driverOptions = array())
{
$this->numStatements++;
$pdos = $this->_pdo->prepare($sql, $driverOptions);
return new PDOStatement($this, $pdos);
} | [
"public",
"function",
"prepare",
"(",
"$",
"sql",
",",
"array",
"$",
"driverOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"numStatements",
"++",
";",
"$",
"pdos",
"=",
"$",
"this",
"->",
"_pdo",
"->",
"prepare",
"(",
"$",
"sql",
",... | Prepare the statement SQL
@access public
@param string $sql Statement SQL
@param srray $driverOptions Driver options
@return PDOStatement | [
"Prepare",
"the",
"statement",
"SQL"
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/PDO.php#L100-L107 |
16,808 | simple-php-mvc/simple-php-mvc | src/MVC/DataBase/PDO.php | PDO.query | public function query($sql)
{
$this->numExecutes++;
$this->numStatements++;
$pdos = $this->_pdo->query($sql);
return new PDOStatement($this, $pdos);
} | php | public function query($sql)
{
$this->numExecutes++;
$this->numStatements++;
$pdos = $this->_pdo->query($sql);
return new PDOStatement($this, $pdos);
} | [
"public",
"function",
"query",
"(",
"$",
"sql",
")",
"{",
"$",
"this",
"->",
"numExecutes",
"++",
";",
"$",
"this",
"->",
"numStatements",
"++",
";",
"$",
"pdos",
"=",
"$",
"this",
"->",
"_pdo",
"->",
"query",
"(",
"$",
"sql",
")",
";",
"return",
... | Executes the statement query
@access public
@param string $sql Statement SQL
@return PDOStatement | [
"Executes",
"the",
"statement",
"query"
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/PDO.php#L115-L123 |
16,809 | nyeholt/silverstripe-external-content | code/transform/ExternalContentImporter.php | ExternalContentImporter.import | public function import($contentItem, $target, $includeParent = false, $includeChildren = true, $duplicateStrategy='Overwrite', $params = array()) {
$this->runOnImportStart();
$this->params = $params;
// if the queuedjobs module exists, use that
$queuedVersion = 'Queued' . get_class($this);
if ($this->config(... | php | public function import($contentItem, $target, $includeParent = false, $includeChildren = true, $duplicateStrategy='Overwrite', $params = array()) {
$this->runOnImportStart();
$this->params = $params;
// if the queuedjobs module exists, use that
$queuedVersion = 'Queued' . get_class($this);
if ($this->config(... | [
"public",
"function",
"import",
"(",
"$",
"contentItem",
",",
"$",
"target",
",",
"$",
"includeParent",
"=",
"false",
",",
"$",
"includeChildren",
"=",
"true",
",",
"$",
"duplicateStrategy",
"=",
"'Overwrite'",
",",
"$",
"params",
"=",
"array",
"(",
")",
... | Import from a content source to a particular target
@param ExternalContentItem $contentItem
@param SiteTree $target
@param boolean $includeParent
Whether to include the selected item in the import or not
@param String $duplicateStrategy
How to handle duplication
@param array $params All parameters passed with the impo... | [
"Import",
"from",
"a",
"content",
"source",
"to",
"a",
"particular",
"target"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/transform/ExternalContentImporter.php#L34-L66 |
16,810 | nyeholt/silverstripe-external-content | code/transform/ExternalContentImporter.php | ExternalContentImporter.importChildren | protected function importChildren($children, $parent, $includeChildren, $duplicateStrategy) {
if (!$children) {
return;
}
// get the importer to use, import, then see if there's any
foreach ($children as $child) {
$pageType = $this->getExternalType($child);
if (isset($this->contentTransforms[$pageType... | php | protected function importChildren($children, $parent, $includeChildren, $duplicateStrategy) {
if (!$children) {
return;
}
// get the importer to use, import, then see if there's any
foreach ($children as $child) {
$pageType = $this->getExternalType($child);
if (isset($this->contentTransforms[$pageType... | [
"protected",
"function",
"importChildren",
"(",
"$",
"children",
",",
"$",
"parent",
",",
"$",
"includeChildren",
",",
"$",
"duplicateStrategy",
")",
"{",
"if",
"(",
"!",
"$",
"children",
")",
"{",
"return",
";",
"}",
"// get the importer to use, import, then se... | Execute the importing of several children
@param DataObjectSet $children
@param SiteTree $parent | [
"Execute",
"the",
"importing",
"of",
"several",
"children"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/transform/ExternalContentImporter.php#L74-L95 |
16,811 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedImage.php | ExtendedImage.getBase64Tag | public function getBase64Tag() {
if($this->owner->exists()) {
$url = $this->owner->getBase64Source();
$title = ($this->owner->Title) ? $this->owner->Title : $this->owner->Filename;
if($this->owner->Title) {
... | php | public function getBase64Tag() {
if($this->owner->exists()) {
$url = $this->owner->getBase64Source();
$title = ($this->owner->Title) ? $this->owner->Title : $this->owner->Filename;
if($this->owner->Title) {
... | [
"public",
"function",
"getBase64Tag",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"owner",
"->",
"getBase64Source",
"(",
")",
";",
"$",
"title",
"=",
"(",
"$",
"thi... | Return an XHTML img tag for this Image.
@return string | [
"Return",
"an",
"XHTML",
"img",
"tag",
"for",
"this",
"Image",
"."
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedImage.php#L29-L40 |
16,812 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedImage.php | ExtendedImage.getBase64Source | public function getBase64Source(){
$Fullpath = $this->owner->getFullPath();
$cache = SS_Cache::factory('Base64Image');
$cachekey = md5($Fullpath);
if(!($Base64Image = $cache->load($cachekey))){
$Base64Image = base64_encode(file_get_con... | php | public function getBase64Source(){
$Fullpath = $this->owner->getFullPath();
$cache = SS_Cache::factory('Base64Image');
$cachekey = md5($Fullpath);
if(!($Base64Image = $cache->load($cachekey))){
$Base64Image = base64_encode(file_get_con... | [
"public",
"function",
"getBase64Source",
"(",
")",
"{",
"$",
"Fullpath",
"=",
"$",
"this",
"->",
"owner",
"->",
"getFullPath",
"(",
")",
";",
"$",
"cache",
"=",
"SS_Cache",
"::",
"factory",
"(",
"'Base64Image'",
")",
";",
"$",
"cachekey",
"=",
"md5",
"... | retrun the Base64 Notation of the Image | [
"retrun",
"the",
"Base64",
"Notation",
"of",
"the",
"Image"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedImage.php#L45-L58 |
16,813 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedImage.php | ExtendedImage.DetectFace | public function DetectFace(){
$detector = new svay\FaceDetector();
$detector->faceDetect($this->owner->getFullPath());
return $detector->getFace();
} | php | public function DetectFace(){
$detector = new svay\FaceDetector();
$detector->faceDetect($this->owner->getFullPath());
return $detector->getFace();
} | [
"public",
"function",
"DetectFace",
"(",
")",
"{",
"$",
"detector",
"=",
"new",
"svay",
"\\",
"FaceDetector",
"(",
")",
";",
"$",
"detector",
"->",
"faceDetect",
"(",
"$",
"this",
"->",
"owner",
"->",
"getFullPath",
"(",
")",
")",
";",
"return",
"$",
... | Detect a Face inside the image
returns null or an Array with x, y coordinates and w = width/height (square)
@return Array | [
"Detect",
"a",
"Face",
"inside",
"the",
"image"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedImage.php#L66-L70 |
16,814 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedImage.php | ExtendedImage.DetectedFace | public function DetectedFace(){
if($this->owner->exists()) {
$cacheFile = $this->owner->cacheDetectedFaceFilename();
if(!file_exists(Director::baseFolder()."/".$cacheFile) || isset($_GET['flush'])) {
$this->owner->generateDetectedFaceImage();
}
if($this->owner instanceof SecureImage) $cach... | php | public function DetectedFace(){
if($this->owner->exists()) {
$cacheFile = $this->owner->cacheDetectedFaceFilename();
if(!file_exists(Director::baseFolder()."/".$cacheFile) || isset($_GET['flush'])) {
$this->owner->generateDetectedFaceImage();
}
if($this->owner instanceof SecureImage) $cach... | [
"public",
"function",
"DetectedFace",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"owner",
"->",
"cacheDetectedFaceFilename",
"(",
")",
";",
"if",
"(",
"!",
"file... | returns the image with the face marked in a red square
@return Image_Cached|SecureImage_Cached | [
"returns",
"the",
"image",
"with",
"the",
"face",
"marked",
"in",
"a",
"red",
"square"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedImage.php#L77-L94 |
16,815 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedImage.php | ExtendedImage.getMergedImage | public function getMergedImage($format, $padding, $mergeimage) {
if($this->owner->exists() && Director::fileExists($mergeimage)) {
$cacheFile = $this->owner->cacheMergedFilename($format, $padding, $mergeimage);
if(!file_exists(Director::baseFolder()."/".$cach... | php | public function getMergedImage($format, $padding, $mergeimage) {
if($this->owner->exists() && Director::fileExists($mergeimage)) {
$cacheFile = $this->owner->cacheMergedFilename($format, $padding, $mergeimage);
if(!file_exists(Director::baseFolder()."/".$cach... | [
"public",
"function",
"getMergedImage",
"(",
"$",
"format",
",",
"$",
"padding",
",",
"$",
"mergeimage",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"exists",
"(",
")",
"&&",
"Director",
"::",
"fileExists",
"(",
"$",
"mergeimage",
")",
")",
... | Return an image object representing the merged image.
@param type $format
@param type $padding
@param type $mergeimage
@return Image_Cached | [
"Return",
"an",
"image",
"object",
"representing",
"the",
"merged",
"image",
"."
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedImage.php#L180-L200 |
16,816 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedImage.php | ExtendedImage.generateMergedImage | public function generateMergedImage($padding, $bgImagePath, $overlayImagePath, $cacheFile){
$bgImage = Injector::inst()->createWithArgs(Image::get_backend(), array(
$bgImagePath
));
$ovImage = Injector::inst()->createWithArgs(Image::get_backend(), array(
$overlayImagePath
));
$frontImag... | php | public function generateMergedImage($padding, $bgImagePath, $overlayImagePath, $cacheFile){
$bgImage = Injector::inst()->createWithArgs(Image::get_backend(), array(
$bgImagePath
));
$ovImage = Injector::inst()->createWithArgs(Image::get_backend(), array(
$overlayImagePath
));
$frontImag... | [
"public",
"function",
"generateMergedImage",
"(",
"$",
"padding",
",",
"$",
"bgImagePath",
",",
"$",
"overlayImagePath",
",",
"$",
"cacheFile",
")",
"{",
"$",
"bgImage",
"=",
"Injector",
"::",
"inst",
"(",
")",
"->",
"createWithArgs",
"(",
"Image",
"::",
"... | genereate the merged image | [
"genereate",
"the",
"merged",
"image"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedImage.php#L241-L256 |
16,817 | andrelohmann/silverstripe-extended-image | code/extensions/ExtendedImage.php | ExtendedImage.ToJPEG | public function ToJPEG($quality = null, $backgroundColor = null)
{
if (!$quality) $quality = Config::inst()->get('ExtendedImage', 'get_jpeg_default_quality');
if (!$backgroundColor) $backgroundColor = Config::inst()->get('ExtendedImage', 'get_jpeg_default_background_color');
return $this->owner->getJPEGIm... | php | public function ToJPEG($quality = null, $backgroundColor = null)
{
if (!$quality) $quality = Config::inst()->get('ExtendedImage', 'get_jpeg_default_quality');
if (!$backgroundColor) $backgroundColor = Config::inst()->get('ExtendedImage', 'get_jpeg_default_background_color');
return $this->owner->getJPEGIm... | [
"public",
"function",
"ToJPEG",
"(",
"$",
"quality",
"=",
"null",
",",
"$",
"backgroundColor",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"quality",
")",
"$",
"quality",
"=",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"'ExtendedImage'",
","... | Generate a jpeg image from the source
set quality and backgroundColor for Transparency
@param $quality
@param $backgroundColor | [
"Generate",
"a",
"jpeg",
"image",
"from",
"the",
"source"
] | 178e9142ae8ff63f9bf36464093379f6e836b90b | https://github.com/andrelohmann/silverstripe-extended-image/blob/178e9142ae8ff63f9bf36464093379f6e836b90b/code/extensions/ExtendedImage.php#L433-L440 |
16,818 | SachaMorard/phalcon-console | Library/Phalcon/Commands/Command.php | Command.checkRequired | public function checkRequired($required)
{
foreach ($required as $fieldRequired) {
if (!isset($this->_parameters[$fieldRequired])) {
throw new CommandsException("The parameter '$fieldRequired' is required for this script");
}
}
} | php | public function checkRequired($required)
{
foreach ($required as $fieldRequired) {
if (!isset($this->_parameters[$fieldRequired])) {
throw new CommandsException("The parameter '$fieldRequired' is required for this script");
}
}
} | [
"public",
"function",
"checkRequired",
"(",
"$",
"required",
")",
"{",
"foreach",
"(",
"$",
"required",
"as",
"$",
"fieldRequired",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_parameters",
"[",
"$",
"fieldRequired",
"]",
")",
")",
"{",... | Check that a set of parameters has been received.
@param $required
@throws CommandsException | [
"Check",
"that",
"a",
"set",
"of",
"parameters",
"has",
"been",
"received",
"."
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Command.php#L263-L270 |
16,819 | SachaMorard/phalcon-console | Library/Phalcon/Commands/Command.php | Command.showHelp | public function showHelp($possibleParameters)
{
echo get_class($this).' - Usage:'.PHP_EOL.PHP_EOL;
foreach ($possibleParameters as $parameter => $description) {
echo html_entity_decode($description, ENT_COMPAT, $this->_encoding).PHP_EOL;
}
} | php | public function showHelp($possibleParameters)
{
echo get_class($this).' - Usage:'.PHP_EOL.PHP_EOL;
foreach ($possibleParameters as $parameter => $description) {
echo html_entity_decode($description, ENT_COMPAT, $this->_encoding).PHP_EOL;
}
} | [
"public",
"function",
"showHelp",
"(",
"$",
"possibleParameters",
")",
"{",
"echo",
"get_class",
"(",
"$",
"this",
")",
".",
"' - Usage:'",
".",
"PHP_EOL",
".",
"PHP_EOL",
";",
"foreach",
"(",
"$",
"possibleParameters",
"as",
"$",
"parameter",
"=>",
"$",
"... | Displays help for the script.
@param array $possibleParameters | [
"Displays",
"help",
"for",
"the",
"script",
"."
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Command.php#L290-L296 |
16,820 | SachaMorard/phalcon-console | Library/Phalcon/Commands/Command.php | Command.getOptions | public function getOptions($filters = null)
{
if (!$filters) {
return $this->_parameters;
}
$result = [];
foreach ($this->_parameters as $param) {
$result[] = $this->filter($param, $filters);
}
return $result;
} | php | public function getOptions($filters = null)
{
if (!$filters) {
return $this->_parameters;
}
$result = [];
foreach ($this->_parameters as $param) {
$result[] = $this->filter($param, $filters);
}
return $result;
} | [
"public",
"function",
"getOptions",
"(",
"$",
"filters",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"filters",
")",
"{",
"return",
"$",
"this",
"->",
"_parameters",
";",
"}",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
... | Returns all received options.
@param mixed $filters Filter name or array of filters [Optional]
@return array | [
"Returns",
"all",
"received",
"options",
"."
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Command.php#L305-L318 |
16,821 | SachaMorard/phalcon-console | Library/Phalcon/Commands/Command.php | Command.getOption | public function getOption($option, $filters = null, $defaultValue = null)
{
if (is_array($option)) {
foreach ($option as $optionItem) {
if (isset($this->_parameters[$optionItem])) {
if ($filters !== null) {
return $this->filter($this->_... | php | public function getOption($option, $filters = null, $defaultValue = null)
{
if (is_array($option)) {
foreach ($option as $optionItem) {
if (isset($this->_parameters[$optionItem])) {
if ($filters !== null) {
return $this->filter($this->_... | [
"public",
"function",
"getOption",
"(",
"$",
"option",
",",
"$",
"filters",
"=",
"null",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"option",
")",
")",
"{",
"foreach",
"(",
"$",
"option",
"as",
"$",
"optionItem"... | Returns the value of an option received.
@param mixed $option Option name or array of options
@param mixed $filters Filter name or array of filters [Optional]
@param mixed $defaultValue Default value [Optional]
@return mixed | [
"Returns",
"the",
"value",
"of",
"an",
"option",
"received",
"."
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Command.php#L329-L354 |
16,822 | SachaMorard/phalcon-console | Library/Phalcon/Commands/Command.php | Command.isReceivedOption | public function isReceivedOption($option)
{
if (!is_array($option)) {
$option = [$option];
}
foreach ($option as $op) {
if (isset($this->_parameters[$op])) {
return true;
}
}
return false;
} | php | public function isReceivedOption($option)
{
if (!is_array($option)) {
$option = [$option];
}
foreach ($option as $op) {
if (isset($this->_parameters[$op])) {
return true;
}
}
return false;
} | [
"public",
"function",
"isReceivedOption",
"(",
"$",
"option",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"option",
")",
")",
"{",
"$",
"option",
"=",
"[",
"$",
"option",
"]",
";",
"}",
"foreach",
"(",
"$",
"option",
"as",
"$",
"op",
")",
"{"... | Indicates whether the script was a particular option.
@param string $option
@return boolean | [
"Indicates",
"whether",
"the",
"script",
"was",
"a",
"particular",
"option",
"."
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Command.php#L362-L375 |
16,823 | SachaMorard/phalcon-console | Library/Phalcon/Commands/Command.php | Command.getLastUnNamedParam | public function getLastUnNamedParam()
{
foreach (array_reverse($this->_parameters) as $key => $value) {
if (is_numeric($key)) {
return $value;
}
}
return false;
} | php | public function getLastUnNamedParam()
{
foreach (array_reverse($this->_parameters) as $key => $value) {
if (is_numeric($key)) {
return $value;
}
}
return false;
} | [
"public",
"function",
"getLastUnNamedParam",
"(",
")",
"{",
"foreach",
"(",
"array_reverse",
"(",
"$",
"this",
"->",
"_parameters",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"return",
... | Gets the last parameter is not associated with any parameter name.
@return string | [
"Gets",
"the",
"last",
"parameter",
"is",
"not",
"associated",
"with",
"any",
"parameter",
"name",
"."
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Command.php#L397-L406 |
16,824 | SachaMorard/phalcon-console | Library/Phalcon/Commands/Command.php | Command.printParameters | public function printParameters($parameters)
{
$length = 0;
foreach ($parameters as $parameter => $description) {
if ($length == 0) {
$length = strlen($parameter);
}
if (strlen($parameter) > $length) {
$length = strlen($parameter);
... | php | public function printParameters($parameters)
{
$length = 0;
foreach ($parameters as $parameter => $description) {
if ($length == 0) {
$length = strlen($parameter);
}
if (strlen($parameter) > $length) {
$length = strlen($parameter);
... | [
"public",
"function",
"printParameters",
"(",
"$",
"parameters",
")",
"{",
"$",
"length",
"=",
"0",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameter",
"=>",
"$",
"description",
")",
"{",
"if",
"(",
"$",
"length",
"==",
"0",
")",
"{",
"$"... | Prints the available options in the script
@param array $parameters | [
"Prints",
"the",
"available",
"options",
"in",
"the",
"script"
] | a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3 | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Commands/Command.php#L425-L442 |
16,825 | thienhungho/yii2-order-management | src/modules/OrderManage/controllers/OrderController.php | OrderController.findModel | protected function findModel($id)
{
if (($model = Order::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
} | php | protected function findModel($id)
{
if (($model = Order::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
} | [
"protected",
"function",
"findModel",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"(",
"$",
"model",
"=",
"Order",
"::",
"findOne",
"(",
"$",
"id",
")",
")",
"!==",
"null",
")",
"{",
"return",
"$",
"model",
";",
"}",
"else",
"{",
"throw",
"new",
"NotFou... | Finds the Order model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@return Order the loaded model
@throws NotFoundHttpException if the model cannot be found | [
"Finds",
"the",
"Order",
"model",
"based",
"on",
"its",
"primary",
"key",
"value",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"404",
"HTTP",
"exception",
"will",
"be",
"thrown",
"."
] | f263f0b2168d6f5e99cee2e20a5878d09d4e81c0 | https://github.com/thienhungho/yii2-order-management/blob/f263f0b2168d6f5e99cee2e20a5878d09d4e81c0/src/modules/OrderManage/controllers/OrderController.php#L306-L313 |
16,826 | anime-db/world-art-filler-bundle | src/Service/Browser.php | Browser.getDom | public function getDom($path)
{
$dom = new \DOMDocument('1.0', 'utf8');
if (($content = $this->getContent($path)) && $dom->loadHTML($content)) {
return $dom;
} else {
return;
}
} | php | public function getDom($path)
{
$dom = new \DOMDocument('1.0', 'utf8');
if (($content = $this->getContent($path)) && $dom->loadHTML($content)) {
return $dom;
} else {
return;
}
} | [
"public",
"function",
"getDom",
"(",
"$",
"path",
")",
"{",
"$",
"dom",
"=",
"new",
"\\",
"DOMDocument",
"(",
"'1.0'",
",",
"'utf8'",
")",
";",
"if",
"(",
"(",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
"$",
"path",
")",
")",
"&&"... | Get DOMDocument from path.
Receive content from the URL, cleaning using Tidy and creating DOM document
@param string $path
@return \DOMDocument|null | [
"Get",
"DOMDocument",
"from",
"path",
"."
] | f2ef4dbd12fe39c18183d1628b5049b8d381e42c | https://github.com/anime-db/world-art-filler-bundle/blob/f2ef4dbd12fe39c18183d1628b5049b8d381e42c/src/Service/Browser.php#L108-L116 |
16,827 | anime-db/world-art-filler-bundle | src/Service/Browser.php | Browser.getContent | public function getContent($path)
{
/* @var $response \Guzzle\Http\Message\Response */
$response = $this->getBrowser()->get($path)->send();
if ($response->isError()) {
throw new \RuntimeException('Failed to query the server '.$this->host);
}
if ($response->getStat... | php | public function getContent($path)
{
/* @var $response \Guzzle\Http\Message\Response */
$response = $this->getBrowser()->get($path)->send();
if ($response->isError()) {
throw new \RuntimeException('Failed to query the server '.$this->host);
}
if ($response->getStat... | [
"public",
"function",
"getContent",
"(",
"$",
"path",
")",
"{",
"/* @var $response \\Guzzle\\Http\\Message\\Response */",
"$",
"response",
"=",
"$",
"this",
"->",
"getBrowser",
"(",
")",
"->",
"get",
"(",
"$",
"path",
")",
"->",
"send",
"(",
")",
";",
"if",
... | Get content from path.
Receive content from the URL and cleaning using Tidy
@param string $path
@return string | [
"Get",
"content",
"from",
"path",
"."
] | f2ef4dbd12fe39c18183d1628b5049b8d381e42c | https://github.com/anime-db/world-art-filler-bundle/blob/f2ef4dbd12fe39c18183d1628b5049b8d381e42c/src/Service/Browser.php#L127-L158 |
16,828 | anime-db/world-art-filler-bundle | src/Service/Browser.php | Browser.getBrowser | protected function getBrowser()
{
if (!($this->browser instanceof Client)) {
$this->browser = new Client($this->host);
// try to set User-Agent from original request
$user_agent = self::DEFAULT_USER_AGENT;
if ($this->request) {
$user_agent = $... | php | protected function getBrowser()
{
if (!($this->browser instanceof Client)) {
$this->browser = new Client($this->host);
// try to set User-Agent from original request
$user_agent = self::DEFAULT_USER_AGENT;
if ($this->request) {
$user_agent = $... | [
"protected",
"function",
"getBrowser",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"browser",
"instanceof",
"Client",
")",
")",
"{",
"$",
"this",
"->",
"browser",
"=",
"new",
"Client",
"(",
"$",
"this",
"->",
"host",
")",
";",
"// try to s... | Get HTTP browser.
@param \Guzzle\Http\Client | [
"Get",
"HTTP",
"browser",
"."
] | f2ef4dbd12fe39c18183d1628b5049b8d381e42c | https://github.com/anime-db/world-art-filler-bundle/blob/f2ef4dbd12fe39c18183d1628b5049b8d381e42c/src/Service/Browser.php#L165-L185 |
16,829 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseLicense.php | BaseLicense.validate | public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
}
$this->validationFailures = $res;
return false;
} | php | public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
}
$this->validationFailures = $res;
return false;
} | [
"public",
"function",
"validate",
"(",
"$",
"columns",
"=",
"null",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"doValidate",
"(",
"$",
"columns",
")",
";",
"if",
"(",
"$",
"res",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"validationFailures",
... | Validates the objects modified field values and all objects related to this table.
If $columns is either a column name or an array of column names
only those columns are validated.
@param mixed $columns Column name or an array of column names.
@return boolean Whether all columns pass validation.
@see doValidat... | [
"Validates",
"the",
"objects",
"modified",
"field",
"values",
"and",
"all",
"objects",
"related",
"to",
"this",
"table",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseLicense.php#L609-L621 |
16,830 | danrevah/shortify-punit | src/ShortifyPunit.php | ShortifyPunit.mock | public static function mock($mockedClass)
{
$reflection = self::getMockReflection($mockedClass);
return static::mockClass(
$reflection,
self::$namespace,
self::$classBasePrefix
);
} | php | public static function mock($mockedClass)
{
$reflection = self::getMockReflection($mockedClass);
return static::mockClass(
$reflection,
self::$namespace,
self::$classBasePrefix
);
} | [
"public",
"static",
"function",
"mock",
"(",
"$",
"mockedClass",
")",
"{",
"$",
"reflection",
"=",
"self",
"::",
"getMockReflection",
"(",
"$",
"mockedClass",
")",
";",
"return",
"static",
"::",
"mockClass",
"(",
"$",
"reflection",
",",
"self",
"::",
"$",
... | Mocking interfaces & classes
@desc Ignoring final and private methods
Examples:
// Creating a new mock for SimpleClassForMocking
$mock = ShortifyPunit::mock('SimpleClassForMocking');
// Returns NULL, was not stubbed yet
$mock->first_method();
@param $mockedClass
@return mixed | [
"Mocking",
"interfaces",
"&",
"classes"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/ShortifyPunit.php#L95-L104 |
16,831 | danrevah/shortify-punit | src/ShortifyPunit.php | ShortifyPunit.partialMock | public static function partialMock($mockedClass)
{
$reflection = self::getMockReflection($mockedClass);
return static::mockClass(
$reflection,
self::$namespace,
self::$classBasePrefix,
MockTypes::PARTIAL
);
} | php | public static function partialMock($mockedClass)
{
$reflection = self::getMockReflection($mockedClass);
return static::mockClass(
$reflection,
self::$namespace,
self::$classBasePrefix,
MockTypes::PARTIAL
);
} | [
"public",
"static",
"function",
"partialMock",
"(",
"$",
"mockedClass",
")",
"{",
"$",
"reflection",
"=",
"self",
"::",
"getMockReflection",
"(",
"$",
"mockedClass",
")",
";",
"return",
"static",
"::",
"mockClass",
"(",
"$",
"reflection",
",",
"self",
"::",
... | Partial Mocking interfaces & classes
@desc Partial mock is not stubbing any function by default (to NULL) like in regular mock()
Examples:
// class to partial mock
class Foo {
function bar() { return 'bar'; }
}
$mock = ShortifyPunit::mock('Foo');
$partialMock = ShortifyPunit::partialMock('Foo');
$mock->bar(); // re... | [
"Partial",
"Mocking",
"interfaces",
"&",
"classes"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/ShortifyPunit.php#L129-L139 |
16,832 | danrevah/shortify-punit | src/ShortifyPunit.php | ShortifyPunit._isMethodStubbed | protected static function _isMethodStubbed($className, $instanceId, $methodName)
{
// check if instance of this method even exist
if ( ! isset(self::$returnValues[$className][$instanceId][$methodName])) {
return false;
}
return true;
} | php | protected static function _isMethodStubbed($className, $instanceId, $methodName)
{
// check if instance of this method even exist
if ( ! isset(self::$returnValues[$className][$instanceId][$methodName])) {
return false;
}
return true;
} | [
"protected",
"static",
"function",
"_isMethodStubbed",
"(",
"$",
"className",
",",
"$",
"instanceId",
",",
"$",
"methodName",
")",
"{",
"// check if instance of this method even exist",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"returnValues",
"[",
"$",
"... | Checking if a method with specific arguments has been stubbed
@param $className
@param $instanceId
@param $methodName
@return bool | [
"Checking",
"if",
"a",
"method",
"with",
"specific",
"arguments",
"has",
"been",
"stubbed"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/ShortifyPunit.php#L229-L237 |
16,833 | danrevah/shortify-punit | src/ShortifyPunit.php | ShortifyPunit._createChainResponse | protected static function _createChainResponse(
$mockClassInstanceId,
$mockClassType,
$chainedMethodsBefore,
$currentMethod,
$args
) {
$currentMethodName = key($currentMethod);
$rReturnValues = &self::getMockHierarchyResponse(
$chainedMethodsBefor... | php | protected static function _createChainResponse(
$mockClassInstanceId,
$mockClassType,
$chainedMethodsBefore,
$currentMethod,
$args
) {
$currentMethodName = key($currentMethod);
$rReturnValues = &self::getMockHierarchyResponse(
$chainedMethodsBefor... | [
"protected",
"static",
"function",
"_createChainResponse",
"(",
"$",
"mockClassInstanceId",
",",
"$",
"mockClassType",
",",
"$",
"chainedMethodsBefore",
",",
"$",
"currentMethod",
",",
"$",
"args",
")",
"{",
"$",
"currentMethodName",
"=",
"key",
"(",
"$",
"curre... | Setting up a chained mock response, function is called from mocked classes
@param $mockClassInstanceId
@param $mockClassType
@param $chainedMethodsBefore
@param $currentMethod
@param $args
@return null | [
"Setting",
"up",
"a",
"chained",
"mock",
"response",
"function",
"is",
"called",
"from",
"mocked",
"classes"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/ShortifyPunit.php#L249-L283 |
16,834 | danrevah/shortify-punit | src/ShortifyPunit.php | ShortifyPunit._setWhenMockResponse | protected static function _setWhenMockResponse(
$className,
$instanceId,
$methodName,
$args,
$action,
$returns
) {
$args = serialize($args);
$returnValues = array();
$returnValues[$className][$instanceId][$methodName][$args]['response'] = ['ac... | php | protected static function _setWhenMockResponse(
$className,
$instanceId,
$methodName,
$args,
$action,
$returns
) {
$args = serialize($args);
$returnValues = array();
$returnValues[$className][$instanceId][$methodName][$args]['response'] = ['ac... | [
"protected",
"static",
"function",
"_setWhenMockResponse",
"(",
"$",
"className",
",",
"$",
"instanceId",
",",
"$",
"methodName",
",",
"$",
"args",
",",
"$",
"action",
",",
"$",
"returns",
")",
"{",
"$",
"args",
"=",
"serialize",
"(",
"$",
"args",
")",
... | Setting up a mock response, function is called from mocked classes
@param $className
@param $instanceId
@param $methodName
@param $args
@param $action
@param $returns | [
"Setting",
"up",
"a",
"mock",
"response",
"function",
"is",
"called",
"from",
"mocked",
"classes"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/ShortifyPunit.php#L297-L311 |
16,835 | danrevah/shortify-punit | src/ShortifyPunit.php | ShortifyPunit._addChainedResponse | protected static function _addChainedResponse($response)
{
$firstChainedMethodName = key($response);
if (isset(self::$returnValues[$firstChainedMethodName])) {
self::$returnValues[$firstChainedMethodName] = array_replace_recursive(
self::$returnValues[$firstChainedMethod... | php | protected static function _addChainedResponse($response)
{
$firstChainedMethodName = key($response);
if (isset(self::$returnValues[$firstChainedMethodName])) {
self::$returnValues[$firstChainedMethodName] = array_replace_recursive(
self::$returnValues[$firstChainedMethod... | [
"protected",
"static",
"function",
"_addChainedResponse",
"(",
"$",
"response",
")",
"{",
"$",
"firstChainedMethodName",
"=",
"key",
"(",
"$",
"response",
")",
";",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"returnValues",
"[",
"$",
"firstChainedMethodName",... | Adding chained response to ReturnValues array
@param $response | [
"Adding",
"chained",
"response",
"to",
"ReturnValues",
"array"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/ShortifyPunit.php#L358-L370 |
16,836 | danrevah/shortify-punit | src/ShortifyPunit.php | ShortifyPunit.& | private static function &getMockHierarchyResponse(
$chainedMethodsBefore,
$mockClassType,
$mockClassInstanceId
) {
$rReturnValues = &self::$returnValues[$mockClassType][$mockClassInstanceId];
// Check return values chain
foreach ($chainedMethodsBefore as $chainedMetho... | php | private static function &getMockHierarchyResponse(
$chainedMethodsBefore,
$mockClassType,
$mockClassInstanceId
) {
$rReturnValues = &self::$returnValues[$mockClassType][$mockClassInstanceId];
// Check return values chain
foreach ($chainedMethodsBefore as $chainedMetho... | [
"private",
"static",
"function",
"&",
"getMockHierarchyResponse",
"(",
"$",
"chainedMethodsBefore",
",",
"$",
"mockClassType",
",",
"$",
"mockClassInstanceId",
")",
"{",
"$",
"rReturnValues",
"=",
"&",
"self",
"::",
"$",
"returnValues",
"[",
"$",
"mockClassType",
... | Returns the mock hierarchy response values
@param $chainedMethodsBefore
@param $mockClassType
@param $mockClassInstanceId
@return mixed | [
"Returns",
"the",
"mock",
"hierarchy",
"response",
"values"
] | cedd08f31de8e7409a07d2630701ef4e924cc5f0 | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/ShortifyPunit.php#L398-L414 |
16,837 | necrox87/yii2-nudity-detector | NudityDetector.php | NudityDetector.quantifyYCbCr | public function quantifyYCbCr() {
// Init some vars
$inc = $this->iteratorIncrement;
$width = $this->width();
$height = $this->height();
list($Cb1, $Cb2, $Cr1, $Cr2) = $this->boundsCbCr;
$white = $this->excludeWhite;
$black = $this->excludeBlack;
$total =... | php | public function quantifyYCbCr() {
// Init some vars
$inc = $this->iteratorIncrement;
$width = $this->width();
$height = $this->height();
list($Cb1, $Cb2, $Cr1, $Cr2) = $this->boundsCbCr;
$white = $this->excludeWhite;
$black = $this->excludeBlack;
$total =... | [
"public",
"function",
"quantifyYCbCr",
"(",
")",
"{",
"// Init some vars",
"$",
"inc",
"=",
"$",
"this",
"->",
"iteratorIncrement",
";",
"$",
"width",
"=",
"$",
"this",
"->",
"width",
"(",
")",
";",
"$",
"height",
"=",
"$",
"this",
"->",
"height",
"(",... | Quantify flesh color amount using YCbCr color model
@return float | [
"Quantify",
"flesh",
"color",
"amount",
"using",
"YCbCr",
"color",
"model"
] | 59474b1480f5ed53a17f06551318d30c3765d143 | https://github.com/necrox87/yii2-nudity-detector/blob/59474b1480f5ed53a17f06551318d30c3765d143/NudityDetector.php#L57-L87 |
16,838 | necrox87/yii2-nudity-detector | NudityDetector.php | NudityDetector.isPorn | public function isPorn($threshold = FALSE) {
return $threshold === FALSE
? $this->quantifyYCbCr() >= $this->threshold
: $this->quantifyYCbCr() >= $threshold;
} | php | public function isPorn($threshold = FALSE) {
return $threshold === FALSE
? $this->quantifyYCbCr() >= $this->threshold
: $this->quantifyYCbCr() >= $threshold;
} | [
"public",
"function",
"isPorn",
"(",
"$",
"threshold",
"=",
"FALSE",
")",
"{",
"return",
"$",
"threshold",
"===",
"FALSE",
"?",
"$",
"this",
"->",
"quantifyYCbCr",
"(",
")",
">=",
"$",
"this",
"->",
"threshold",
":",
"$",
"this",
"->",
"quantifyYCbCr",
... | Check if image is of pornographic content
@param float $threshold | [
"Check",
"if",
"image",
"is",
"of",
"pornographic",
"content"
] | 59474b1480f5ed53a17f06551318d30c3765d143 | https://github.com/necrox87/yii2-nudity-detector/blob/59474b1480f5ed53a17f06551318d30c3765d143/NudityDetector.php#L94-L98 |
16,839 | nyeholt/silverstripe-external-content | code/model/ExternalContentItem.php | ExternalContentItem.Link | function Link($action = null) {
$cur = Controller::curr();
if ($cur instanceof ExternalContentPage_Controller) {
return $cur->data()->LinkFor($this, 'view');
}
return ExternalContentPage_Controller::URL_STUB . '/view/' . $this->ID;
} | php | function Link($action = null) {
$cur = Controller::curr();
if ($cur instanceof ExternalContentPage_Controller) {
return $cur->data()->LinkFor($this, 'view');
}
return ExternalContentPage_Controller::URL_STUB . '/view/' . $this->ID;
} | [
"function",
"Link",
"(",
"$",
"action",
"=",
"null",
")",
"{",
"$",
"cur",
"=",
"Controller",
"::",
"curr",
"(",
")",
";",
"if",
"(",
"$",
"cur",
"instanceof",
"ExternalContentPage_Controller",
")",
"{",
"return",
"$",
"cur",
"->",
"data",
"(",
")",
... | Return a URL that simply links back to the externalcontentadmin
class' 'view' action
@param $action
@return String | [
"Return",
"a",
"URL",
"that",
"simply",
"links",
"back",
"to",
"the",
"externalcontentadmin",
"class",
"view",
"action"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/model/ExternalContentItem.php#L141-L147 |
16,840 | nyeholt/silverstripe-external-content | code/model/ExternalContentItem.php | ExternalContentItem.DownloadLink | public function DownloadLink() {
// get the base URL, prepend with the external content
// controller /download action and add this object's id
$cur = Controller::curr();
if ($cur instanceof ExternalContentPage_Controller) {
return $cur->data()->LinkFor($this, 'download');
}
return ExternalContentPage_Co... | php | public function DownloadLink() {
// get the base URL, prepend with the external content
// controller /download action and add this object's id
$cur = Controller::curr();
if ($cur instanceof ExternalContentPage_Controller) {
return $cur->data()->LinkFor($this, 'download');
}
return ExternalContentPage_Co... | [
"public",
"function",
"DownloadLink",
"(",
")",
"{",
"// get the base URL, prepend with the external content",
"// controller /download action and add this object's id",
"$",
"cur",
"=",
"Controller",
"::",
"curr",
"(",
")",
";",
"if",
"(",
"$",
"cur",
"instanceof",
"Exte... | Where this can be downloaded from
@return string | [
"Where",
"this",
"can",
"be",
"downloaded",
"from"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/model/ExternalContentItem.php#L169-L177 |
16,841 | nyeholt/silverstripe-external-content | code/model/ExternalContentItem.php | ExternalContentItem.stageChildren | public function stageChildren($showAll = false) {
if ($this->Title != 'Content Root' && $this->source) {
$children = new ArrayList();
$item = new ExternalContentItem($this->source, $this->Title . '1');
$item->Title = $this->Title . '1';
$item->MenuTitle = $item->Title;
$children->push($item);
retur... | php | public function stageChildren($showAll = false) {
if ($this->Title != 'Content Root' && $this->source) {
$children = new ArrayList();
$item = new ExternalContentItem($this->source, $this->Title . '1');
$item->Title = $this->Title . '1';
$item->MenuTitle = $item->Title;
$children->push($item);
retur... | [
"public",
"function",
"stageChildren",
"(",
"$",
"showAll",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Title",
"!=",
"'Content Root'",
"&&",
"$",
"this",
"->",
"source",
")",
"{",
"$",
"children",
"=",
"new",
"ArrayList",
"(",
")",
";",
"... | Overridden to load all children from a remote content
source instead of this node directly
@param boolean $showAll
@return ArrayList | [
"Overridden",
"to",
"load",
"all",
"children",
"from",
"a",
"remote",
"content",
"source",
"instead",
"of",
"this",
"node",
"directly"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/model/ExternalContentItem.php#L230-L240 |
16,842 | nyeholt/silverstripe-external-content | code/model/ExternalContentItem.php | ExternalContentItem.Children | public function Children() {
if (!$this->children) {
$this->children = new ArrayList();
$kids = $this->stageChildren();
if ($kids) {
foreach ($kids as $child) {
if ($child->canView()) {
$this->children->push($child);
}
}
}
}
return $this->children;
} | php | public function Children() {
if (!$this->children) {
$this->children = new ArrayList();
$kids = $this->stageChildren();
if ($kids) {
foreach ($kids as $child) {
if ($child->canView()) {
$this->children->push($child);
}
}
}
}
return $this->children;
} | [
"public",
"function",
"Children",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"children",
")",
"{",
"$",
"this",
"->",
"children",
"=",
"new",
"ArrayList",
"(",
")",
";",
"$",
"kids",
"=",
"$",
"this",
"->",
"stageChildren",
"(",
")",
";",
... | Handle a children call by retrieving from stageChildren | [
"Handle",
"a",
"children",
"call",
"by",
"retrieving",
"from",
"stageChildren"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/model/ExternalContentItem.php#L245-L258 |
16,843 | nyeholt/silverstripe-external-content | code/model/ExternalContentItem.php | ExternalContentItem.getCMSFields | public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->removeByName('ParentID');
if (count($this->remoteProperties)) {
$mapping = $this->editableFieldMapping();
foreach ($this->remoteProperties as $name => $value) {
$field = null;
if (isset($mapping[$name])) {
$field = $ma... | php | public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->removeByName('ParentID');
if (count($this->remoteProperties)) {
$mapping = $this->editableFieldMapping();
foreach ($this->remoteProperties as $name => $value) {
$field = null;
if (isset($mapping[$name])) {
$field = $ma... | [
"public",
"function",
"getCMSFields",
"(",
")",
"{",
"$",
"fields",
"=",
"parent",
"::",
"getCMSFields",
"(",
")",
";",
"$",
"fields",
"->",
"removeByName",
"(",
"'ParentID'",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"remoteProperties",
")",... | For now just show a field that says this can't be edited
@see sapphire/core/model/DataObject#getCMSFields($params) | [
"For",
"now",
"just",
"show",
"a",
"field",
"that",
"says",
"this",
"can",
"t",
"be",
"edited"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/model/ExternalContentItem.php#L265-L303 |
16,844 | Double-Opt-in/php-client-api | src/Config/ConfigFactory.php | ConfigFactory.fromArray | public static function fromArray(array $data)
{
if ( ! array_key_exists('client_id', $data))
throw new ClientConfigurationException('Configuration file has no client_id set');
if ( ! array_key_exists('client_secret', $data))
throw new ClientConfigurationException('Configuration file has no client_secret set'... | php | public static function fromArray(array $data)
{
if ( ! array_key_exists('client_id', $data))
throw new ClientConfigurationException('Configuration file has no client_id set');
if ( ! array_key_exists('client_secret', $data))
throw new ClientConfigurationException('Configuration file has no client_secret set'... | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'client_id'",
",",
"$",
"data",
")",
")",
"throw",
"new",
"ClientConfigurationException",
"(",
"'Configuration file has no client_id set'",
... | creates a configuration from array
array(
'api' => '', // optional
'client_id' => '...',
'client_secret' => '...',
'site_token' => '',
'cache_file' => '..',
)
@param array $data
@return ClientConfig
@throws ClientConfigurationException | [
"creates",
"a",
"configuration",
"from",
"array"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Config/ConfigFactory.php#L30-L53 |
16,845 | Double-Opt-in/php-client-api | src/Config/ConfigFactory.php | ConfigFactory.fromFile | public static function fromFile($filename)
{
$filename = realpath($filename);
if ($filename === false)
throw new ClientConfigurationException('Configuration file ' . $filename . ' does not exists');
return static::fromArray(include $filename);
} | php | public static function fromFile($filename)
{
$filename = realpath($filename);
if ($filename === false)
throw new ClientConfigurationException('Configuration file ' . $filename . ' does not exists');
return static::fromArray(include $filename);
} | [
"public",
"static",
"function",
"fromFile",
"(",
"$",
"filename",
")",
"{",
"$",
"filename",
"=",
"realpath",
"(",
"$",
"filename",
")",
";",
"if",
"(",
"$",
"filename",
"===",
"false",
")",
"throw",
"new",
"ClientConfigurationException",
"(",
"'Configuratio... | creates a configuration from a php file returning an array
@param string $filename
@return ClientConfig
@throws ClientConfigurationException | [
"creates",
"a",
"configuration",
"from",
"a",
"php",
"file",
"returning",
"an",
"array"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Config/ConfigFactory.php#L63-L70 |
16,846 | aedart/laravel-helpers | src/Traits/Database/SchemaTrait.php | SchemaTrait.getDefaultSchema | public function getDefaultSchema(): ?Builder
{
// By default, the schema facade depends upon a
// database connection being available. Therefore,
// we need to ensure that this is true, before
// attempting to return the facade-root
$manager = DB::getFacadeRoot();
if ... | php | public function getDefaultSchema(): ?Builder
{
// By default, the schema facade depends upon a
// database connection being available. Therefore,
// we need to ensure that this is true, before
// attempting to return the facade-root
$manager = DB::getFacadeRoot();
if ... | [
"public",
"function",
"getDefaultSchema",
"(",
")",
":",
"?",
"Builder",
"{",
"// By default, the schema facade depends upon a",
"// database connection being available. Therefore,",
"// we need to ensure that this is true, before",
"// attempting to return the facade-root",
"$",
"manage... | Get a default schema value, if any is available
@return Builder|null A default schema value or Null if no default value is available | [
"Get",
"a",
"default",
"schema",
"value",
"if",
"any",
"is",
"available"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Database/SchemaTrait.php#L77-L88 |
16,847 | phrest/sdk | src/Request/RequestOptions.php | RequestOptions.addGetParam | public function addGetParam($param, $value = true)
{
// Validate
if (!is_scalar($param))
{
throw new \Exception("Param name must be scalar");
}
// Filter
if (is_string($value))
{
$value = trim($value);
}
// Set
$this->queryParams[trim($param)] = $value;
retur... | php | public function addGetParam($param, $value = true)
{
// Validate
if (!is_scalar($param))
{
throw new \Exception("Param name must be scalar");
}
// Filter
if (is_string($value))
{
$value = trim($value);
}
// Set
$this->queryParams[trim($param)] = $value;
retur... | [
"public",
"function",
"addGetParam",
"(",
"$",
"param",
",",
"$",
"value",
"=",
"true",
")",
"{",
"// Validate",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"param",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Param name must be scalar\"",
")",
... | Add a GET parameter
@param $param
@param mixed $value
@return $this
@throws \Exception | [
"Add",
"a",
"GET",
"parameter"
] | e9f2812ad517b07ca4d284512b530f615305eb47 | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Request/RequestOptions.php#L70-L88 |
16,848 | phrest/sdk | src/Request/RequestOptions.php | RequestOptions.addPostParam | public function addPostParam($param, $value = true)
{
// Validate
if (!is_scalar($param))
{
throw new \Exception("Param name must be scalar");
}
// Filter
if (is_string($value))
{
$value = trim($value);
}
// Set
$this->postParams[trim($param)] = $value;
retur... | php | public function addPostParam($param, $value = true)
{
// Validate
if (!is_scalar($param))
{
throw new \Exception("Param name must be scalar");
}
// Filter
if (is_string($value))
{
$value = trim($value);
}
// Set
$this->postParams[trim($param)] = $value;
retur... | [
"public",
"function",
"addPostParam",
"(",
"$",
"param",
",",
"$",
"value",
"=",
"true",
")",
"{",
"// Validate",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"param",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Param name must be scalar\"",
")",
... | Add a POST parameter
@param $param
@param bool $value
@return $this
@throws \Exception | [
"Add",
"a",
"POST",
"parameter"
] | e9f2812ad517b07ca4d284512b530f615305eb47 | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Request/RequestOptions.php#L99-L117 |
16,849 | phrest/sdk | src/Request/RequestOptions.php | RequestOptions.setSearchTerm | public function setSearchTerm($searchTerm)
{
if (!is_scalar($searchTerm))
{
throw new \Exception("Search term must be a string");
}
$this->searchTerm = trim($searchTerm);
return $this;
} | php | public function setSearchTerm($searchTerm)
{
if (!is_scalar($searchTerm))
{
throw new \Exception("Search term must be a string");
}
$this->searchTerm = trim($searchTerm);
return $this;
} | [
"public",
"function",
"setSearchTerm",
"(",
"$",
"searchTerm",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"searchTerm",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Search term must be a string\"",
")",
";",
"}",
"$",
"this",
"->",
"sear... | Set a search term for the request
@param $searchTerm
@return $this
@throws \Exception | [
"Set",
"a",
"search",
"term",
"for",
"the",
"request"
] | e9f2812ad517b07ca4d284512b530f615305eb47 | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Request/RequestOptions.php#L137-L147 |
16,850 | phrest/sdk | src/Request/RequestOptions.php | RequestOptions.getGetParams | public function getGetParams()
{
if (isset($this->searchTerm))
{
$this->queryParams['q'] = $this->searchTerm;
}
return $this->queryParams;
} | php | public function getGetParams()
{
if (isset($this->searchTerm))
{
$this->queryParams['q'] = $this->searchTerm;
}
return $this->queryParams;
} | [
"public",
"function",
"getGetParams",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"searchTerm",
")",
")",
"{",
"$",
"this",
"->",
"queryParams",
"[",
"'q'",
"]",
"=",
"$",
"this",
"->",
"searchTerm",
";",
"}",
"return",
"$",
"this",
... | Get the request GET params
@return array | [
"Get",
"the",
"request",
"GET",
"params"
] | e9f2812ad517b07ca4d284512b530f615305eb47 | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Request/RequestOptions.php#L166-L174 |
16,851 | phrest/sdk | src/Request/RequestOptions.php | RequestOptions.toArray | public function toArray()
{
$params = [];
if (isset($this->searchTerm))
{
$params['q'] = $this->searchTerm;
}
if (isset($this->parameters))
{
foreach ($this->parameters as $paramKey => $paramVal)
{
$params[$paramKey] = $paramVal;
}
}
return $params;
... | php | public function toArray()
{
$params = [];
if (isset($this->searchTerm))
{
$params['q'] = $this->searchTerm;
}
if (isset($this->parameters))
{
foreach ($this->parameters as $paramKey => $paramVal)
{
$params[$paramKey] = $paramVal;
}
}
return $params;
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"searchTerm",
")",
")",
"{",
"$",
"params",
"[",
"'q'",
"]",
"=",
"$",
"this",
"->",
"searchTerm",
";",
"}",
"if",
"(... | This should no longer be needed
todo remove
@return array
@deprecated | [
"This",
"should",
"no",
"longer",
"be",
"needed",
"todo",
"remove"
] | e9f2812ad517b07ca4d284512b530f615305eb47 | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Request/RequestOptions.php#L193-L211 |
16,852 | mgallegos/decima-file | src/Mgallegos/DecimaFile/File/Repositories/File/EloquentFile.php | EloquentFile.bySystemReferenceTypeBySystemReferenceIdAndByOrganization | public function bySystemReferenceTypeBySystemReferenceIdAndByOrganization($systemReferenceType , $systemReferenceId, $organizationId, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->File->setCo... | php | public function bySystemReferenceTypeBySystemReferenceIdAndByOrganization($systemReferenceType , $systemReferenceId, $organizationId, $databaseConnectionName = null)
{
if(empty($databaseConnectionName))
{
$databaseConnectionName = $this->databaseConnectionName;
}
return $this->File->setCo... | [
"public",
"function",
"bySystemReferenceTypeBySystemReferenceIdAndByOrganization",
"(",
"$",
"systemReferenceType",
",",
"$",
"systemReferenceId",
",",
"$",
"organizationId",
",",
"$",
"databaseConnectionName",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"dat... | Retrieve files by system reference type and system reference id
@param int $id parent id
@return Illuminate\Database\Eloquent\Collection | [
"Retrieve",
"files",
"by",
"system",
"reference",
"type",
"and",
"system",
"reference",
"id"
] | 94c26ab40f5c4dd12e913e73376c24db27588f0b | https://github.com/mgallegos/decima-file/blob/94c26ab40f5c4dd12e913e73376c24db27588f0b/src/Mgallegos/DecimaFile/File/Repositories/File/EloquentFile.php#L236-L248 |
16,853 | webforge-labs/psc-cms | lib/Psc/UI/Component/JavaScriptBase.php | JavaScriptBase.widgetSelector | protected function widgetSelector(\Psc\HTML\Tag $tag = NULL, $subSelector = NULL) {
$jQuery = \Psc\JS\jQuery::getClassSelector($tag ?: $this->html);
if (isset($subSelector)) {
$jQuery .= sprintf(".find(%s)", \Psc\JS\Helper::convertString($subSelector));
}
return $this->jsExpr($jQuery);
... | php | protected function widgetSelector(\Psc\HTML\Tag $tag = NULL, $subSelector = NULL) {
$jQuery = \Psc\JS\jQuery::getClassSelector($tag ?: $this->html);
if (isset($subSelector)) {
$jQuery .= sprintf(".find(%s)", \Psc\JS\Helper::convertString($subSelector));
}
return $this->jsExpr($jQuery);
... | [
"protected",
"function",
"widgetSelector",
"(",
"\\",
"Psc",
"\\",
"HTML",
"\\",
"Tag",
"$",
"tag",
"=",
"NULL",
",",
"$",
"subSelector",
"=",
"NULL",
")",
"{",
"$",
"jQuery",
"=",
"\\",
"Psc",
"\\",
"JS",
"\\",
"jQuery",
"::",
"getClassSelector",
"(",... | denn das hier hat nix mit joose zu tun | [
"denn",
"das",
"hier",
"hat",
"nix",
"mit",
"joose",
"zu",
"tun"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/UI/Component/JavaScriptBase.php#L34-L42 |
16,854 | steeffeen/FancyManiaLinks | FML/Script/ScriptLabel.php | ScriptLabel.getEventLabels | public static function getEventLabels()
{
return array(self::ENTRYSUBMIT, self::KEYPRESS, self::MOUSECLICK, self::MOUSEOUT, self::MOUSEOVER);
} | php | public static function getEventLabels()
{
return array(self::ENTRYSUBMIT, self::KEYPRESS, self::MOUSECLICK, self::MOUSEOUT, self::MOUSEOVER);
} | [
"public",
"static",
"function",
"getEventLabels",
"(",
")",
"{",
"return",
"array",
"(",
"self",
"::",
"ENTRYSUBMIT",
",",
"self",
"::",
"KEYPRESS",
",",
"self",
"::",
"MOUSECLICK",
",",
"self",
"::",
"MOUSEOUT",
",",
"self",
"::",
"MOUSEOVER",
")",
";",
... | Get the possible event label names
@return string[] | [
"Get",
"the",
"possible",
"event",
"label",
"names"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/ScriptLabel.php#L188-L191 |
16,855 | aedart/laravel-helpers | src/Traits/Database/DBManagerTrait.php | DBManagerTrait.getDbManager | public function getDbManager(): ?DatabaseManager
{
if (!$this->hasDbManager()) {
$this->setDbManager($this->getDefaultDbManager());
}
return $this->dbManager;
} | php | public function getDbManager(): ?DatabaseManager
{
if (!$this->hasDbManager()) {
$this->setDbManager($this->getDefaultDbManager());
}
return $this->dbManager;
} | [
"public",
"function",
"getDbManager",
"(",
")",
":",
"?",
"DatabaseManager",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasDbManager",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setDbManager",
"(",
"$",
"this",
"->",
"getDefaultDbManager",
"(",
")",
")",
";... | Get db manager
If no db manager has been set, this method will
set and return a default db manager, if any such
value is available
@see getDefaultDbManager()
@return DatabaseManager|null db manager or null if none db manager has been set | [
"Get",
"db",
"manager"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Database/DBManagerTrait.php#L53-L59 |
16,856 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.initApiLogs | public function initApiLogs($overrideExisting = true)
{
if (null !== $this->collApiLogs && !$overrideExisting) {
return;
}
$this->collApiLogs = new PropelObjectCollection();
$this->collApiLogs->setModel('ApiLog');
} | php | public function initApiLogs($overrideExisting = true)
{
if (null !== $this->collApiLogs && !$overrideExisting) {
return;
}
$this->collApiLogs = new PropelObjectCollection();
$this->collApiLogs->setModel('ApiLog');
} | [
"public",
"function",
"initApiLogs",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collApiLogs",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"collApiLogs",
"=",... | Initializes the collApiLogs collection.
By default this just sets the collApiLogs collection to an empty array (like clearcollApiLogs());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values stored in... | [
"Initializes",
"the",
"collApiLogs",
"collection",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2450-L2457 |
16,857 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.getApiLogs | public function getApiLogs($criteria = null, PropelPDO $con = null)
{
$partial = $this->collApiLogsPartial && !$this->isNew();
if (null === $this->collApiLogs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collApiLogs) {
// return empty collec... | php | public function getApiLogs($criteria = null, PropelPDO $con = null)
{
$partial = $this->collApiLogsPartial && !$this->isNew();
if (null === $this->collApiLogs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collApiLogs) {
// return empty collec... | [
"public",
"function",
"getApiLogs",
"(",
"$",
"criteria",
"=",
"null",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collApiLogsPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
")",
";",
"if",
"(",... | Gets an array of ApiLog objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $criteria, the ca... | [
"Gets",
"an",
"array",
"of",
"ApiLog",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2473-L2516 |
16,858 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.countApiLogs | public function countApiLogs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collApiLogsPartial && !$this->isNew();
if (null === $this->collApiLogs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collApiLogs) {
... | php | public function countApiLogs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collApiLogsPartial && !$this->isNew();
if (null === $this->collApiLogs || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collApiLogs) {
... | [
"public",
"function",
"countApiLogs",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collApiLogsPartial",
"&&",
"!",
"$",
... | Returns the number of related ApiLog objects.
@param Criteria $criteria
@param boolean $distinct
@param PropelPDO $con
@return int Count of related ApiLog objects.
@throws PropelException | [
"Returns",
"the",
"number",
"of",
"related",
"ApiLog",
"objects",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2559-L2581 |
16,859 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.addApiLog | public function addApiLog(ApiLog $l)
{
if ($this->collApiLogs === null) {
$this->initApiLogs();
$this->collApiLogsPartial = true;
}
if (!in_array($l, $this->collApiLogs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
... | php | public function addApiLog(ApiLog $l)
{
if ($this->collApiLogs === null) {
$this->initApiLogs();
$this->collApiLogsPartial = true;
}
if (!in_array($l, $this->collApiLogs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
... | [
"public",
"function",
"addApiLog",
"(",
"ApiLog",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collApiLogs",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initApiLogs",
"(",
")",
";",
"$",
"this",
"->",
"collApiLogsPartial",
"=",
"true",
";",
"}... | Method called to associate a ApiLog object to this object
through the ApiLog foreign key attribute.
@param ApiLog $l ApiLog
@return RemoteApp The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ApiLog",
"object",
"to",
"this",
"object",
"through",
"the",
"ApiLog",
"foreign",
"key",
"attribute",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2590-L2606 |
16,860 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.initRemoteHistoryContaos | public function initRemoteHistoryContaos($overrideExisting = true)
{
if (null !== $this->collRemoteHistoryContaos && !$overrideExisting) {
return;
}
$this->collRemoteHistoryContaos = new PropelObjectCollection();
$this->collRemoteHistoryContaos->setModel('RemoteHistoryCon... | php | public function initRemoteHistoryContaos($overrideExisting = true)
{
if (null !== $this->collRemoteHistoryContaos && !$overrideExisting) {
return;
}
$this->collRemoteHistoryContaos = new PropelObjectCollection();
$this->collRemoteHistoryContaos->setModel('RemoteHistoryCon... | [
"public",
"function",
"initRemoteHistoryContaos",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collRemoteHistoryContaos",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->... | Initializes the collRemoteHistoryContaos collection.
By default this just sets the collRemoteHistoryContaos collection to an empty array (like clearcollRemoteHistoryContaos());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting th... | [
"Initializes",
"the",
"collRemoteHistoryContaos",
"collection",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2675-L2682 |
16,861 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.getRemoteHistoryContaos | public function getRemoteHistoryContaos($criteria = null, PropelPDO $con = null)
{
$partial = $this->collRemoteHistoryContaosPartial && !$this->isNew();
if (null === $this->collRemoteHistoryContaos || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collRemoteHist... | php | public function getRemoteHistoryContaos($criteria = null, PropelPDO $con = null)
{
$partial = $this->collRemoteHistoryContaosPartial && !$this->isNew();
if (null === $this->collRemoteHistoryContaos || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collRemoteHist... | [
"public",
"function",
"getRemoteHistoryContaos",
"(",
"$",
"criteria",
"=",
"null",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collRemoteHistoryContaosPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
... | Gets an array of RemoteHistoryContao objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $cri... | [
"Gets",
"an",
"array",
"of",
"RemoteHistoryContao",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2698-L2741 |
16,862 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.countRemoteHistoryContaos | public function countRemoteHistoryContaos(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collRemoteHistoryContaosPartial && !$this->isNew();
if (null === $this->collRemoteHistoryContaos || null !== $criteria || $partial) {
if ($this->isNew() && n... | php | public function countRemoteHistoryContaos(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
$partial = $this->collRemoteHistoryContaosPartial && !$this->isNew();
if (null === $this->collRemoteHistoryContaos || null !== $criteria || $partial) {
if ($this->isNew() && n... | [
"public",
"function",
"countRemoteHistoryContaos",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collRemoteHistoryContaosPartial"... | Returns the number of related RemoteHistoryContao objects.
@param Criteria $criteria
@param boolean $distinct
@param PropelPDO $con
@return int Count of related RemoteHistoryContao objects.
@throws PropelException | [
"Returns",
"the",
"number",
"of",
"related",
"RemoteHistoryContao",
"objects",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2784-L2806 |
16,863 | slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php | BaseRemoteApp.addRemoteHistoryContao | public function addRemoteHistoryContao(RemoteHistoryContao $l)
{
if ($this->collRemoteHistoryContaos === null) {
$this->initRemoteHistoryContaos();
$this->collRemoteHistoryContaosPartial = true;
}
if (!in_array($l, $this->collRemoteHistoryContaos->getArrayCopy(), tru... | php | public function addRemoteHistoryContao(RemoteHistoryContao $l)
{
if ($this->collRemoteHistoryContaos === null) {
$this->initRemoteHistoryContaos();
$this->collRemoteHistoryContaosPartial = true;
}
if (!in_array($l, $this->collRemoteHistoryContaos->getArrayCopy(), tru... | [
"public",
"function",
"addRemoteHistoryContao",
"(",
"RemoteHistoryContao",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collRemoteHistoryContaos",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initRemoteHistoryContaos",
"(",
")",
";",
"$",
"this",
"->",
... | Method called to associate a RemoteHistoryContao object to this object
through the RemoteHistoryContao foreign key attribute.
@param RemoteHistoryContao $l RemoteHistoryContao
@return RemoteApp The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"RemoteHistoryContao",
"object",
"to",
"this",
"object",
"through",
"the",
"RemoteHistoryContao",
"foreign",
"key",
"attribute",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteApp.php#L2815-L2831 |
16,864 | drsdre/yii2-xmlsoccer | commands/XmlSoccerController.php | XmlSoccerController.actionImportLeagues | public function actionImportLeagues()
{
$client = new Client([
'apiKey' => $this->apiKey
]);
$leagues = $client->getAllLeagues();
$count = 0;
foreach ($leagues as $league) {
$dbLeague = Yii::createObject([
'class' => $this->leagueClass... | php | public function actionImportLeagues()
{
$client = new Client([
'apiKey' => $this->apiKey
]);
$leagues = $client->getAllLeagues();
$count = 0;
foreach ($leagues as $league) {
$dbLeague = Yii::createObject([
'class' => $this->leagueClass... | [
"public",
"function",
"actionImportLeagues",
"(",
")",
"{",
"$",
"client",
"=",
"new",
"Client",
"(",
"[",
"'apiKey'",
"=>",
"$",
"this",
"->",
"apiKey",
"]",
")",
";",
"$",
"leagues",
"=",
"$",
"client",
"->",
"getAllLeagues",
"(",
")",
";",
"$",
"c... | Import all leagues from XMLSoccer interface
@return integer Exit code
@throws \yii\base\InvalidConfigException | [
"Import",
"all",
"leagues",
"from",
"XMLSoccer",
"interface"
] | a746edee6269ed0791bac6c6165a946adc30d994 | https://github.com/drsdre/yii2-xmlsoccer/blob/a746edee6269ed0791bac6c6165a946adc30d994/commands/XmlSoccerController.php#L82-L138 |
16,865 | drsdre/yii2-xmlsoccer | commands/XmlSoccerController.php | XmlSoccerController.actionShowLeagues | public function actionShowLeagues()
{
$leagues = call_user_func([$this->leagueClass, 'find']);
/* @var $leagues \yii\db\ActiveQuery */
if (!$leagues->count('id')) {
$this->stdout("No leagues found. Import by ");
$this->stdout("{$this->id}/import-leagues", Console::BO... | php | public function actionShowLeagues()
{
$leagues = call_user_func([$this->leagueClass, 'find']);
/* @var $leagues \yii\db\ActiveQuery */
if (!$leagues->count('id')) {
$this->stdout("No leagues found. Import by ");
$this->stdout("{$this->id}/import-leagues", Console::BO... | [
"public",
"function",
"actionShowLeagues",
"(",
")",
"{",
"$",
"leagues",
"=",
"call_user_func",
"(",
"[",
"$",
"this",
"->",
"leagueClass",
",",
"'find'",
"]",
")",
";",
"/* @var $leagues \\yii\\db\\ActiveQuery */",
"if",
"(",
"!",
"$",
"leagues",
"->",
"coun... | Show all leagues
@return integer Exit code
@throws \Exception | [
"Show",
"all",
"leagues"
] | a746edee6269ed0791bac6c6165a946adc30d994 | https://github.com/drsdre/yii2-xmlsoccer/blob/a746edee6269ed0791bac6c6165a946adc30d994/commands/XmlSoccerController.php#L146-L177 |
16,866 | lode/fem | src/resources.php | resources.get_timestamped_url | private static function get_timestamped_url($file, $type) {
$search = ['{{root_dir}}', '{{type}}'];
$replace = [self::$root_dir, $type];
$base_path = str_replace($search, $replace, self::$base_path);
$base_url = str_replace($search, $replace, self::$base_url);
$file = trim($file);
$absolute = ($file[0] ... | php | private static function get_timestamped_url($file, $type) {
$search = ['{{root_dir}}', '{{type}}'];
$replace = [self::$root_dir, $type];
$base_path = str_replace($search, $replace, self::$base_path);
$base_url = str_replace($search, $replace, self::$base_url);
$file = trim($file);
$absolute = ($file[0] ... | [
"private",
"static",
"function",
"get_timestamped_url",
"(",
"$",
"file",
",",
"$",
"type",
")",
"{",
"$",
"search",
"=",
"[",
"'{{root_dir}}'",
",",
"'{{type}}'",
"]",
";",
"$",
"replace",
"=",
"[",
"self",
"::",
"$",
"root_dir",
",",
"$",
"type",
"]"... | adds a modification timestamp to a file path
@param string $file relative path from css/ or js/, excluding the extension
or absolute from the docroot when starting with a '/'
absolute is handy for loading css from a js plugin directory
i.e.: 'foo/bar' will become '/frontend/css/foo/bar.1234567890.cs... | [
"adds",
"a",
"modification",
"timestamp",
"to",
"a",
"file",
"path"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/resources.php#L34-L54 |
16,867 | tableau-mkt/eggs-n-cereal | src/Utils/ConverterToHTML.php | ConverterToHTML.toHTML | public function toHTML($pretty_print = TRUE) {
$this->out = new \DOMDocument('1.0', 'UTF-8');
$this->out->formatOutput = $pretty_print;
$field = $this->doc->getElementsByTagName('xlf:group')->item(0);
foreach ($field->childNodes as $child) {
if ($output = $this->convert($child)) {
$this-... | php | public function toHTML($pretty_print = TRUE) {
$this->out = new \DOMDocument('1.0', 'UTF-8');
$this->out->formatOutput = $pretty_print;
$field = $this->doc->getElementsByTagName('xlf:group')->item(0);
foreach ($field->childNodes as $child) {
if ($output = $this->convert($child)) {
$this-... | [
"public",
"function",
"toHTML",
"(",
"$",
"pretty_print",
"=",
"TRUE",
")",
"{",
"$",
"this",
"->",
"out",
"=",
"new",
"\\",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"this",
"->",
"out",
"->",
"formatOutput",
"=",
"$",
"pretty_print"... | Converts XML to the corresponding HTML representation.
@return string
The source XML converted to HTML. | [
"Converts",
"XML",
"to",
"the",
"corresponding",
"HTML",
"representation",
"."
] | 778b83ddae1dd687724a84545ce8afa1a31e4bcf | https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Utils/ConverterToHTML.php#L36-L49 |
16,868 | ClanCats/Core | src/classes/CCDataObject.php | CCDataObject.set | public function set( $key, $value, $param = null )
{
CCArr::set( $key, $value, $this->_data );
} | php | public function set( $key, $value, $param = null )
{
CCArr::set( $key, $value, $this->_data );
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"param",
"=",
"null",
")",
"{",
"CCArr",
"::",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"this",
"->",
"_data",
")",
";",
"}"
] | set data to the object.
@param string $key
@param mixed $value
@param mixed $param
@return void | [
"set",
"data",
"to",
"the",
"object",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCDataObject.php#L43-L46 |
16,869 | Chill-project/Main | Timeline/TimelineBuilder.php | TimelineBuilder.getTimelineHTML | public function getTimelineHTML($context, array $args, $page = 0, $number = 20)
{
$query = $this->buildUnionQuery($context, $args, $page, $number);
$fetched = $this->runQuery($query);
$entitiesByKey = $this->getEntities($fetched, $context);
return $this->render($fetched, $en... | php | public function getTimelineHTML($context, array $args, $page = 0, $number = 20)
{
$query = $this->buildUnionQuery($context, $args, $page, $number);
$fetched = $this->runQuery($query);
$entitiesByKey = $this->getEntities($fetched, $context);
return $this->render($fetched, $en... | [
"public",
"function",
"getTimelineHTML",
"(",
"$",
"context",
",",
"array",
"$",
"args",
",",
"$",
"page",
"=",
"0",
",",
"$",
"number",
"=",
"20",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"buildUnionQuery",
"(",
"$",
"context",
",",
"$",
"a... | return an HTML string with timeline
This function must be called from controller
@example https://redmine.champs-libres.coop/projects/chillperson/repository/revisions/bd2e1b1808f73e39532e9538413025df5487cad0/entry/Controller/TimelinePersonController.php#L47 the implementation in person bundle
@param string $context
... | [
"return",
"an",
"HTML",
"string",
"with",
"timeline"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Timeline/TimelineBuilder.php#L66-L73 |
16,870 | Chill-project/Main | Timeline/TimelineBuilder.php | TimelineBuilder.getProvidersByContext | public function getProvidersByContext($context)
{
$providers = array();
foreach($this->providers[$context] as $providerId) {
$providers[] = $this->container->get($providerId);
}
return $providers;
} | php | public function getProvidersByContext($context)
{
$providers = array();
foreach($this->providers[$context] as $providerId) {
$providers[] = $this->container->get($providerId);
}
return $providers;
} | [
"public",
"function",
"getProvidersByContext",
"(",
"$",
"context",
")",
"{",
"$",
"providers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"providers",
"[",
"$",
"context",
"]",
"as",
"$",
"providerId",
")",
"{",
"$",
"providers",
... | Get providers by context
@param string $context
@return TimelineProviderInterface[] | [
"Get",
"providers",
"by",
"context"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Timeline/TimelineBuilder.php#L94-L103 |
16,871 | Chill-project/Main | Timeline/TimelineBuilder.php | TimelineBuilder.buildUnionQuery | private function buildUnionQuery($context, array $args, $page, $number)
{
//throw an exception if no provider have been defined for this context
if (!array_key_exists($context, $this->providers)) {
throw new \LogicException(sprintf('No builders have been defined for "%s"'
... | php | private function buildUnionQuery($context, array $args, $page, $number)
{
//throw an exception if no provider have been defined for this context
if (!array_key_exists($context, $this->providers)) {
throw new \LogicException(sprintf('No builders have been defined for "%s"'
... | [
"private",
"function",
"buildUnionQuery",
"(",
"$",
"context",
",",
"array",
"$",
"args",
",",
"$",
"page",
",",
"$",
"number",
")",
"{",
"//throw an exception if no provider have been defined for this context",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"context... | build the UNION query with all providers
@uses self::buildSelectQuery to build individual SELECT queries
@param string $context
@param mixed $args
@param int $page
@param int $number
@return string
@throws \LogicException if no builder have been defined for this context | [
"build",
"the",
"UNION",
"query",
"with",
"all",
"providers"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Timeline/TimelineBuilder.php#L117-L137 |
16,872 | Chill-project/Main | Timeline/TimelineBuilder.php | TimelineBuilder.buildSelectQuery | private function buildSelectQuery(TimelineProviderInterface $provider, $context, array $args)
{
$data = $provider->fetchQuery($context, $args);
return sprintf(
'SELECT %s AS id, '
. '%s AS "date", '
. "'%s' AS type "
. 'FROM %s... | php | private function buildSelectQuery(TimelineProviderInterface $provider, $context, array $args)
{
$data = $provider->fetchQuery($context, $args);
return sprintf(
'SELECT %s AS id, '
. '%s AS "date", '
. "'%s' AS type "
. 'FROM %s... | [
"private",
"function",
"buildSelectQuery",
"(",
"TimelineProviderInterface",
"$",
"provider",
",",
"$",
"context",
",",
"array",
"$",
"args",
")",
"{",
"$",
"data",
"=",
"$",
"provider",
"->",
"fetchQuery",
"(",
"$",
"context",
",",
"$",
"args",
")",
";",
... | return the SQL SELECT query as a string,
@uses TimelineProfiderInterface::fetchQuery use the fetchQuery function
@param \Chill\MainBundle\Timeline\TimelineProviderInterface $provider
@param string $context
@param mixed[] $args
@return string | [
"return",
"the",
"SQL",
"SELECT",
"query",
"as",
"a",
"string"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Timeline/TimelineBuilder.php#L148-L163 |
16,873 | Chill-project/Main | Timeline/TimelineBuilder.php | TimelineBuilder.runQuery | private function runQuery($query)
{
$resultSetMapping = (new ResultSetMapping())
->addScalarResult('id', 'id')
->addScalarResult('type', 'type')
->addScalarResult('date', 'date');
return $this->em->createNativeQuery($query, $resultSetMapping)
... | php | private function runQuery($query)
{
$resultSetMapping = (new ResultSetMapping())
->addScalarResult('id', 'id')
->addScalarResult('type', 'type')
->addScalarResult('date', 'date');
return $this->em->createNativeQuery($query, $resultSetMapping)
... | [
"private",
"function",
"runQuery",
"(",
"$",
"query",
")",
"{",
"$",
"resultSetMapping",
"=",
"(",
"new",
"ResultSetMapping",
"(",
")",
")",
"->",
"addScalarResult",
"(",
"'id'",
",",
"'id'",
")",
"->",
"addScalarResult",
"(",
"'type'",
",",
"'type'",
")",... | run the UNION query and return result as an array
@param string $query
@return array | [
"run",
"the",
"UNION",
"query",
"and",
"return",
"result",
"as",
"an",
"array"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Timeline/TimelineBuilder.php#L171-L180 |
16,874 | Chill-project/Main | Timeline/TimelineBuilder.php | TimelineBuilder.render | private function render(array $fetched, array $entitiesByType, $context, array $args)
{
//add results to a pretty array
$timelineEntries = array();
foreach ($fetched as $result) {
$data = $this->getTemplateData(
$result['type'],
$entitiesB... | php | private function render(array $fetched, array $entitiesByType, $context, array $args)
{
//add results to a pretty array
$timelineEntries = array();
foreach ($fetched as $result) {
$data = $this->getTemplateData(
$result['type'],
$entitiesB... | [
"private",
"function",
"render",
"(",
"array",
"$",
"fetched",
",",
"array",
"$",
"entitiesByType",
",",
"$",
"context",
",",
"array",
"$",
"args",
")",
"{",
"//add results to a pretty array",
"$",
"timelineEntries",
"=",
"array",
"(",
")",
";",
"foreach",
"... | render the timeline as HTML
@param array $fetched
@param array $entitiesByType
@param string $context
@param mixed[] $args
@return string the HTML representation of the timeline | [
"render",
"the",
"timeline",
"as",
"HTML"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Timeline/TimelineBuilder.php#L221-L243 |
16,875 | Chill-project/Main | Timeline/TimelineBuilder.php | TimelineBuilder.getTemplateData | private function getTemplateData($type, $entity, $context, array $args)
{
foreach($this->getProvidersByContext($context) as $provider) {
if ($provider->supportsType($type)) {
return $provider->getEntityTemplate($entity, $context, $args);
}
}
} | php | private function getTemplateData($type, $entity, $context, array $args)
{
foreach($this->getProvidersByContext($context) as $provider) {
if ($provider->supportsType($type)) {
return $provider->getEntityTemplate($entity, $context, $args);
}
}
} | [
"private",
"function",
"getTemplateData",
"(",
"$",
"type",
",",
"$",
"entity",
",",
"$",
"context",
",",
"array",
"$",
"args",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getProvidersByContext",
"(",
"$",
"context",
")",
"as",
"$",
"provider",
")",
... | get the template data from the provider for the given entity, by type.
@param string $type
@param mixed $entity
@param string $context
@param mixed[] $args
@return array the template data fetched from the provider | [
"get",
"the",
"template",
"data",
"from",
"the",
"provider",
"for",
"the",
"given",
"entity",
"by",
"type",
"."
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Timeline/TimelineBuilder.php#L254-L261 |
16,876 | 2amigos/yiifoundation | helpers/Panel.php | Panel.panel | public static function panel($content, $htmlOptions = array())
{
ArrayHelper::addValue('class', Enum::PANEL, $htmlOptions);
return \CHtml::tag('div', $htmlOptions, $content);
} | php | public static function panel($content, $htmlOptions = array())
{
ArrayHelper::addValue('class', Enum::PANEL, $htmlOptions);
return \CHtml::tag('div', $htmlOptions, $content);
} | [
"public",
"static",
"function",
"panel",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"Enum",
"::",
"PANEL",
",",
"$",
"htmlOptions",
")",
";",
"return",
"\\",
"CH... | Generates a panel
@param string $content the content to display
@param array $htmlOptions the HTML attributes of the panel
@return string
@see http://foundation.zurb.com/docs/components/panels.html | [
"Generates",
"a",
"panel"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Panel.php#L31-L35 |
16,877 | 2amigos/yiifoundation | helpers/Panel.php | Panel.callout | public static function callout($content, $htmlOptions = array())
{
ArrayHelper::addValue('class', Enum::PANEL_CALLOUT, $htmlOptions);
return static::panel($content, $htmlOptions);
} | php | public static function callout($content, $htmlOptions = array())
{
ArrayHelper::addValue('class', Enum::PANEL_CALLOUT, $htmlOptions);
return static::panel($content, $htmlOptions);
} | [
"public",
"static",
"function",
"callout",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"Enum",
"::",
"PANEL_CALLOUT",
",",
"$",
"htmlOptions",
")",
";",
"return",
"... | Generates a callout panel
@param string $content the content to display
@param array $htmlOptions the HTML attributes of the panel
@return string | [
"Generates",
"a",
"callout",
"panel"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Panel.php#L44-L48 |
16,878 | ClanCats/Core | src/console/doctor.php | doctor.action_security_key | public function action_security_key( $params )
{
$path = \CCPath::config( 'main.config'.EXT );
// Check if the file exists
if ( !file_exists( $path ) )
{
$this->error( 'Could not find main configuration file.' ); return;
}
// Now try to replace the placeholder with
// an new generated key
$da... | php | public function action_security_key( $params )
{
$path = \CCPath::config( 'main.config'.EXT );
// Check if the file exists
if ( !file_exists( $path ) )
{
$this->error( 'Could not find main configuration file.' ); return;
}
// Now try to replace the placeholder with
// an new generated key
$da... | [
"public",
"function",
"action_security_key",
"(",
"$",
"params",
")",
"{",
"$",
"path",
"=",
"\\",
"CCPath",
"::",
"config",
"(",
"'main.config'",
".",
"EXT",
")",
";",
"// Check if the file exists",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")... | Try to generate a security key in the main config file
@param array $params | [
"Try",
"to",
"generate",
"a",
"security",
"key",
"in",
"the",
"main",
"config",
"file"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/doctor.php#L43-L68 |
16,879 | barebone-php/barebone-core | lib/Database.php | Database.instance | public static function instance()
{
if (null === self::$_instance) {
$capsule = new Capsule;
$capsule->addConnection(self::getConfig());
$capsule->setEventDispatcher(new Dispatcher(new Container));
$capsule->setAsGlobal();
self::$_instance = $caps... | php | public static function instance()
{
if (null === self::$_instance) {
$capsule = new Capsule;
$capsule->addConnection(self::getConfig());
$capsule->setEventDispatcher(new Dispatcher(new Container));
$capsule->setAsGlobal();
self::$_instance = $caps... | [
"public",
"static",
"function",
"instance",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"_instance",
")",
"{",
"$",
"capsule",
"=",
"new",
"Capsule",
";",
"$",
"capsule",
"->",
"addConnection",
"(",
"self",
"::",
"getConfig",
"(",
")",
... | Instantiate Eloquent ORM
@return Capsule | [
"Instantiate",
"Eloquent",
"ORM"
] | 7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Database.php#L48-L59 |
16,880 | phpbench/container | lib/Container.php | Container.get | public function get($serviceId)
{
if (isset($this->services[$serviceId])) {
return $this->services[$serviceId];
}
if (!isset($this->instantiators[$serviceId])) {
throw new \InvalidArgumentException(sprintf(
'No instantiator has been registered for req... | php | public function get($serviceId)
{
if (isset($this->services[$serviceId])) {
return $this->services[$serviceId];
}
if (!isset($this->instantiators[$serviceId])) {
throw new \InvalidArgumentException(sprintf(
'No instantiator has been registered for req... | [
"public",
"function",
"get",
"(",
"$",
"serviceId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"services",
"[",
"$",
"serviceId",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"services",
"[",
"$",
"serviceId",
"]",
";",
"}",
"if",
... | Instantiate and return the service with the given ID.
Note that this method will return the same instance on subsequent calls.
@param string $serviceId
@return mixed | [
"Instantiate",
"and",
"return",
"the",
"service",
"with",
"the",
"given",
"ID",
".",
"Note",
"that",
"this",
"method",
"will",
"return",
"the",
"same",
"instance",
"on",
"subsequent",
"calls",
"."
] | 7acabddac1fd09cb58d4790443b6b791bf9f3095 | https://github.com/phpbench/container/blob/7acabddac1fd09cb58d4790443b6b791bf9f3095/lib/Container.php#L105-L121 |
16,881 | phpbench/container | lib/Container.php | Container.getServiceIdsForTag | public function getServiceIdsForTag($tag)
{
$serviceIds = [];
foreach ($this->tags as $serviceId => $tags) {
if (isset($tags[$tag])) {
$serviceIds[$serviceId] = $tags[$tag];
}
}
return $serviceIds;
} | php | public function getServiceIdsForTag($tag)
{
$serviceIds = [];
foreach ($this->tags as $serviceId => $tags) {
if (isset($tags[$tag])) {
$serviceIds[$serviceId] = $tags[$tag];
}
}
return $serviceIds;
} | [
"public",
"function",
"getServiceIdsForTag",
"(",
"$",
"tag",
")",
"{",
"$",
"serviceIds",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"tags",
"as",
"$",
"serviceId",
"=>",
"$",
"tags",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"tags",
"["... | Return services IDs for the given tag.
@param string $tag
@return string[][] | [
"Return",
"services",
"IDs",
"for",
"the",
"given",
"tag",
"."
] | 7acabddac1fd09cb58d4790443b6b791bf9f3095 | https://github.com/phpbench/container/blob/7acabddac1fd09cb58d4790443b6b791bf9f3095/lib/Container.php#L146-L156 |
16,882 | phpbench/container | lib/Container.php | Container.register | public function register($serviceId, \Closure $instantiator, array $tags = [])
{
if (isset($this->instantiators[$serviceId])) {
throw new \InvalidArgumentException(sprintf(
'Service with ID "%s" has already been registered', $serviceId));
}
$this->instantiators[$... | php | public function register($serviceId, \Closure $instantiator, array $tags = [])
{
if (isset($this->instantiators[$serviceId])) {
throw new \InvalidArgumentException(sprintf(
'Service with ID "%s" has already been registered', $serviceId));
}
$this->instantiators[$... | [
"public",
"function",
"register",
"(",
"$",
"serviceId",
",",
"\\",
"Closure",
"$",
"instantiator",
",",
"array",
"$",
"tags",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"instantiators",
"[",
"$",
"serviceId",
"]",
")",
")",... | Register a service with the given ID and instantiator.
The instantiator is a closure which accepts an instance of this container and
returns a new instance of the service class.
@param string $serviceId
@param \Closure $instantiator
@param string[][] $tags | [
"Register",
"a",
"service",
"with",
"the",
"given",
"ID",
"and",
"instantiator",
"."
] | 7acabddac1fd09cb58d4790443b6b791bf9f3095 | https://github.com/phpbench/container/blob/7acabddac1fd09cb58d4790443b6b791bf9f3095/lib/Container.php#L168-L177 |
16,883 | phpbench/container | lib/Container.php | Container.getParameter | public function getParameter($name)
{
if (!array_key_exists($name, $this->config)) {
throw new \InvalidArgumentException(sprintf(
'Parameter "%s" has not been registered',
$name
));
}
return $this->config[$name];
} | php | public function getParameter($name)
{
if (!array_key_exists($name, $this->config)) {
throw new \InvalidArgumentException(sprintf(
'Parameter "%s" has not been registered',
$name
));
}
return $this->config[$name];
} | [
"public",
"function",
"getParameter",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"config",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Parameter \"%s... | Return the parameter with the given name.
@param string $name
@throws \InvalidArgumentException
@return mixed | [
"Return",
"the",
"parameter",
"with",
"the",
"given",
"name",
"."
] | 7acabddac1fd09cb58d4790443b6b791bf9f3095 | https://github.com/phpbench/container/blob/7acabddac1fd09cb58d4790443b6b791bf9f3095/lib/Container.php#L216-L226 |
16,884 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.escape_table | public function escape_table( &$query )
{
$table = $query->table;
if ( is_array( $table ) )
{
reset($table); $table = key($table).' as '.$table[key($table)];
}
return $this->escape( $table );
} | php | public function escape_table( &$query )
{
$table = $query->table;
if ( is_array( $table ) )
{
reset($table); $table = key($table).' as '.$table[key($table)];
}
return $this->escape( $table );
} | [
"public",
"function",
"escape_table",
"(",
"&",
"$",
"query",
")",
"{",
"$",
"table",
"=",
"$",
"query",
"->",
"table",
";",
"if",
"(",
"is_array",
"(",
"$",
"table",
")",
")",
"{",
"reset",
"(",
"$",
"table",
")",
";",
"$",
"table",
"=",
"key",
... | Escape the table
@param Query $query
@return string | [
"Escape",
"the",
"table"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L145-L155 |
16,885 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.parameterize | public function parameterize( $params )
{
foreach( $params as $key => $param )
{
$params[$key] = $this->param( $param );
}
return implode( ', ', $params );
} | php | public function parameterize( $params )
{
foreach( $params as $key => $param )
{
$params[$key] = $this->param( $param );
}
return implode( ', ', $params );
} | [
"public",
"function",
"parameterize",
"(",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"param",
")",
"{",
"$",
"params",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"param",
"(",
"$",
"param",
")",
";",
... | Convert data to parameters and bind them to the query
@param array $params
@return string | [
"Convert",
"data",
"to",
"parameters",
"and",
"bind",
"them",
"to",
"the",
"query"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L163-L171 |
16,886 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.compile_insert | public function compile_insert( &$query )
{
$build = ( $query->ignore ? 'insert ignore' : 'insert' ).' into '.$this->escape_table( $query ).' ';
$value_collection = $query->values;
// Get the array keys from the first array in the collection.
// We use them as insert keys.
$build .= '('.$this->escape_list(... | php | public function compile_insert( &$query )
{
$build = ( $query->ignore ? 'insert ignore' : 'insert' ).' into '.$this->escape_table( $query ).' ';
$value_collection = $query->values;
// Get the array keys from the first array in the collection.
// We use them as insert keys.
$build .= '('.$this->escape_list(... | [
"public",
"function",
"compile_insert",
"(",
"&",
"$",
"query",
")",
"{",
"$",
"build",
"=",
"(",
"$",
"query",
"->",
"ignore",
"?",
"'insert ignore'",
":",
"'insert'",
")",
".",
"' into '",
".",
"$",
"this",
"->",
"escape_table",
"(",
"$",
"query",
")... | Build an insert query
@param Query $query
@return string | [
"Build",
"an",
"insert",
"query"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L179-L197 |
16,887 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.compile_update | public function compile_update( &$query )
{
$build = 'update '.$this->escape_table( $query ).' set ';
// add the array values.
foreach( $query->values as $key => $value )
{
$build .= $this->escape( $key ).' = '.$this->param( $value ).', ';
}
$build = substr( $build, 0, -2 );
$build .= $this->compile... | php | public function compile_update( &$query )
{
$build = 'update '.$this->escape_table( $query ).' set ';
// add the array values.
foreach( $query->values as $key => $value )
{
$build .= $this->escape( $key ).' = '.$this->param( $value ).', ';
}
$build = substr( $build, 0, -2 );
$build .= $this->compile... | [
"public",
"function",
"compile_update",
"(",
"&",
"$",
"query",
")",
"{",
"$",
"build",
"=",
"'update '",
".",
"$",
"this",
"->",
"escape_table",
"(",
"$",
"query",
")",
".",
"' set '",
";",
"// add the array values.",
"foreach",
"(",
"$",
"query",
"->",
... | Build an update query
@param Query $query
@return string | [
"Build",
"an",
"update",
"query"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L205-L221 |
16,888 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.compile_delete | public function compile_delete( &$query )
{
$build = 'delete from '.$this->escape_table( $query );
$build .= $this->compile_where( $query );
$build .= $this->compile_limit( $query );
// cut the last comma away
return $build;
} | php | public function compile_delete( &$query )
{
$build = 'delete from '.$this->escape_table( $query );
$build .= $this->compile_where( $query );
$build .= $this->compile_limit( $query );
// cut the last comma away
return $build;
} | [
"public",
"function",
"compile_delete",
"(",
"&",
"$",
"query",
")",
"{",
"$",
"build",
"=",
"'delete from '",
".",
"$",
"this",
"->",
"escape_table",
"(",
"$",
"query",
")",
";",
"$",
"build",
".=",
"$",
"this",
"->",
"compile_where",
"(",
"$",
"query... | Build an delete query
@param Query $query
@return string | [
"Build",
"an",
"delete",
"query"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L229-L238 |
16,889 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.compile_select | public function compile_select( &$query )
{
$build = ( $query->distinct ? 'select distinct' : 'select' ).' ';
if ( !empty( $query->fields ) )
{
foreach( $query->fields as $key => $field )
{
if ( !is_numeric( $key ) )
{
$build .= $this->escape( $key ).' as '.$this->escape( $field );
}
... | php | public function compile_select( &$query )
{
$build = ( $query->distinct ? 'select distinct' : 'select' ).' ';
if ( !empty( $query->fields ) )
{
foreach( $query->fields as $key => $field )
{
if ( !is_numeric( $key ) )
{
$build .= $this->escape( $key ).' as '.$this->escape( $field );
}
... | [
"public",
"function",
"compile_select",
"(",
"&",
"$",
"query",
")",
"{",
"$",
"build",
"=",
"(",
"$",
"query",
"->",
"distinct",
"?",
"'select distinct'",
":",
"'select'",
")",
".",
"' '",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"query",
"->",
"fiel... | Build a select
@param Query $query
@return string | [
"Build",
"a",
"select"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L246-L286 |
16,890 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.compile_where | public function compile_where( &$query )
{
$build = '';
foreach( $query->wheres as $where )
{
// to make nested wheres possible you can pass an closure
// wich will create a new query where you can add your nested wheres
if ( !isset( $where[2] ) && is_closure( $where[1] ) )
{
$sub_query = new ... | php | public function compile_where( &$query )
{
$build = '';
foreach( $query->wheres as $where )
{
// to make nested wheres possible you can pass an closure
// wich will create a new query where you can add your nested wheres
if ( !isset( $where[2] ) && is_closure( $where[1] ) )
{
$sub_query = new ... | [
"public",
"function",
"compile_where",
"(",
"&",
"$",
"query",
")",
"{",
"$",
"build",
"=",
"''",
";",
"foreach",
"(",
"$",
"query",
"->",
"wheres",
"as",
"$",
"where",
")",
"{",
"// to make nested wheres possible you can pass an closure ",
"// wich will create a ... | Build the where part
@param Query $query
@return string | [
"Build",
"the",
"where",
"part"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L294-L333 |
16,891 | ClanCats/Core | src/bundles/Database/Builder.php | Builder.compile_limit_with_offset | public function compile_limit_with_offset( &$query )
{
if ( is_null( $query->limit ) )
{
return "";
}
return ' limit '.( (int) $query->offset ).', '.( (int) $query->limit );
} | php | public function compile_limit_with_offset( &$query )
{
if ( is_null( $query->limit ) )
{
return "";
}
return ' limit '.( (int) $query->offset ).', '.( (int) $query->limit );
} | [
"public",
"function",
"compile_limit_with_offset",
"(",
"&",
"$",
"query",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"query",
"->",
"limit",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"' limit '",
".",
"(",
"(",
"int",
")",
"$",
"query",
"-... | Build the limit and offset part
@param Query $query
@return string | [
"Build",
"the",
"limit",
"and",
"offset",
"part"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Builder.php#L341-L349 |
16,892 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.newUserModel | protected function newUserModel($username, $password, array $options = [])
{
$user = new User();
$user->username = $username;
$user->password = $password;
foreach ($options as $key => $value) {
$user->{$key} = $value;
}
return $user;
} | php | protected function newUserModel($username, $password, array $options = [])
{
$user = new User();
$user->username = $username;
$user->password = $password;
foreach ($options as $key => $value) {
$user->{$key} = $value;
}
return $user;
} | [
"protected",
"function",
"newUserModel",
"(",
"$",
"username",
",",
"$",
"password",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"user",
"=",
"new",
"User",
"(",
")",
";",
"$",
"user",
"->",
"username",
"=",
"$",
"username",
";",
"$... | Create new user model instance
@param string $username
@param string $password
@param array $options
@return \ViKon\Auth\Model\User | [
"Create",
"new",
"user",
"model",
"instance"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L28-L39 |
16,893 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.createUserModel | protected function createUserModel($username, $password, array $options = [])
{
$user = $this->newUserModel($username, $password, $options);
$user->save();
return $user;
} | php | protected function createUserModel($username, $password, array $options = [])
{
$user = $this->newUserModel($username, $password, $options);
$user->save();
return $user;
} | [
"protected",
"function",
"createUserModel",
"(",
"$",
"username",
",",
"$",
"password",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"newUserModel",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
... | Create and store in database new user model instance
@param string $username
@param string $password
@param array $options
@return \ViKon\Auth\Model\User | [
"Create",
"and",
"store",
"in",
"database",
"new",
"user",
"model",
"instance"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L50-L56 |
16,894 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.createUserRecord | protected function createUserRecord($username, $password, array $options = [])
{
return [
// Username
User::FIELD_USERNAME => $username,
// Password
User::FIELD_PASSWORD => bcrypt($password),
// Email
User::FIELD_EMAIL => array_key_e... | php | protected function createUserRecord($username, $password, array $options = [])
{
return [
// Username
User::FIELD_USERNAME => $username,
// Password
User::FIELD_PASSWORD => bcrypt($password),
// Email
User::FIELD_EMAIL => array_key_e... | [
"protected",
"function",
"createUserRecord",
"(",
"$",
"username",
",",
"$",
"password",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"[",
"// Username",
"User",
"::",
"FIELD_USERNAME",
"=>",
"$",
"username",
",",
"// Password",
"User",
... | Create single user record
@param string $username authentication username
@param string $password authentication password
@param array $options additional column values
@return array array with user field values | [
"Create",
"single",
"user",
"record"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L67-L95 |
16,895 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.newGroupModel | protected function newGroupModel($token, array $options = [])
{
$group = new Group();
$group->token = $token;
foreach ($options as $key => $value) {
$group->{$key} = $value;
}
return $group;
} | php | protected function newGroupModel($token, array $options = [])
{
$group = new Group();
$group->token = $token;
foreach ($options as $key => $value) {
$group->{$key} = $value;
}
return $group;
} | [
"protected",
"function",
"newGroupModel",
"(",
"$",
"token",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"group",
"=",
"new",
"Group",
"(",
")",
";",
"$",
"group",
"->",
"token",
"=",
"$",
"token",
";",
"foreach",
"(",
"$",
"options... | Create new group model instance
@param string $token group token
@param array $options additional column valuesF
@return \ViKon\Auth\Model\Group | [
"Create",
"new",
"group",
"model",
"instance"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L105-L115 |
16,896 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.createGroupModel | protected function createGroupModel($token, array $options = [])
{
$group = $this->newGroupModel($token, $options);
$group->save();
return $group;
} | php | protected function createGroupModel($token, array $options = [])
{
$group = $this->newGroupModel($token, $options);
$group->save();
return $group;
} | [
"protected",
"function",
"createGroupModel",
"(",
"$",
"token",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"newGroupModel",
"(",
"$",
"token",
",",
"$",
"options",
")",
";",
"$",
"group",
"->",
"save"... | Create and store in database new group model instance
@param string $token group token
@param array $options additional column values
@return \ViKon\Auth\Model\Group | [
"Create",
"and",
"store",
"in",
"database",
"new",
"group",
"model",
"instance"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L125-L131 |
16,897 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.newRoleModel | protected function newRoleModel($token, array $options = [])
{
$role = new Role();
$role->token = $token;
foreach ($options as $key => $value) {
$role->{$key} = $value;
}
return $role;
} | php | protected function newRoleModel($token, array $options = [])
{
$role = new Role();
$role->token = $token;
foreach ($options as $key => $value) {
$role->{$key} = $value;
}
return $role;
} | [
"protected",
"function",
"newRoleModel",
"(",
"$",
"token",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"role",
"=",
"new",
"Role",
"(",
")",
";",
"$",
"role",
"->",
"token",
"=",
"$",
"token",
";",
"foreach",
"(",
"$",
"options",
... | Create new role model instance
@param string $token role token
@param array $options additional column valuesF
@return \ViKon\Auth\Model\Role | [
"Create",
"new",
"role",
"model",
"instance"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L141-L151 |
16,898 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.createRoleModel | protected function createRoleModel($token, array $options = [])
{
$role = $this->newRoleModel($token, $options);
$role->save();
return $role;
} | php | protected function createRoleModel($token, array $options = [])
{
$role = $this->newRoleModel($token, $options);
$role->save();
return $role;
} | [
"protected",
"function",
"createRoleModel",
"(",
"$",
"token",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"role",
"=",
"$",
"this",
"->",
"newRoleModel",
"(",
"$",
"token",
",",
"$",
"options",
")",
";",
"$",
"role",
"->",
"save",
... | Create and store in database new role model instance
@param string $token role token
@param array $options additional column values
@return \ViKon\Auth\Model\Role | [
"Create",
"and",
"store",
"in",
"database",
"new",
"role",
"model",
"instance"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L161-L167 |
16,899 | vi-kon/laravel-auth | src/ViKon/Auth/AuthSeederTrait.php | AuthSeederTrait.newPermissionModel | protected function newPermissionModel($token, array $options = [])
{
$permission = new Permission();
$permission->token = $token;
foreach ($options as $key => $value) {
$permission->{$key} = $value;
}
return $permission;
} | php | protected function newPermissionModel($token, array $options = [])
{
$permission = new Permission();
$permission->token = $token;
foreach ($options as $key => $value) {
$permission->{$key} = $value;
}
return $permission;
} | [
"protected",
"function",
"newPermissionModel",
"(",
"$",
"token",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"permission",
"=",
"new",
"Permission",
"(",
")",
";",
"$",
"permission",
"->",
"token",
"=",
"$",
"token",
";",
"foreach",
"(... | Create new permission model instance
@param string $token
@param array $options
@return \ViKon\Auth\Model\Permission | [
"Create",
"new",
"permission",
"model",
"instance"
] | 501c20128f43347a2ca271a53435297f9ef7f567 | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/AuthSeederTrait.php#L177-L187 |
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.