query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Gets the MIME Type of the given image. The file must be exists.
private static function getMimeTypeOfImage($image) { static $mimes; if ($mimes === null) { $mimes = [ 'cod' => 'image/cis-cod', 'ras' => 'image/cmu-raster', 'fif' => 'image/fif', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'mcf' => 'image/vasa', 'wbmp' => 'image/vnd.wap.wbmp', 'fh4' => 'image/x-freehand', 'fh5' => 'image/x-freehand', 'fhc' => 'image/x-freehand', 'ico' => 'image/x-icon', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'wxd' => 'image/x-windowdump', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', ]; } $ext = pathinfo($image, PATHINFO_EXTENSION); $type = isset($mimes[$ext]) ? $mimes[$ext] : 'application/octet-stream'; // RFC 2046 states in section 4.5.1: The "octet-stream" subtype is used to indicate that a body contains arbitrary binary data. return $type; }
[ "function getImageMimeType($image) {\n\t\t$finfo = finfo_open(FILEINFO_MIME_TYPE);\n\t\treturn finfo_file($finfo, $image);\n\t}", "function get_mime_type($file) {\n\t\t$image_info = getimagesize($file);\n\t\treturn $image_info[\"mime\"];\n\t}", "function GetFileTypeFromFile($image)\n\t{\n\t\t// if there is no image defined, set the error and return false\n\t\tif(empty($image)) {\n\t\t\t$this->Error = 'No logo image path has been specified';\n\t\t\treturn false;\n\t\t}\n\t\t// grabs the extension of the file\n\t\t$type = strtolower(substr(strrchr($image, \".\"), 1));\n\n\t\tif($type == 'png' || $type == 'jpg' || $type == 'gif') {\n\t\t\t// supported types only\n\t\t\treturn $type;\n\t\t}elseif($type == 'jpeg') {\n\t\t\t// if the extension is jpeg, we want our type value to be 'jpg'\n\t\t\treturn 'jpg';\n\t\t} else {\n\t\t\t// nfi what this file is, lets not try and use it\n\t\t\treturn 'unknown';\n\t\t}\n\t}", "public function get_mime_type() {\r\n\t\treturn image_type_to_mime_type($this->type); \t\r\n\t}", "private function get_mimetype()\n\t{\n\t\tif (!isset($this->filename)) throw new Exception(\"filename is not set\", E_NOFILENAME);\n\t\tif (!file_exists($this->filename)) throw new Exception(\"$this->filename does not exist\", E_NOFILE);\n\n\t\tif ($use_finfo) {\n\t\t\t$type = $finfo->file($this->filename,FILEINFO_MIME+FILEINFO_SYMLINKS);\n\t\t} else {\n\t\t\t$cmd = \"file -b -I \".escapeshellcmd($fn).\" 2>/dev/null\";\n\t\t\t$type = rtrim(`$cmd`);\n\t\t}\n\t\treturn $type;\n\t}", "public function getImageType()\n\t{\n\t\tswitch ($this->content_type) {\n\t\t\tcase 'image/jpg':\n\t\t\tcase 'image/jpeg':\n\t\t\t\treturn 'jpeg';\n\t\t\tcase 'image/gif':\n\t\t\t\treturn 'gif';\n\t\t\tcase 'image/png':\n\t\t\t\treturn 'png';\n\t\t}\n\n\t\treturn null;\n\t}", "protected function getMimeType()\n {\n if ($this->fileType === IMG_WEBP) {\n return \"image/webp\";\n }\n\n return image_type_to_mime_type($this->fileType);\n }", "protected function mime()\n {\n return image_type_to_mime_type($this->type()) ?: 'application/octet-stream';\n }", "function image_type_to_mime_type ($imagetype) {}", "public function getMimeType()\n {\n switch ( $this->options->imageFormat )\n {\n case IMG_PNG:\n return 'image/png';\n case IMG_JPEG:\n return 'image/jpeg';\n }\n }", "public function getMimeType()\n {\n // return mime type ala mimetype extension\n $finfo = finfo_open(FILEINFO_MIME);\n\n $mime = finfo_file($finfo, $this->getFullPath());\n\n return $mime;\n }", "public function getMimeType()\n {\n // return mime type ala mimetype extension\n $finfo = finfo_open(FILEINFO_MIME);\n $mime = finfo_file($finfo, $this->getFullPath());\n\n return $mime;\n }", "public function getImageType()\n\t{\n\t\tif(isset($this->imagetype) && !empty($this->imagetype))\n\t\t{\n\t\t\treturn $this->imagetype;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getMimetype()\n {\n return $this->filesystem->getMimetype($this->path);\n }", "function getMimeType($file)\n {\n if(function_exists(finfo_open)) //tests finfo installation\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension\n return finfo_file($finfo,$this->pathTo.$file);\n }\n else //use the old function\n {\n return mime_content_type($this->pathTo.$file);\n }\n }", "public function getImageType()\n {\n return $this->image_type;\n }", "public function getFileType()\n {\n if (!$this->mime || $this->mime === 'directory' || $this->mime === 'dir') {\n return 'dir';\n }\n\n foreach ($this->mimes as $mime => $mime_values) {\n $key = collect($mime_values)->search(function ($mime_value) {\n return preg_match($mime_value, $this->mime);\n });\n\n if ($key !== false) {\n return $mime;\n }\n }\n\n return 'file';\n }", "public function getImageTypeMimeType($type='')\n\t{\n\t\t# We are expecting an integer.\n\t\t$type=(int)$type;\n\t\t# Check if the passed image_type ($type) is empty or not numeric.\n\t\tif(empty($type) || !is_numeric($type))\n\t\t{\n\t\t\t# Check if we have an IMAGE_TYPE already set to a Data Member.\n\t\t\tif($this->getImageType()!==FALSE)\n\t\t\t{\n\n\t\t\t\t$type=$this->getImageType();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttrigger_error('Invalid IMAGETYPE_XXX constant.', E_USER_NOTICE);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\t# If we are using PHP earlier than 5.3...\n\t\tif(!function_exists('image_type_to_mime_type'))\n\t\t{\n\t\t\t$m=array(1 => 'image/gif', 'image/jpeg', 'image/png', 'application/x-shockwave-flash', 'image/psd', 'image/bmp', 'image/tiff', 'image/tiff', 'application/octet-stream', 'image/jp2', 'application/octet-stream', 'application/octet-stream', 'application/x-shockwave-flash', 'image/iff', 'image/vnd.wap.wbmp', 'image/xbm');\n\t\t\tif(!isset($m[$type]))\n\t\t\t{\n\t\t\t\ttrigger_error('That IMAGETYPE cannot be found.', E_USER_NOTICE);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\t$mime=$m[$type];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mime=image_type_to_mime_type($type);\n\t\t}\n\t\treturn $mime;\n\t}", "function get_mime_type ($filename) {\n $path = pathinfo($filename);\n\n switch ($path['extension']) {\n case 'css':\n return 'text/css';\n case 'js':\n return 'text/javascript';\n default:\n return 'text/plain';\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the session underlying driver handler for the session driver.
public function getSessionDriver() { return $this->container->make('session')->driver( $this->config->get('cart.storage.session.driver') ); }
[ "public function getHandler(): \\SessionHandlerInterface\n {\n return $this->handler;\n }", "public static function getSessionHandler() {\n\t\tif(self::$sessionHandler === NULL) {\n\t\t\tself::createSessionHandler();\n\t\t}\n\n\t\treturn self::$sessionHandler;\n\t}", "public function getHandler(): ISessionHandler\n {\n return $this->handler;\n }", "protected function getDriver()\n {\n return $this->app['config']['session.driver'];\n }", "protected function createSessionDriver()\n {\n return $this->buildSession(new SessionHandler());\n }", "public static function driver()\n\t{\n\t\tif (is_null(static::$driver))\n\t\t{\n\t\t\tstatic::$driver = Session\\Factory::make(Config::get('session.driver'));\n\t\t}\n\n\t\treturn static::$driver;\n\t}", "public function getSessionSaveHandler()\n {\n return self::$_sessionSaveHandler;\n }", "public static function driver()\n\t{\n\t\tif (is_null(static::$driver))\n\t\t{\n\t\t\tswitch (Config::get('session.driver'))\n\t\t\t{\n\t\t\t\tcase 'cookie':\n\t\t\t\t\treturn static::$driver = new Session\\Cookie;\n\n\t\t\t\tcase 'file':\n\t\t\t\t\treturn static::$driver = new Session\\File;\n\n\t\t\t\tcase 'db':\n\t\t\t\t\treturn static::$driver = new Session\\DB;\n\n\t\t\t\tcase 'memcached':\n\t\t\t\t\treturn static::$driver = new Session\\Memcached;\n\n\t\t\t\tcase 'apc':\n\t\t\t\t\treturn static::$driver = new Session\\APC;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new \\Exception(\"Session driver [$driver] is not supported.\");\n\t\t\t}\n\t\t}\n\n\t\treturn static::$driver;\n\t}", "public function driver() :? SessionDriverInterface\n {\n return $this->driver;\n }", "protected function createSessionHandler(): SessionHandlerInterface {\n return new SessionHandler();\n }", "protected function getSession_HandlerService()\n {\n return $this->services['session.handler'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler($this->get(\"database_manager\")->getConnection()->getPdo(), array('db_table' => 'session'));\n }", "protected function getSession_HandlerService()\n {\n return $this->services['session.handler'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler(($this->targetDirs[2].'/../var/sessions/dev'));\n }", "public function getSaveHandler()\n {\n return parent::getSaveHandler();\n /*\n // experimental: doctrine session handler\n $entityManager = $this->getBootstrap()->bootstrap('doctrine')->getResource('doctrine');\n\n require_once 'Xzend/Session/SaveHandler/Doctrine.php';\n $this->_saveHandler = new Xzend_Session_SaveHandler_Doctrine($this->_saveHandler);\n $this->_saveHandler->setEntityManager($entityManager);\n return $this->_saveHandler;\n */\n }", "protected function getSession_HandlerService()\n {\n return $this->services['session.handler'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler('/Users/pete.robinson/Sites/wam/image/tests/SupportFiles/app/../../../tmp/cache/sessions');\n }", "public function getSessionHandler() {\n return null;\n\t\tif ( sizeof( $this->json['session'] ) > 1 ) {\n\t\t\tthrow new AppConfigException( sprintf( 'More than one session handler defined (%d)', sizeof( $this->json['session']) ) );\n\t\t}\n\t\tif ( $this->json['session'] ) {\n\t\t\t$class = (string)$this->json['session']['class'];\n\t\t\t$session = array( 'class' => $class );\n\t\t\tforeach( $this->json['session']->property as $prop ) {\n\t\t\t\t$name = (string)$prop['name'];\n\t\t\t\t$value = (string)$prop['value'];\n\t\t\t\t$session['props'][$name] = $value;\n\t\t\t}\n\t\t\treturn $session;\n\t\t} else {\n\t\t}\n\t}", "public function getSessionAdapter() {\r\n if (!isset($this->_settings['session-adapter'])) {\r\n return null;\r\n }\r\n return (string) $this->_settings['session-adapter'];\r\n }", "protected function createNativeDriver()\n {\n $lifetime = $this->config->get('session.lifetime');\n\n return $this->buildSession(new FileSessionHandler(\n $this->container->make('files'), $this->config->get('session.files'), $lifetime\n ));\n }", "public function driver()\n {\n return $this->container()->driver();\n }", "public function getDriver()\n {\n if (!$this->driverIsReady()) {\n $this->createDriver();\n }\n return $this->driver;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Complete the 'diagonalDifference' function below. The function is expected to return an INTEGER. The function accepts 2D_INTEGER_ARRAY arr as parameter.
function diagonalDifference($arr) { // Write your code here $esquerda = 0; $direita = 0; $conta_total = count($arr) -1; foreach($arr as $i => $ival){ foreach($ival as $j => $jval){ if($j == $i){ $esquerda = $esquerda + $jval; } if($j == $conta_total){ $direita = $direita + $jval; } } $conta_total--; } return abs($esquerda - $direita); }
[ "function diagonalDifference($arr)\n{\n $arr_length = count($arr);\n $primary_diagonal = 0;\n $secondary_diagonal = 0;\n $last_index = $arr_length - 1;\n if ($arr_length) {\n for ($i = 0; $i < $arr_length; $i++) {\n $primary_diagonal += $arr[$i][$i];\n $secondary_diagonal += $arr[$i][$last_index--];\n }\n }\n return abs($primary_diagonal-$secondary_diagonal);\n}", "function diagonalDifference($arr) {\n $digo = sizeof($arr);\n $pd_sum = 0;\n $sd_sum = 0;\n $i = 0;\n for($j=0; $j<$digo; $j++){\n $pd_sum += $arr[$i++][$j];\n $sd_sum += $arr[$digo - $i][$j];\n }\n\n return abs($pd_sum - $sd_sum);\n}", "function diagonal_difference( $arr ) {\r\n\r\n $sum = 0;\r\n for( $i=0; $i<count($arr); $i++ ){\r\n if( is_Array($arr[$i]) ){\r\n $sum+=$arr[$i][$i];\r\n $sum-=$arr[$i][count($arr)-$i-1];\r\n }\r\n }\r\n\r\n // returns the absolute\r\n return abs($sum);\r\n}", "public function diagonal_difference() {\n function solution($a) {\n $totalRows = count($a);\n\n $sumLeft = 0;\n $sumRight = 0;\n\n foreach ($a as $row => $items) {\n foreach ($items as $col => $number) {\n if ($row == $col) {\n $sumLeft += $a[$row][$col];\n }\n if ($row == $totalRows - $col - 1) {\n $sumRight += $a[$row][$col];\n }\n }\n }\n\n return abs($sumLeft - $sumRight);\n }\n\n $a = [\n [1,2,3,4],\n [5,6,7,8],\n [9,10,11,12],\n [13,14,15,16]\n ];\n\n// $a = [\n// [11,2,4],\n// [4,5,6],\n// [10,8,-12],\n// ];\n\n $sum = solution($a);\n\n dd($sum);\n }", "function diagonalDifference($arr) {\n // Write your code here\n $tam=count($arr);\n $dp=0;\n $ds=0;\n for ($i=0; $i < $tam; $i++) { \n $dp+=$arr[$i][$i];\n $ds+=$arr[$i][($tam-1)-$i];\n \n }\n\n}", "function array_diag_sum($array=[]){\n $total = 0;\n\n for($line=0; $line<count($array) ; $line++){\n for($column=0; $column<count($array) ; $column++){\n $total=($line==$column) ? $total+$array[$line][$column] : $total ;\n }\n }\n \n return $total;\t\n}", "public function getDiagonalElements(): array\n {\n $diagonal = [];\n for ($i = 0; $i < \\min($this->m, $this->n); $i++) {\n $diagonal[] = $this->A[$i][$i];\n }\n\n return $diagonal;\n }", "public function win_diagonal(): int{\n if (($this->board_[0][0] == $this->board_[1][1]) && ($this->board_[1][1] == $this->board_[2][2]) && $this->board_[0][0] > 0){\n return $this->board_[0][0];\n }\n\n if (($this->board_[2][0] == $this->board_[1][1]) && ($this->board_[1][1] == $this->board_[0][2]) && $this->board_[2][0] > 0){\n return $this->board_[2][0];\n }\n return NONE;\n }", "public function determinant() {\n $n = $this->rows;\n $determinant = $this->parity; // Start with +1 for an even # of row swaps, -1 for an odd #\n \n // The determinant is simply the product of the diagonal elements, with sign given\n // by the number of row permutations (-1 for odd, +1 for even)\n for($i = 0; $i < $n; ++$i) {\n $determinant *= $this->get($i, $i);\n }\n return $determinant;\n }", "public static function diagonal(array $elements) : self\n {\n $n = count($elements);\n\n $elements = array_values($elements);\n\n $a = [];\n\n for ($i = 0; $i < $n; ++$i) {\n $rowA = [];\n\n for ($j = 0; $j < $n; ++$j) {\n $rowA[] = $i === $j ? $elements[$i] : 0;\n }\n\n $a[] = $rowA;\n }\n\n return self::quick($a);\n }", "function determinant($matrix){\n\t$dim = count($matrix);\n\tfor($i=0;$i<$dim;$i++){\n\t\tif(count($matrix[$i]) != $dim){\n\t\t\tthrow new Exception(\"The matrix is not square\");\n\t\t}\n\t}\n\t\n\treturn real_determinant($matrix);\n}", "function check_independence($matrix)\n{\n\t$dimension=count($matrix);\n//Sets the augmented matrix equal to 0\n\tfor($row=0;$row<$dimension;$row++)\n\t{\n\t\t$matrix[$row][$dimension]=0;\t\n\t}\n\trref($matrix);\n\t$flag=0;\n\t$diagonal=0;\n//Checks the output to find if it is lin. indepenent\n//Must be =1 allong the diagonal \n\twhile($diagonal<$dimension)\n\t{\t\n\t\tif($matrix[$diagonal][$diagonal]!=1)\n\t\t{$flag=1; break;}\n\t\tfor($row=0;$row<$dimension;$row++)\n\t\t{\n\t\t\tif($row!=$diagonal)\n\t\t\t{\n\t\t\t\tif($matrix[$row][$diagonal]!=0)\n\t\t\t\t{$flag=1; break;}\n\t\t\t}\n\t\t}\t\n\t$diagonal++;\n\t}\n\tif($flag==0)\n\t{return true;}\n\telse \n\t{return false;}\n}", "function SecondaryDiagonal (array $arr, int $matrixSize) : bool {\n $start_i = $matrixSize - 1; $start_j = 0;\n $i = $start_i; $j = $start_j;\n\n while ($start_j < $matrixSize-2){\n $prev = $arr[$i][$j]; //[3][0]\n $curr = $arr[$i-1][$j+1]; //[2][1]\n $next = $arr[$i-2][$j+2]; //[1][2]\n\n if ($prev == $curr && $prev == $next){\n return true;\n }else{\n $i--; $j++;\n }\n if ($j + 2 > $matrixSize - 1){\n $start_j++;\n $i = $start_i;\n $j = $start_j;\n }\n }\n\n //Check top\n $start_i = $matrixSize - 2; $start_j = 0; //[3][0]\n $i = $start_i; $j = $start_j;\n\n while ($start_i > 1){\n $prev = $arr[$i][$j]; //[3][0]\n $curr = $arr[$i-1][$j+1]; //[2][1]\n $next = $arr[$i-2][$j+2]; //[1][2]\n\n if ($prev == $curr && $prev == $next){\n return true;\n }else{\n $i--; $j++;\n }\n if ($i - 2 <= 0){\n $start_i--;\n $i = $start_i;\n $j = $start_j;\n }\n }\n return false;\n}", "public static function diagonal(array $elements, int $dtype = self::FLOAT): matrix {\n $n = count($elements);\n $ar = self::factory($n, $n, $dtype);\n for ($i = 0; $i < $n; ++$i) {\n $ar->data[$i * $n + $i] = $elements[$i]; #for ($j = 0; $j < $n; ++$j) {$i === $j ? $elements[$i] : 0;#} \n }\n return $ar;\n }", "static function recursive_array_diff($arr1, $arr2) {\n\t\treturn Arrays::recursive_array_diff($arr1,$arr2);\n\t}", "function symmetric_diff($arr1, $arr2) {\n return array_merge(\n array_diff($arr1, $arr2),\n array_diff($arr2, $arr1)\n );\n}", "public function isDiagonal()\n {\n $int_size = min((array) $this->size);\n\n if($int_size > 0){\n for($i = 0; $i < $int_size; $i++){\n $arr_row = $this->getRow($i);\n\n if($arr_row[$i] != 0){\n unset($arr_row[$i]);\n\n foreach($arr_row as $v){\n if($v != 0){\n return false;\n }\n }\n\n } else {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }", "private function getDiagonalPosition(int $x, int $y): int\n {\n return self::POSITIONS_DIAG[$y][$x];\n }", "public function getDiagonal(): Vector\n {\n $row = new Vector();\n $row->allocate((int) ceil(($this->x + $this->y) / 2));\n $size = max($this->x, $this->y);\n $o = 0;\n while ($o < $size) {\n $row->push($this->get($o, $o));\n $o++;\n }\n return $row;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the default post status for imports Origin default settings trump global settings
public function default_post_status( $origin = null ) { $setting = $setting = tribe_get_option( 'tribe_aggregator_default_post_status', 'publish' ); if ( $origin ) { $origin_setting = tribe_get_option( "tribe_aggregator_default_{$origin}_post_status", $setting ); if ( ! empty( $origin_setting ) ) { $setting = $origin_setting; } } return $setting; }
[ "public function defaultStatus($post_type) {\n\t\treturn true;\n\t}", "function wct_default_talk_status( $default = 'private' ) {\n\t$default_status = get_option( '_wc_talks_submit_status', $default );\n\n\t// Make sure admins will have a publish status whatever the settings choice\n\tif ( 'pending' === $default_status && wct_user_can( 'wct_talks_admin' ) ) {\n\t\t$wct = wct();\n\t\t$current_screen = false;\n\n\t\tif ( function_exists( 'get_current_screen' ) ) {\n\t\t\t$current_screen = get_current_screen();\n\t\t}\n\n\t\t// In administration screens we need to be able to change the status\n\t\tif ( empty( $wct->admin->is_plugin_settings ) && ( empty( $current_screen->post_type ) || wct_get_post_type() !== $current_screen->post_type ) ) {\n\t\t\t$default_status = 'publish';\n\t\t}\n\t}\n\n\t/**\n\t * @param string $default_status\n\t */\n\treturn apply_filters( 'wct_default_talk_status', $default_status );\n}", "public function importStatus()\n\t{\n\t\t$option = get_option('social_curator_import_status');\n\t\tif ( !$option ) return 'pending';\n\t\treturn $option;\n\t}", "private function sfdcGetDefaultStatus(){\n\t\treturn Setting::where('name','campaign_member_status_default')->first()->value;\n\t}", "function DefaultPostOptions(){\r\n\r\n\treturn $GLOBALS['app_config']['post_default_options'];\r\n}", "public static function post_status_enum() {\n\t\treturn self::$post_status_enum ? : ( self::$post_status_enum = TypeRegistry::get_type( 'PostStatusEnum' ) );\n\t}", "public function status() { return $this->post->post_status; }", "public function default_order_status() {\n\t\treturn 'checkout-draft';\n\t}", "public function get_default_settings();", "function wprss_get_default_tracking_settings() {\r\n\t\treturn apply_filters(\r\n\t\t\t'wprss_default_tracking_settings',\r\n\t\t\tarray(\r\n\t\t\t\t'use_presstrends'\t\t\t\t=>\t'false',\r\n\t\t\t\t'tracking_notice'\t\t\t\t=>\t''\r\n\t\t\t)\r\n\t\t);\r\n\t}", "private function _default_settings() {\n $this->settings = $this->default_settings;\n $this->remote_auth_settings = $this->default_remote_auth_settings;\n\n $this->_update_settings();\n }", "private function getDefaultStatus()\n {\n if ($this->defaultStatus === null) {\n $statusIdent = 'received';\n $this->defaultStatus = Status::where('ident', $statusIdent)->first();\n }\n\n return $this->defaultStatus;\n }", "private function get_default_order_status()\r\n\t{\r\n\t\t// If a cart data id is set in the current session, the order data already exists in the database, therefore the 'resave default' status should be set.\r\n\t\t$sql_where = ($this->flexi->cart_contents['settings']['configuration']['cart_data_id'] !== FALSE) ? \r\n\t\t\tarray($this->flexi->cart_database['order_status']['columns']['resave_default'] => 1) : array($this->flexi->cart_database['order_status']['columns']['save_default'] => 1);\r\n\t\r\n\t\t$query = $this->db->get_where($this->flexi->cart_database['order_status']['table'], $sql_where);\r\n\t\t\r\n\t\tif ($query->num_rows() > 0)\r\n\t\t{\r\n\t\t\t$status_data = $query->row_array();\r\n\t\t\t\r\n\t\t\treturn $status_data[$this->flexi->cart_database['order_status']['columns']['id']];\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "function braftonDefaultPostStatus(){\n global $options;\n $tip = 'Sets the default Post status for articles and video imported. Draft affords the ability to approve an article before it is made live on the blog';\n tooltip($tip); ?>\n <input type=\"radio\" name=\"braftonPostStatus\" value=\"publish\" <?php checkRadioval($options['braftonPostStatus'], 'publish'); ?> /> Published\n\t\t\t\t<input type=\"radio\" name=\"braftonPostStatus\" value=\"draft\" <?php checkRadioval($options['braftonPostStatus'], 'draft'); ?>/> Draft\n<?php \n}", "public function getStatus()\n {\n return $this->status = $this->get()->post_status;\n }", "private function get_proper_status() {\r\n\t\t// Get post status.\r\n\t\t$status = $this->get_status();\r\n\r\n\t\t// if the package has been deleted, keep it so\r\n\t\tif ( $status === 'trash' ) {\r\n\t\t\treturn $status;\r\n\t\t}\r\n\r\n\t\t// if the package has reached it's limit, set it to Full, otherwise Publish\r\n\t\tif ( $this->get_limit() ) {\r\n\t\t\t// listing has reached limit, set to Full\r\n\t\t\tif ( $this->get_remaining_count() <= 0 ) {\r\n\t\t\t\t$status = 'case27_full';\r\n\t\t\t// listing has not reached the limit, and it's previous status was Full, so set it to Publish now\r\n\t\t\t} elseif ( 'case27_full' === $status ) {\r\n\t\t\t\t$status = 'publish';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// if the package doesn't have a limit, it's always publish\r\n\t\tif ( ! $this->get_limit() && $this->get_status() === 'case27_full' ) {\r\n\t\t\t$status = 'publish';\r\n\t\t}\r\n\r\n\t\t// handle cancelled orders\r\n\t\tif ( $order = $this->get_order() ) {\r\n\t\t\tif ( $order->get_status() === 'cancelled' ) {\r\n\t\t\t\t$status = 'case27_cancelled';\r\n\t\t\t} elseif ( 'case27_cancelled' === $this->get_status() ) {\r\n\t\t\t\t$status = 'publish';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $status;\r\n\t}", "public function opt_in_checkbox_default_status() {\n return $this->settings['opt_in_checkbox_default_status'];\n }", "function snax_get_post_default_config( $post_id = 0 ) {\n\t$post = get_post( $post_id );\n\n\treturn apply_filters( 'snax_post_default_config', array(\n\t\t'submission' \t\t\t=> 'standard',\n\t\t'submission_start_date' => $post->post_date,\n\t\t'submission_end_date' => '',\n\t\t'submission_close_limit'=> '',\n\t\t'voting' \t\t\t=> 'standard',\n\t\t'voting_start_date' => $post->post_date,\n\t\t'voting_end_date' => '',\n\t\t'override_forms' => 'none',\n\t\t'forms' => snax_get_active_item_forms_ids(),\n\t\t'items_per_page' => '',\n\t) );\n}", "function FWP_Post_Status_init() {\n\t// Check\n\tif ( ! defined( 'FACETWP_VERSION' ) || version_compare( FACETWP_VERSION, '3.0.0', '<' ) ) {\n\t\tadd_action( 'admin_notices', 'FWP_Post_Status_notice' );\n\n\t\treturn;\n\t}\n\n\tFWP_Post_Status();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests drush_format_table() with word wrapping.
public function testFormatTableWordWrap() { drush_set_context('DRUSH_COLUMNS', 60); $output = drush_format_table($this->words); $expected = ' Drush is a command scripting for Drupal ' . PHP_EOL . ' line shell interface ' . PHP_EOL . ' A veritable Swiss Army knife designed to make ' . PHP_EOL . ' life easier for us ' . PHP_EOL; $this->assertEquals($expected, $output); }
[ "public function testFormattingTableWithCustomCharacters()\n {\n $headers = ['foo', 'bar'];\n $rows = [\n ['a'],\n ['aa', 'bb'],\n ['aaa', 'bbb', 'ccc']\n ];\n $this->formatter->setPadAfter(false);\n $this->formatter->setCellPaddingString('_');\n $this->formatter->setEolChar('<br>');\n $this->formatter->setVerticalBorderChar('I');\n $this->formatter->setHorizontalBorderChar('=');\n $this->formatter->setIntersectionChar('*');\n $expected =\n '*=====*=====*=====*<br>' .\n 'I_foo_I_bar_I_ _I<br>' .\n '*=====*=====*=====*<br>' .\n 'I_ a_I_ _I_ _I<br>' .\n 'I_ aa_I_ bb_I_ _I<br>' .\n 'I_aaa_I_bbb_I_ccc_I<br>' .\n '*=====*=====*=====*';\n $this->assertEquals($expected, $this->formatter->format($rows, $headers));\n }", "public function formatRowWithStringsAlignRightByDefault()\n {\n // Given\n $fieldSpecs = array(\n array(\n \"len\" => \"10\",\n \"type\" => \"s\"),\n array(\n \"len\" => \"15\",\n \"type\" => \"s\"),\n );\n $values = array(\"first\", \"second\");\n\n // When\n $result = RowFormatter::format($values, $fieldSpecs, \" \");\n\n // Then\n $this->assertEquals($result, \" first second\");\n }", "public function testFormattingTableWithoutHeaders()\n {\n $rows = [\n ['a'],\n ['aa', 'bb'],\n ['aaa', 'bbb', 'ccc']\n ];\n $expected =\n '+-----+-----+-----+' . PHP_EOL .\n '| a | | |' . PHP_EOL .\n '| aa | bb | |' . PHP_EOL .\n '| aaa | bbb | ccc |' . PHP_EOL .\n '+-----+-----+-----+';\n $this->assertEquals($expected, $this->formatter->format($rows));\n }", "public function testFormatTableHeader() {\n drush_set_context('DRUSH_COLUMNS', 16);\n $rows = $this->numbers;\n array_unshift($rows, array('A', 'B', 'C'));\n $output = drush_format_table($rows, TRUE);\n $expected = ' A B C ' . PHP_EOL . ' 1 12 123 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 4 45 56 ' . PHP_EOL . ' 123 123 1234 ' . PHP_EOL . ' 456 456 5678 ' . PHP_EOL . ' 7 78 9 ' . PHP_EOL;\n $this->assertEquals($expected, $output);\n }", "function db2table($text) {\r\n $text = str_replace(\" \",\"&nbsp;\",$text);\r\n return nl2br($text);\r\n}", "public function testFormattingTableWithMoreRowColumnsThanHeaders()\n {\n $headers = ['foo', 'bar'];\n $rows = [\n ['a'],\n ['aa', 'bb'],\n ['aaa', 'bbb', 'ccc']\n ];\n $expected =\n '+-----+-----+-----+' . PHP_EOL .\n '| foo | bar | |' . PHP_EOL .\n '+-----+-----+-----+' . PHP_EOL .\n '| a | | |' . PHP_EOL .\n '| aa | bb | |' . PHP_EOL .\n '| aaa | bbb | ccc |' . PHP_EOL .\n '+-----+-----+-----+';\n $this->assertEquals($expected, $this->formatter->format($rows, $headers));\n }", "public function testOutputWithFormattedCells(): void\n {\n $data = [\n ['short', 'Longish thing', '<info>short</info>'],\n ['Longer thing', 'short', '<warning>Longest</warning> <error>Value</error>'],\n ];\n $this->helper->setConfig(['headers' => false]);\n $this->helper->output($data);\n $expected = [\n '+--------------+---------------+---------------+',\n '| short | Longish thing | <info>short</info> |',\n '| Longer thing | short | <warning>Longest</warning> <error>Value</error> |',\n '+--------------+---------------+---------------+',\n ];\n $this->assertEquals($expected, $this->stub->messages());\n }", "public function testPaddingSingleString()\n {\n $this->assertEquals('foo', $this->formatter->format([' foo '], function ($row) {\n return $row[0];\n }));\n }", "public function testCustomPaddingStringWithArrayRows()\n {\n $rows = [\n ['a', 'b '],\n ['cd', ' ee'],\n [' fg ', 'hhh'],\n ['ijk', 'll ']\n ];\n $this->formatter->setPaddingString('+');\n $formattedText = $this->formatter->format($rows, function ($row) {\n return $row[0] . '-' . $row[1];\n });\n $this->assertEquals('a++-b++' . PHP_EOL . 'cd+-ee+' . PHP_EOL . 'fg+-hhh' . PHP_EOL . 'ijk-ll+',\n $formattedText);\n }", "public function testMultipleCellAlign()\n {\n $data = array(\n array('Aartha', 'aartha@example.com', '42'),\n array('James', 'j@c.c', '28'),\n );\n\n $options = array(\n 'headers' => array('name', 'email', 'age'),\n 'cellalign' => array('', 'right', 'R'),\n );\n\n $this->object = new Qi_Console_Tabular($data, $options);\n\n $expected = \"+-----------------------------------------+\\n\"\n . \"| name | email | age |\\n\"\n . \"+-----------------------------------------+\\n\"\n . \"| Aartha | aartha@example.com | 42 |\\n\"\n . \"| James | j@c.c | 28 |\\n\"\n . \"+-----------------------------------------+\\n\";\n\n $result = $this->object->display(true);\n\n $this->assertEquals($expected, $result);\n }", "function TableResults($formatstring, $mysqliobject/*, column names*/)\n{\n if (!method_exists($mysqliobject, 'fetch_assoc'))\n {\n return;\n }\n if (!DebugOutputEnabled())\n {\n return;\n }\n $args = func_get_args();\n $arr = array_values($args);\n $thing = '';\n # Start the table\n echo \"<div style='$formatstring'>\";\n echo \"<table>\n <tr>\";\n // Skip first two elements as they are format string and mysqliobject\n for ($i = 2; $i < sizeof($arr); $i++)\n {\n $title = strtoupper($arr[$i]);\n echo \"<th>$title .</th>\";\n }\n echo \"</tr>\";\n\n # While the next row isn't null, print it\n # Assuming the row has columns equivalent to the column names supplied\n while (!is_null($thing = $mysqliobject->fetch_assoc()))\n {\n echo \"<tr>\";\n foreach ($thing as $i)\n {\n # token database contains binary datatypes, which output incorrectly unless converted to hex\n if (isBinary($i)) { $i = bin2hex($i); }\n echo \"<td>$i</td>\";\n }\n echo \"</tr>\";\n }\n # Close table\n echo \"</table>\";\n echo \"</div>\";\n}", "protected function renderSettingsAsTable() {\n if (count($this->tableData) == 0) {\n return '';\n }\n\n $content = '';\n foreach ($this->tableData as $line) {\n $content .= '<strong>' . $line[0] . '</strong>' . ' ' . $line[1] . '<br />';\n }\n\n return '<pre style=\"white-space:normal\">' . $content . '</pre>';\n }", "function as_table()\n\t{\n\t\treturn $this->_html_output(\n\t\t\t'<tr><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s</td></tr>',\n\t\t\t'<tr><td colspan=\"2\">%s</td></tr>',\n\t\t\t'</td></tr>',\n\t\t\t'<br />%s',\n\t\t\tFalse\n\t\t);\n\t}", "public function testWrapColumns()\n {\n // Need to reconstruct the parser, since that's the only time\n // we look at $COLUMNS.\n $this->parser = $this->makeParser(60);\n $this->assertHelpEquals(self::$expected_help_short_lines);\n }", "public function test_getTableData_SearchWordsByFullWidthDigits()\n {\n // Test for ----------------------------\n $tableId = 1;\n $postData = ['searchWords' => ['1.23']];\n\n // preparation -------------------------\n $this->setDataForSearchTestCase();\n\n // Execute & Check -----------------------\n $response = $this->get('api/v1/table-data/' . $tableId . '?' . http_build_query($postData));\n $response->assertStatus(200)\n ->assertJsonFragment(\n [\n 'total_count' => 3,\n ]\n );\n $responseRecords = $response->original['records'];\n $this->assertEquals(3, count($responseRecords));\n $this->assertEquals(60, $responseRecords[0]->test_column_bigint);\n $this->assertEquals('2020-08-06', $responseRecords[0]->test_column_date);\n $this->assertEquals('1.23', $responseRecords[0]->test_column_varchar);\n $this->assertEquals(6.6, $responseRecords[0]->test_column_decimal);\n $this->assertEquals('2020-09-06 10:10:00', $responseRecords[0]->test_column_datetime);\n $this->assertEquals(70, $responseRecords[1]->test_column_bigint);\n $this->assertEquals('2020-08-07', $responseRecords[1]->test_column_date);\n $this->assertEquals('1.23', $responseRecords[1]->test_column_varchar);\n $this->assertEquals(7.7, $responseRecords[1]->test_column_decimal);\n $this->assertEquals('2020-09-07 10:10:00', $responseRecords[1]->test_column_datetime);\n $this->assertEquals(80, $responseRecords[2]->test_column_bigint);\n $this->assertEquals('2020-08-08', $responseRecords[2]->test_column_date);\n $this->assertEquals('', $responseRecords[2]->test_column_varchar);\n $this->assertEquals(1.23, $responseRecords[2]->test_column_decimal);\n $this->assertEquals('2020-09-08 10:10:00', $responseRecords[2]->test_column_datetime);\n\n // Cleaning up\n DB::table('xls_test_all_types')->delete();\n }", "function table_text($id) {\n $EXTRA_PADDING = 2;\n $table = generate_table($id);\n list($longest, $numeric) = array(array(), array());\n foreach ($table as $team) {\n foreach (hmap($team) as $k => $v) {\n $longest[$k] = (isset($longest[$k]) && $longest[$k] >= mb_strlen($v) ? $longest[$k] : mb_strlen($v));\n $numeric[$k] = (isset($numeric[$k]) ? $numeric[$k] && is_numeric($v) : is_numeric($v));\n }\n }\n $s = \"\";\n foreach ($longest as $k => $max) {\n $display = ucwords(strlen($k) > $longest[$k] ? substr($k, 0, 1) : $k);\n if ($numeric[$k]) {\n $s .= str_pad($display, $max + $EXTRA_PADDING, \" \", STR_PAD_LEFT);\n } else {\n $s .= str_pad($display, $max + $EXTRA_PADDING);\n }\n }\n foreach ($table as $team) {\n $s .= \"\\n\";\n foreach (hmap($team) as $k => $v) {\n if ($numeric[$k]) {\n $s .= str_pad($v, $longest[$k] + $EXTRA_PADDING, \" \", STR_PAD_LEFT);\n } else {\n $s .= str_pad($v, $longest[$k] + $EXTRA_PADDING);\n }\n }\n }\n $s .= '<p><a href=\"' . self_ref_url() . '?id=' . h($id) . '\">HTML version</a></p>';\n return $s . \"\\n\";\n}", "public function testDrawOneColumnTable() {\n\t\t$headers = array('Test Header');\n\t\t$rows = array(\n\t\t\tarray('x'),\n\t\t);\n\t\t$output = <<<'OUT'\n+-------------+\n| Test Header |\n+-------------+\n| x |\n+-------------+\n\nOUT;\n\t\t$this->assertInOutEquals(array($headers, $rows), $output);\n\t}", "public function testRenderBodyColumnWithFormatter()\n {\n $row = array(\n 'date' => date('Y-m-d')\n );\n\n $column = array(\n 'formatter' => 'Date',\n 'name' => 'date'\n );\n\n $mockContentHelper = $this->createPartialMock(ContentHelper::class, array('replaceContent'));\n\n $mockContentHelper->expects($this->once())\n ->method('replaceContent')\n ->with('{{[elements/td]}}', array('content' => date('d/m/Y'), 'attrs' => ' class=\"' . TableBuilder::CLASS_TABLE_CELL . '\"'));\n\n $table = $this->getMockTableBuilder(array('getContentHelper'));\n\n $table->expects($this->any())\n ->method('getContentHelper')\n ->will($this->returnValue($mockContentHelper));\n\n $this->mockFormatterPluginManager->shouldReceive('has')->with('\\Common\\Service\\Table\\Formatter\\Date')->andReturn(true);\n $mockDateFormatter = m::mock('\\Common\\Service\\Table\\Formatter\\Date')->makePartial();\n $mockDateFormatter->shouldReceive('format')->with(date('Y-m-d'))->andReturn(date('d/m/Y'));\n $this->mockFormatterPluginManager->shouldReceive('get')->with('\\Common\\Service\\Table\\Formatter\\Date')->andReturn($mockDateFormatter);\n\n $table->renderBodyColumn($row, $column);\n }", "public function testOutputTable()\n\t{\n\t\t$output = new Output;\n\n\t\t$actual = $this->getBuffered(function () use ($output) {\n\t\t\t$table = [];\n\t\t\t$table[] = ['John', 'Football'];\n\t\t\t$table[] = ['Stephen', 'Soccer'];\n\t\t\t$table[] = ['Ben', 'Baseball'];\n\t\t\t$output->addTable($table);\n\t\t});\n\n\t\t$expected = '\\033[0m/--------------------\\\\\\033[0m\\n';\n\t\t$expected .= '\\033[0m| \\033[0m\\033[0mJohn\\033[0m\\033[0m \\033[0m\\033[0m| \\033[0m\\033[0mFootball\\033[0m\\033[0m \\033[0m\\033[0m|\\033[0m\\n';\n\t\t$expected .= '\\033[0m| \\033[0m\\033[0mStephen\\033[0m\\033[0m \\033[0m\\033[0m| \\033[0m\\033[0mSoccer\\033[0m\\033[0m \\033[0m\\033[0m|\\033[0m\\n';\n\t\t$expected .= '\\033[0m| \\033[0m\\033[0mBen\\033[0m\\033[0m \\033[0m\\033[0m| \\033[0m\\033[0mBaseball\\033[0m\\033[0m \\033[0m\\033[0m|\\033[0m\\n';\n\t\t$expected .= '\\033[0m\\--------------------/\\033[0m\\n';\n\n\t\t$this->assertEquals($expected, $actual, 'Output did not have the expected table');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the NumbersPp model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = NumbersPp::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException('The requested page does not exist.'); }
[ "protected function findModel($id)\n {\n if (($model = Number::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('Запрашиваемая страница не найдена.');\n }\n }", "protected function findModel(array $pk) {\n /** @var ActiveRecord $class */\n $class = $this->getModelClass();\n if (($model = $class::findOne($pk)) !== null) {\n return $model;\n }\n\n $error = \\Yii::t('yii', 'The requested page does not exist.');\n Yii::$app->session->addFlash('error', $error );\n\n return null;\n }", "protected function findModel($idPesquisador)\n {\n if (($model = Pesquisador::findOne($idPesquisador)) !== null)\n {\n return $model;\n } else\n {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = PdmP29::findOne(['id_p29' => $id])) !== null) {\n return $model;\n// } else {\n// throw new NotFoundHttpException('The requested page does not exist.');\n }else{\n $this->redirect(['index']);\n }\n }", "protected function findModel()\n {\n $id = Yii::$app->request->get('id');\n $id = $id ? $id : Yii::$app->request->post('id');\n if (($model = ShipAddress::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException('The requested page does not exist.');\n }", "public function findPk($pk)\n {\n $tableMap = call_user_func(array($this->peerClass, 'getTableMap'));\n $pkColumns = array();\n foreach ($tableMap->getColumns() as $column)\n {\n if($column->isPrimaryKey())\n {\n $pkColumns []= $column->getFullyQualifiedName();\n }\n }\n if(($count = count($pkColumns)) > 1)\n {\n // composite primary key\n if(!is_array($pk))\n {\n if(count($pk = func_get_args()) != count($pkColumns))\n {\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\n }\n } \n else if (is_array($count[0]))\n {\n // array of arrays\n // sorry the finder can't do that on objects with composte primary keys\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\n }\n for ($i=0; $i < $count; $i++)\n { \n $this->criteria->add($pkColumns[$i], $pk[$i]);\n }\n return $this->findOne();\n }\n else\n {\n // simple primary kay\n if(is_array($pk))\n {\n $this->criteria->add($pkColumns[0], $pk, Criteria::IN);\n return $this->find();\n }\n else\n {\n $this->criteria->add($pkColumns[0], $pk);\n return $this->findOne();\n }\n } \n }", "protected function findModel($id)\n {\n if (($model = CellNumbers::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = VoipNumbers::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n\t{\n\t\tif (($model = Page::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = Certificate::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "public function loadModel() {\n $model = gPerson::model()->find('userid = ' . Yii::app()->user->id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "function content_model_viewer_get_model_id($pid) {\n $model_id = db_result(db_query('SELECT id FROM {%s} WHERE id > 1 AND pid = \"%s\"', CONTENT_MODEL_VIEWER_SETTINGS_TABLE, $pid));\n if (!$model_id) {\n $object = islandora_object_load($pid);\n if (!$object) {\n return CONTENT_MODEL_VIEWER_DEFAULT_SETTINGS_MODEL_ID;\n }\n foreach ($object->models as $model) {\n $model_id = db_result(db_query('SELECT id FROM {%s} WHERE id > 1 AND pid = \"%s\"', CONTENT_MODEL_VIEWER_SETTINGS_TABLE, $model));\n if ($model_id) {\n break;\n }\n }\n }\n return $model_id ? $model_id : CONTENT_MODEL_VIEWER_DEFAULT_SETTINGS_MODEL_ID;\n}", "protected function findModel($SliderImagesID)\n\t{\n\t\tif (($model = SliderImages::findOne($SliderImagesID)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = AeExtTickerTrade::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = Project::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new HttpException(404, 'The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n \tif (($model = ProductType::find()->alias('p')->joinWith(\"parent pp\")->where(['p.id'=>$id])->one()) !== null) {\n// if (($model = ProductType::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the eAccelerator caching method is enabled. This check should be done through the 3.x series as the issue impacts migrated sites which will most often come from the previous LTS release (2.5). Remove for version 4 or when eAccelerator support is added. This check returns true when the eAccelerator caching method is user, meaning that the message concerning it should be displayed.
function admin_postinstall_eaccelerator_condition() { $app = JFactory::getApplication(); $cacheHandler = $app->getCfg('cacheHandler', ''); return (ucfirst($cacheHandler) == 'Eaccelerator'); }
[ "public static function hasEAccelerator()\n {\n return extension_loaded('eaccelerator') && ini_get('eaccelerator.enable');\n }", "private function cacheEnabled() {\n return isset(Yii::app()->components['cache']) ? true : false;\n }", "public static function cachingEnabledAndSupported(): bool\n {\n if (!Settings::isCachingEnabled()) {\n return false;\n }\n\n try {\n Cache::tags([static::CACHE_TAG]);\n } catch (BadMethodCallException $e) {\n return false;\n }\n\n return true;\n }", "public function is_supported()\n {\n if( ! extension_loaded( 'apc' ) OR ! ini_get( 'apc.enabled' ) )\n {\n throw new Exception( 'The APC PHP extension must be loaded to use APC Cache.' );\n }\n\n return TRUE;\n }", "public function cachingEnabledAndSupported(): bool;", "public static function is_supported()\n {\n\t\tif (!extension_loaded('apc') || !function_exists('apc_store')) {\n\t\t\terror_log('The APC PHP extension must be loaded to use APC Cache.');\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function cacheEnabled(): bool;", "public function shouldUseCache() {\n\t\t\t// Get cache configuration\n\t\t\t$cacheConfig = $this->getCacheConfig();\n\n\t\t\t// Get request options\n\t\t\t$options = $this->getRequestOptions();\n\n\t\t\t// Store values from options\n\t\t\t$method = ArrayHelper::getValue( $options, \"method\", \"invalid\" );\n\n\t\t\t// Check for valid cache component\n\t\t\t// Check for valid cache config\n\t\t\t// Check for valid cache key\n\t\t\t// Check for valid request options\n\t\t\t// Check for valid method\n\t\t\treturn !empty( $this->getCacheComponent() ) &&\n\t\t\t\t!empty( $cacheConfig ) &&\n\t\t\t\tArrayHelper::getValue( $cacheConfig, \"key\", false ) !== false &&\n\t\t\t\tArrayHelper::getValue( $cacheConfig, \"type\", false ) !== false &&\n\t\t\t\t!empty( $options ) &&\n\t\t\t\tstrtoupper( $method ) === \"GET\";\n\t\t}", "static public function detectOpcodeCache()\n\t{\t\t\n\t\t$apc = ini_get('apc.enabled');\n\t\t$eaccelerator = ini_get('eaccelerator.enable');\n\t\t$mmcache = ini_get('mmcache.enable');\n\t\t$phpexpress = function_exists('phpexpress');\n\t\t$xcache = ini_get('xcache.size') > 0 && ini_get('xcache.cacher');\n\t\t$zend_accelerator = ini_get('zend_accelerator.enabled');\n\t\t$zend_plus = ini_get('zend_optimizerplus.enable');\n\t\t\n\t\treturn $apc || $eaccelerator || $mmcache || $phpexpress || $xcache || $zend_accelerator || $zend_plus;\n\t}", "public static function isEnableCachingActive() {\n\t\t$extensionConfiguration = self::getExtensionConfiguration();\n\t\treturn $extensionConfiguration['enableCaching'] === '1';\n\t}", "public function is_supported()\n {\n if( ! extension_loaded( 'wincache' ) OR ! ini_get( 'wincache.ucenabled' ) )\n {\n throw new \\BadFunctionCallException('The Wincache PHP extension must be loaded to use Wincache Cache.', 103);\n }\n\n return TRUE;\n }", "private static function isActivated()\n {\n return defined('CACHE_ENABLED') ? CACHE_ENABLED : self::CACHE_ENABLED;\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "public function isCacheEnabled()\n {\n return Mage::helper('pagecache')->isEnabled();\n }", "public function canCache()\n {\n return true;\n }", "public static function cacheMethodIsAvailable();", "public function isCacheEnabled();", "protected function should_cache() {\n\t\tinclude_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\treturn ! is_plugin_active( 'wp-rest-cache/wp-rest-cache.php' );\n\t}", "public function isCacheEnabled(): bool\n {\n return Environment::CACHE_DISABLED;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve link download zip design.
public function get_link_download($design_id) { $url_tool = $this->get_url_tool_design(); $param = ''; if($design_id) { $param .= 'rest/design-download?id='.$design_id.'&zip=1&format=pdf'; } else { $param = '#'; } if(substr($url_tool, -1) == '/') { $url_tool .= $param; } else { $url_tool .= '/'.$param; } return $url_tool; }
[ "private function _getDownloadLink(){\n\t\t$link = $this->modx->getOption('site_url').\"core/packages/$this->pkg_name.transport.zip\";\n\t\treturn '<a href=\"'.$link.'\">here</a>';\n\t}", "public function getDownloadLink();", "public function downloadfr()\n {\n return $this->getUrl('*/*/downloadfr');\n }", "public function getDownload() {\r\n\t\treturn $this->getAtributo(\"download\");\r\n\t}", "public function get_zip_url(): string {\n\t\t$url = content_url( self::CACHE_DIR );\n\n\t\t/**\n\t\t * Filters the path to Traduttore's cache directory.\n\t\t *\n\t\t * Useful when language packs should be stored somewhere else.\n\t\t *\n\t\t * @since 3.0.0\n\t\t *\n\t\t * @param string $url Cache directory URL.\n\t\t */\n\t\t$url = apply_filters( 'traduttore.content_url', $url );\n\n\t\treturn sprintf(\n\t\t\t'%1$s/%2$s',\n\t\t\t$url,\n\t\t\t$this->get_zip_filename()\n\t\t);\n\t}", "function plugin_download_link() {\n\t\t$this->response['download_link'] = site_url( '/wp-content/shopp-uploads/adsanity.zip' );\n\t}", "public function downloadPermalink()\n {\n if (!is_null($this->folder))\n return 'folder/'.$this->folder->getAttribute('slug').'?dl=1';\n\n return '';\n }", "function getUrlToDownloadFile() {\r\n\t\treturn \"http://www.elitetorrent.net/get-torrent/\";\r\n\t}", "public function downloadnl()\n {\n return $this->getUrl('*/*/downloadnl');\n }", "public function downloadPermalink();", "public function downloadPermalink()\n {\n if (!is_null($this->doc))\n return 'file/'.$this->doc->getAttribute('slug').'?dl=1';\n\n return '';\n }", "public final function getDownloadArchiveUrl()\n {\n return $this->downloadArchiveUrl;\n }", "public function getDownloadLink()\n {\n return $this->download_link;\n }", "function printDownloadLinkAlbumZip($linktext='',$albumobj='') {\n\tglobal $_zp_current_album, $_downloadList_linkpath;\n\tif (!is_null($albumobj) && !$albumobj->isDynamic()) {\n\t\t$file = $albumobj->name.'.zip';\n\t\tadddownloadListItem($file);\n\t\t$filesize = '';\n\t\t/*\tif(getOption('downloadList_showfilesize')) {\n\t\t\t$filesize = filesize($file);\n\t\t\t$filesize = ' ('.printdownloadList_formatBytes($filesize).')';\n\t\t} */\n\t\tif(getOption('downloadList_showdownloadcounter')) {\n\t\t\t$downloaditem = getdownloadListItemFromDB($file);\n\t\t\tif($downloaditem) {\n\t\t\t\t$downloadcount = ' - '.sprintf(ngettext('%u download','%u downloads',$downloaditem['data']),$downloaditem['data']);\n\t\t\t} else {\n\t\t\t\t$downloadcount = ' - 0 downloads';\n\t\t\t}\n\t\t\t/*\n\t\t\tforeach ($downloaditems as $item) {\n\t\t\t\t$file = filesystemToInternal($file);\n\t\t\t\tif($file == $item['aux']) {\n\t\t\t\t\t$downloadcount = ' - '.sprintf(ngettext('%u download','%u downloads',$item['data']),$item['data']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} */\n\t\t\t$filesize .= $downloadcount;\n\t\t}\n\t\tif(!empty($linktext)) {\n\t\t\t$file = $linktext;\n\t\t}\n\t\tif (strpos($_downloadList_linkpath, '?') === false) {\n\t\t\t$link = WEBPATH.'/'.$_downloadList_linkpath.'?download='.pathurlencode($albumobj->name).'&amp;albumzip';\n\t\t} else {\n\t\t\t$link = WEBPATH.'/'.$_downloadList_linkpath.'&amp;download='.pathurlencode($albumobj->name).'&amp;albumzip';\n\t\t}\n\t\techo '<a href=\"'.$link.'\" rel=\"nofollow\">'.html_encode($file).'</a><small>'.$filesize.'</small>';\n\t}\n}", "public function getDownloadURL()\n {\n if (!file_exists($this->outputFilePath)) {\n throw new LogicException('The zip file does not exist');\n }\n\n $relative_file_path = str_replace($_SERVER['DOCUMENT_ROOT'], '', $this->outputFilePath);\n\n return 'http://'.$_SERVER['HTTP_HOST'].$relative_file_path;\n }", "public function getDownloadLink() {\n $link = \"\";\n\n if($this->FileID)\n $link = $this->File()->Link();\n\n return $link;\n }", "protected function _downloadLinks()\n\t{\t\t\n\t\t$downloadLinks = array( 'iCalCalendar' => '', 'iCalAll' => \\IPS\\Http\\Url::internal( 'app=calendar&module=calendar&controller=view&do=download', 'front', 'calendar_icaldownload' )->csrf(), 'rss' => \\IPS\\Http\\Url::internal( 'app=calendar&module=calendar&controller=view&do=rss', 'front', 'calendar_rss' ) );\n\n\t\tif( $this->_calendar )\n\t\t{\n\t\t\t$downloadLinks['iCalCalendar'] = \\IPS\\Http\\Url::internal( 'app=calendar&module=calendar&controller=view&id=' . $this->_calendar->id . '&do=download', 'front', 'calendar_calicaldownload', $this->_calendar->title_seo )->csrf();\n\t\t}\n\n\t\tif ( \\IPS\\Member::loggedIn()->member_id )\n\t\t{\n\t\t\t$key = md5( ( \\IPS\\Member::loggedIn()->members_pass_hash ?: \\IPS\\Member::loggedIn()->email ) . \\IPS\\Member::loggedIn()->members_pass_salt );\n\n\t\t\tif( $this->_calendar )\n\t\t\t{\n\t\t\t\t$downloadLinks['iCalCalendar'] = $downloadLinks['iCalCalendar']->setQueryString( array( 'member' => \\IPS\\Member::loggedIn()->member_id , 'key' => $key ) );\n\t\t\t}\n\t\t\t$downloadLinks['iCalAll'] = $downloadLinks['iCalAll']->setQueryString( array( 'member' => \\IPS\\Member::loggedIn()->member_id , 'key' => $key ) );\n\t\t\t$downloadLinks['rss'] = $downloadLinks['rss']->setQueryString( array( 'member' => \\IPS\\Member::loggedIn()->member_id , 'key' => $key ) );\n\t\t}\n\n\t\treturn $downloadLinks;\n\t}", "public function getModelZipUrl()\n {\n return $this->model_zip_url;\n }", "static public function get_download_url() {\r\n\t\t\treturn self::$url_download;\r\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the solver view
public function solver() { return $this->boggleBoard->solve(); return view('solver', compact('boggleBoard')); }
[ "public function iaSolution()\n {\n return view('pages.iaSolution');\n }", "public function getSolver()\n {\n return $this->solver;\n }", "protected function getView() {\n return $this->view;\n }", "public function getView() {\n\t\treturn $this->view;\n\t}", "public function getView() {\r\n\t\treturn $this->view;\r\n\t}", "public function getView()\n\t{\n\t\tif(NULL === $this->_view) {\n\t\t\t$this->_view = agoractu_view::getInstance();\n\t\t}\n\t\treturn $this->_view;\n\t}", "protected function _view()\n {\n if (!$this->_view) {\n $this->_view = \\Core\\View::getInstance();\n }\n return $this->_view;\n }", "public function solution()\n {\n $solutionsService = new SolutionsService();\n $solutions = $solutionsService->getByTypes();\n\n return view('pages.solution', [\n 'solutions' => $solutions,\n ]);\n }", "public function getSolver(): SudokuSolverInterface;", "public function get_view() {\n return $this->view;\n }", "public static function getView()\n {\n $configuration = \\ApacheSolrForTypo3\\Solr\\Util::getConfigurationFromPageId(\n $GLOBALS['TSFE']->id,\n 'plugin.tx_solr.fluidRendering.'\n );\n\n $template = $configuration->getValueByPathOrDefaultValue('view.', []);\n static::validateViewConfiguration($template);\n\n $view = static::getStandaloneView();\n $view->setLayoutRootPaths($template['layoutRootPaths.']);\n $view->setPartialRootPaths($template['partialRootPaths.']);\n $view->setTemplateRootPaths($template['templateRootPaths.']);\n\n // Configure settings based on configuration\n $view->assign('settings', static::getCleanSettings(\n $configuration->getValueByPathOrDefaultValue('settings.', []))\n );\n return $view;\n }", "public function getView()\n {\n return $this->_currentView;\n }", "public function getView()\n\t{\n\t\treturn new $this->_viewClass;\n\t}", "public static function getView() {\r\n return self::$app->getContainer()->get('view');\r\n }", "public function get_view(){ return $this->_view; }", "public function createView()\n\t{\n\t\t$queryID = self::getRequestVar('query', self::REG_EXP_SOURCE_ID);\n\t\t\n\t\tif (!$queryID)\n\t\t\tthrow new \\Exception(\"No queryID\");\n\t\t\t\n\t\t$sql = $this->compiler->querySet->sql($queryID);\n\t\t\n\t\tif (!$sql)\n\t\t\tthrow new \\Exception(\"Could not read SQL file\");\n\t\t\t\n\t\t$this->db->execute( 'create or replace view `' . $queryID . '` as ' . $sql );\n\t\t\n\t\treturn array(\n\t\t\t'message' => 'Created / updated view \"' . $queryID . '\"'\n\t\t);\n\t}", "public function lab9()\n {\n return view('labs.lab9');\n }", "private function getView()\n {\n if (view()->exists(\"$this->view\")) {\n return $this->view;\n }\n return \"laravel-datatables::filters.$this->view\";\n }", "function eb_new_retirement_calculator_view(){\n\t\tob_start();\n\t\tinclude_once( EB_CALC_DIR_PATH . '/views/retirement_future_calculator_view.php' );\n\t\treturn ob_get_clean();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that failureReason() returns a string when the instance is created by createChar() and is not a simple type specifier "char".
public function testFailureReasonReturnsStringWhenCreateCharAndNotSimpleTypeSpecifierChar( DeclarationSpecifier $declSpec ): void { $sut = DeclarationSpecifierConstraint::createChar(); self::assertSame( 'Declaration specifier: It should be simple type specifier "char".', $sut->failureReason($declSpec) ); }
[ "public function testValidationCaseInvalidLengthInCharacterMapForCustomString()\n {\n $randomness = $this->getRandomnessSourceForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\LengthException::class);\n\n $randomness->getString(10, ['1', 'S', 'xx']);\n } else {\n $hasThrown = null;\n\n try {\n $randomness->getString(10, ['1', 'S', 'xx']);\n } catch (\\LengthException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testFailureReasonReturnsStringWhenCreateWCharTAndNotSimpleTypeSpecifierWCharT(\n DeclarationSpecifier $declSpec\n ): void\n {\n $sut = DeclarationSpecifierConstraint::createWCharT();\n self::assertSame(\n 'Declaration specifier: It should be simple type specifier \"wchar_t\".', \n $sut->failureReason($declSpec)\n );\n }", "public function testFailureReasonReturnsStringWhenCreateAndDeclarationSpecifierIsNotValid(): void\n {\n $declSpecs = [];\n $declSpecs[] = $this->declSpecFactory->createDummy();\n $declSpecs[] = $this->declSpecFactory->createDummy();\n $declSpecs[] = $this->declSpecFactory->createDummy();\n $declSpecSeq = $this->declSpecSeqFactory->createCountGetDeclarationSpecifiers(3, $declSpecs);\n \n $consts = [];\n $consts[] = $this->declSpecConstFactory->createMatches($declSpecs[0], TRUE);\n $consts[] = $this->declSpecConstFactory->createMatches($declSpecs[1], TRUE);\n $consts[] = $this->declSpecConstFactory->createMatchesFailureReason(\n $declSpecs[2], \n FALSE, \n 'foo reason.'\n );\n \n $sut = DeclarationSpecifierSequenceConstraint::create($consts);\n self::assertSame(\n \"Declaration specifier sequence\\n\".\n \" foo reason.\", \n $sut->failureReason($declSpecSeq)\n );\n }", "public function testValidationCaseNotEnoughSymbolsInCharacterMapForCustomString()\n {\n $randomness = $this->getRandomnessSourceForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\LengthException::class);\n\n $randomness->getString(10, ['x']);\n } else {\n $hasThrown = null;\n\n try {\n $randomness->getString(10, ['x']);\n } catch (\\LengthException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testConstraintDescriptionReturnsStringWhenCreateWCharT(): void\n {\n $sut = DeclarationSpecifierConstraint::createWCharT();\n self::assertSame(\n \"Declaration specifier\\n\".\n \" Simple type specifier \\\"wchar_t\\\"\", \n $sut->constraintDescription()\n );\n }", "public function testFailureReasonReturnsStringWhenNotInstanceIdentifier(): void\n {\n $sut = new IdentifierConstraint('foo');\n self::assertRegExp(\n \\sprintf(\n '`^Identifier: .+ is not an instance of %s\\\\.$`', \n \\str_replace('\\\\', '\\\\\\\\', Identifier::class)\n ), \n $sut->failureReason(NULL)\n );\n }", "public function testAsStringFail()\n {\n $die = new Dice();\n // $die->roll();\n $res = $die->asString();\n $exp = \"\";\n $this->assertEquals($exp, $res);\n }", "public function testCreateUnsuccessfulReason()\n {\n }", "public function testFailureReasonReturnsStringWhenCreateConstAndQualifierIsConstant(): void\n {\n $cv = $this->createCVQualifierDoubleFactory()->createConstant();\n \n $sut = CVQualifierConstraint::createConst();\n self::assertSame(\n 'Constant CV qualifier: Unknown reason.', \n $sut->failureReason($cv)\n );\n }", "public function testFailureDefaultReasonReturnsStringWhenInstantiated(): void\n {\n $sut = new PtrAbstractDeclaratorConstraint();\n self::assertSame(\n 'Pointer abstract declarator: Unknown reason.', \n $sut->failureDefaultReason(NULL)\n );\n }", "public function it_rejects_invalid_char_class()\n {\n $this->beConstructedWith(self::CONFIG_INVALID_CHAR_CLASS);\n $this->shouldThrow($this->invalidConfig)->duringInstantiation();\n }", "public function it_detects_matched_character_classes()\n {\n $this->beConstructedWith($this->configs['partial']);\n $this->shouldThrow(new PasswordValidationException($this->badPasswords['partial']['Aa']))->during('validatePassword', ['Aa']);\n $this->getLastMatches()->shouldReturn('You entered an uppercase letter and a lowercase letter.');\n }", "public function testAssertIsStringWrongType(): void\n {\n\t $this->expectException(Ex\\NotStringException::class);\n Validator::assertIsString(__FUNCTION__, 666);\n }", "public function testFailureReasonReturnsStringWhenNoConstraintAndNestedNameSpecifierIsValid(): void\n {\n $nnSpec = $this->createNestedNameSpecifierDoubleFactory()\n ->createCountGetNameSpecifiers(0, []);\n \n $sut = new NestedNameSpecifierConstraint();\n self::assertSame(\n 'Nested name specifier: Unknown reason.', \n $sut->failureReason($nnSpec)\n );\n }", "public function testToString_returnsString_ifCharacterDoesNotExist()\n\t{\n\t\t$token = new Token\\Other();\n\t\t\n\t\t$this->assertEquals('', (string) $token);\n\t\t\n\t\treturn;\n\t}", "public function testFailureReasonReturnsStringWhenInstantiatedAndNoptrDeclaratorIsInvalid(): void\n {\n $noptrDcltor = ConceptDoubleBuilder::createNoptrDeclarator($this)\n ->getDouble();\n $ptrDcltor = ConceptDoubleBuilder::createPtrDeclarator($this)\n ->buildGetNoptrDeclarator($noptrDcltor)\n ->getDouble();\n \n $noptrDcltorConst = ConceptConstraintDoubleBuilder::createNoptrDeclaratorConstraint($this)\n ->buildMatches($noptrDcltor, FALSE)\n ->buildFailureReason($noptrDcltor, 'foo reason')\n ->getDouble();\n \n $sut = new PtrDeclaratorConstraint($noptrDcltorConst);\n self::assertSame(\n \"Pointer declarator\\n\".\n \" foo reason\",\n $sut->failureReason($ptrDcltor)\n );\n }", "public function testConstructNotString()\n {\n $this->setExpectedException('Modern_String_Exception', 'Value must be string');\n new Modern_String(array('foo'));\n }", "public function testFailureReasonReturnsStringWhenNotSameIdentifier(): void\n {\n $id = $this->idFactory->createGetIdentifier('bar');\n \n $sut = new IdentifierConstraint('foo');\n self::assertSame(\n 'Identifier: \"bar\" does not match identifier \"foo\".', \n $sut->failureReason($id)\n );\n }", "public function testFailureReasonReturnsStringWhenInstantiatedAndNotInstanceParameterDeclaration(): void\n {\n $declSpecSeqConst = $this->declSpecSeqConstFactory->createDummy();\n \n $sut = new ParameterDeclarationConstraint($declSpecSeqConst);\n self::assertRegExp(\n \\sprintf(\n '`^Parameter declaration: .+ is not an instance of %s\\\\.$`', \n \\str_replace('\\\\', '\\\\\\\\', ParameterDeclaration::class)\n ), \n $sut->failureReason(NULL)\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the path where all the scenarios and specs are stored. By default, loads from bdd_scenario folder.
protected function getScenarioPath() { return $this->app->conf->SITE_PATH . $this->app->conf->PROTECTED_FOLDER . 'bdd_scenario'; }
[ "protected function getTestPath()\n {\n return __DIR__ . '/../../fixtures/rdfSampleFolder';\n }", "private function determineFixturesPath() {}", "protected function fixtures() {\n\t\t$class = new \\ReflectionClass($this);\n\t\t$namespace = $class->getNamespaceName();\n\t\t$dir = __DIR__;\n\t\tforeach (explode($namespace, '\\\\') as $n) {\n\t\t\t$dir = dirname($dir);\n\t\t}\n\t\treturn $dir . '/' . self::DIR_FIXTURES . '/';\n\t}", "protected function getTestPath()\n {\n return base_path() . '/tests/Feature/' . ucwords($this->option('model') . 'Test.php');\n }", "public function getFixturesDirectoryPath()\n {\n $path = APPLICATION_PATH . '/configs/fixtures';\n return $path;\n }", "protected function getFixturePath() {\n return realpath(dirname(__FILE__) . '/../fixtures');\n }", "protected function getFixtureFilePath() {\n return __DIR__ . '/../../../../fixtures/drupal7.php';\n }", "protected function getFixturesDir()\n {\n return __DIR__.'/../../../../../_data/twig_fixtures';\n }", "protected static function test_data_path()\n\t{\n\t\treturn realpath(dirname(__FILE__).'/../test_data/');\n\t}", "private function _getSampleDataPath()\n {\n return realpath(__DIR__ . DS . '..' . DS . 'docs' . DS . 'example-templates');\n }", "protected function getFixturePath()\n {\n return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Reader'\n . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR;\n }", "public static function getPathOfDatabase(): string\n {\n return __DIR__ . '/fixtures/database.sql';\n }", "protected function getTestSourceBasePath() {\n\t\treturn Yii::getPathOfAlias('application.runtime').DIRECTORY_SEPARATOR.get_class($this).'_source';\n\t}", "protected function getTestFilePath()\n {\n return Yii::getAlias('@yii2tech/tests/unit/admin/runtime') . DIRECTORY_SEPARATOR . getmypid();\n }", "public static function dumpPath()\n {\n return __DIR__\n .DIRECTORY_SEPARATOR\n .'..'\n .DIRECTORY_SEPARATOR\n .'dump'\n .DIRECTORY_SEPARATOR;\n }", "protected static function getTestsRuntimePath()\n {\n return __DIR__ . '/runtime';\n }", "public function getHarvestedPath()\n {\n $harvestedContentDir = \\ANDS\\Util\\config::get('app.harvested_contents_path');\n \n $harvestedContentDir = rtrim($harvestedContentDir, '/') . '/';\n return $harvestedContentDir . $this->getTaskData('dataSourceID') . '/' . $this->getTaskData('batchID');\n }", "function getDataFolder(){\n return dirname(__FILE__) . '/../data';\n}", "protected function getBasePath() {\n\t\t// Note that the actual filesystem base is the 'assets' subdirectory within this\n\t\treturn ASSETS_PATH . '/FileMigrationHelperTest';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compat Function that contains compatibility fixes for Thrive Architect On plugins_loaded hook
function tve_compat_plugins_loaded_hook() { global $sitepress; if ( ! empty( $sitepress ) && ! empty( $_REQUEST[ TVE_EDITOR_FLAG ] ) ) { remove_action( 'init', array( $sitepress, 'js_load' ), 2 ); } }
[ "function czr_fn_plugins_compatibility() {\r\n /* Unlimited Featured Pages */\r\n if ( current_theme_supports( 'tc-unlimited-featured-pages' ) && $this -> czr_fn_is_plugin_active('tc-unlimited-featured-pages/tc_unlimited_featured_pages.php') )\r\n $this -> czr_fn_set_tc_unlimited_featured_pages_compat();\r\n\r\n /* JETPACK */\r\n //adds compatibilty with the jetpack image carousel and photon\r\n if ( current_theme_supports( 'jetpack' ) && $this -> czr_fn_is_plugin_active('jetpack/jetpack.php') )\r\n $this -> czr_fn_set_jetpack_compat();\r\n\r\n\r\n /* BBPRESS */\r\n //if bbpress is installed and activated, we can check the existence of the contextual boolean function is_bbpress() to execute some code\r\n if ( current_theme_supports( 'bbpress' ) && $this -> czr_fn_is_plugin_active('bbpress/bbpress.php') )\r\n $this -> czr_fn_set_bbpress_compat();\r\n\r\n /* BUDDYPRESS */\r\n //if buddypress is installed and activated, we can check the existence of the contextual boolean function is_buddypress() to execute some code\r\n // we have to use buddy-press instead of buddypress as string for theme support as buddypress makes some checks on current_theme_supports('buddypress') which result in not using its templates\r\n if ( current_theme_supports( 'buddy-press' ) && $this -> czr_fn_is_plugin_active('buddypress/bp-loader.php') )\r\n $this -> czr_fn_set_buddypress_compat();\r\n\r\n /*\r\n * QTranslatex\r\n * Credits : @acub, http://websiter.ro\r\n */\r\n if ( current_theme_supports( 'qtranslate-x' ) && $this -> czr_fn_is_plugin_active('qtranslate-x/qtranslate.php') )\r\n $this -> czr_fn_set_qtranslatex_compat();\r\n\r\n /*\r\n * Polylang\r\n * Credits : Rocco Aliberti\r\n */\r\n if ( current_theme_supports( 'polylang' ) && ( $this -> czr_fn_is_plugin_active('polylang/polylang.php') || $this -> czr_fn_is_plugin_active('polylang-pro/polylang.php') ) )\r\n $this -> czr_fn_set_polylang_compat();\r\n\r\n /*\r\n * WPML\r\n */\r\n if ( current_theme_supports( 'wpml' ) && $this -> czr_fn_is_plugin_active('sitepress-multilingual-cms/sitepress.php') )\r\n $this -> czr_fn_set_wpml_compat();\r\n\r\n /* The Events Calendar */\r\n if ( current_theme_supports( 'the-events-calendar' ) && $this -> czr_fn_is_plugin_active('the-events-calendar/the-events-calendar.php') )\r\n $this -> czr_fn_set_the_events_calendar_compat();\r\n\r\n /* Optimize Press */\r\n if ( current_theme_supports( 'optimize-press' ) && $this -> czr_fn_is_plugin_active('optimizePressPlugin/optimizepress.php') )\r\n $this -> czr_fn_set_optimizepress_compat();\r\n\r\n /* Woocommerce */\r\n if ( current_theme_supports( 'woocommerce' ) && $this -> czr_fn_is_plugin_active('woocommerce/woocommerce.php') )\r\n $this -> czr_fn_set_woocomerce_compat();\r\n\r\n /* Sensei woocommerce addon */\r\n if ( current_theme_supports( 'woo-sensei') && $this -> czr_fn_is_plugin_active('woothemes-sensei/woothemes-sensei.php') )\r\n $this -> czr_fn_set_sensei_compat();\r\n\r\n /* Visual Composer */\r\n if ( current_theme_supports( 'visual-composer') && $this -> czr_fn_is_plugin_active('js_composer/js_composer.php') )\r\n $this -> czr_fn_set_vc_compat();\r\n\r\n /* Disqus Comment System */\r\n if ( current_theme_supports( 'disqus' ) && $this -> czr_fn_is_plugin_active('disqus-comment-system/disqus.php') )\r\n $this -> czr_fn_set_disqus_compat();\r\n\r\n /* Ultimate Responsive Image Slider */\r\n if ( current_theme_supports( 'uris' ) && $this -> czr_fn_is_plugin_active('ultimate-responsive-image-slider/ultimate-responsive-image-slider.php') )\r\n $this -> czr_fn_set_uris_compat();\r\n\r\n /* LearnPress */\r\n if ( current_theme_supports( 'learnpress' ) && $this -> czr_fn_is_plugin_active('learnpress/learnpress.php') )\r\n $this -> czr_fn_set_lp_compat();\r\n }", "private function upgrade_plugin()\n {\n }", "public function plugins_loaded()\n\t{\n\t\t// Have the login plugin use frontend notifictions plugin\n\t\tif ( apply_filters( \"{$this->prefix}/create_object/use_sewn_notifications\", true ) )\n\t\t{\n\t\t\tif (! class_exists('Sewn_Notifications') ) {\n\t\t\t\tadd_filter( \"{$this->prefix}/create_object/use_sewn_notifications\", '__return_false', 9999 );\n\t\t\t}\n\t\t}\n\t}", "static function load_plugin_compatibility() {\r\n\r\n $asset_directories = array(WP_CRM_Connections);\r\n\r\n //** Load any existing assets for active plugins */\r\n foreach (wp_get_active_and_valid_plugins() as $plugin_path) {\r\n\r\n $plugin_slug = basename(plugin_basename(trim(dirname($plugin_path))));\r\n\r\n //** Get plugin name from directory name, or file name (if plugin has no directory and is in root) */\r\n if ($plugin_slug == 'plugins' || empty($plugin_slug)) {\r\n $plugin_slug = basename(plugin_basename(trim($plugin_path)));\r\n }\r\n\r\n //** Look for plugin-specific styles and load them */\r\n foreach ($asset_directories as $directory) {\r\n\r\n $file_path = trailingslashit($directory) . $plugin_slug . '.php';\r\n\r\n if (file_exists($file_path)) {\r\n\r\n if (WP_DEBUG == true) {\r\n include_once($file_path);\r\n } else {\r\n @include_once($file_path);\r\n }\r\n }\r\n }\r\n }\r\n }", "public function plugins_loaded() {\n\t\t// Determine if the database version and code version are the same.\n\t\t$current_version = get_option( 'voicewp_version' );\n\t\tif ( version_compare( $current_version, self::$version, '>=' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * Determine if this is a legacy version\n\t\t * If this option is empty, it's a new install, or not legacy\n\t\t * If the option exists, trigger the update functions\n\t\t */\n\t\t$settings = get_option( 'alexawp-settings' );\n\t\tif ( ! empty( $settings ) ) {\n\t\t\t$this->upgrade_to_1_0_0();\n\t\t}\n\n\t\t// Set the database version to the current version in code.\n\t\tupdate_option( 'voicewp_version', self::$version );\n\t}", "public function on_plugins_loaded()\n {\n\n if ($this->is_compatible()) {\n add_action('elementor/init', [$this, 'init']);\n }\n\n }", "function _wpcac_supports_plugin_upgrade() {\n\n include_once ( ABSPATH . 'wp-admin/includes/admin.php' );\n\n return class_exists( 'Plugin_Upgrader' );\n\n}", "public function load_plugins() {\n\t\t\t$load_compatibility_plugins = apply_filters( 'black_studio_tinymce_load_compatibility_plugins', array( 'siteorigin_panels', 'wpml', 'jetpack_after_the_deadline', 'wp_page_widget', 'elementor' ) );\n\t\t\tif ( ! empty( $load_compatibility_plugins ) ) {\n\t\t\t\tinclude_once( plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-compatibility-plugins.php' );\n\t\t\t\tself::$plugins = Black_Studio_TinyMCE_Compatibility_Plugins::instance( $load_compatibility_plugins );\n\t\t\t}\n\t\t}", "function listable_load_jetpack_compatibility() {\n\n\t//first test if Jetpack is present and activated\n\t// only if it is not present load the duplicated code from the theme\n\tif ( ! class_exists( 'Jetpack' ) ) {\n\t\t//this is not safe -- needed to prefix the functions\n\t\trequire_once get_template_directory() . '/inc/integrations/jetpack/responsive-videos.php';\n\t}\n}", "protected static function init_plugin() {\n\t\t// Plugin updates.\n\t\tif (\\BLOBCOMMON_MUST_USE) {\n\t\t\t// Must-Use doesn't have normal version management, but we\n\t\t\t// can add filters for Musty in case someone's using that.\n\t\t\t\\add_filter(\n\t\t\t\t'musty_download_version_blob-common/index.php',\n\t\t\t\tarray(static::class, 'musty_download_version')\n\t\t\t);\n\t\t\t\\add_filter(\n\t\t\t\t'musty_download_uri_blob-common/index.php',\n\t\t\t\tarray(static::class, 'musty_download_uri')\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t// Normal plugins are... more normal.\n\t\t\t\\add_filter(\n\t\t\t\t'transient_update_plugins',\n\t\t\t\tarray(static::class, 'update_plugins')\n\t\t\t);\n\t\t\t\\add_filter(\n\t\t\t\t'site_transient_update_plugins',\n\t\t\t\tarray(static::class, 'update_plugins')\n\t\t\t);\n\t\t}\n\t}", "public function action_plugins_loaded() {\n\t\tdo_action( 'mexp_init' );\n\t}", "public function getSystemPlugins();", "public function handler_wp_plugins_loaded()\n\t{\n\t\tglobal $enfold_cf7_integration_globals;\n\t\t\n\t\tif( ! class_exists( $enfold_cf7_integration_globals['base_plugin_class'] ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( version_compare( WPCF7_VERSION, $enfold_cf7_integration_globals['base_plugin_min_version'], '<' ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\trequire_once $enfold_cf7_integration_globals['plugin_path'] . 'classes/class-enfold-cf7-integration.php';\n\t\t\n\t\t$this->cf7 = new Enfold_CF7_Integration();\n\t}", "function isCorePlugin () {return false;}", "function placita_plugins_loaded() {\n\n // Update db if necessary\n global $placita_db_version;\n if ( get_site_option( 'placita_db_version' ) != $placita_db_version ) {\n placita_install_db();\n }\n\n // Load plugin text domain\n load_plugin_textdomain( 'laplacita', FALSE, basename( dirname( __FILE__ ) ) . '/languages' );\n}", "public function onPluginsLoaded()\n {\n // inject the WordPress identity into the Zend_Auth singleton\n $wordPress = $this->bootstrap('wordPress')\n ->getResource('wordPress');\n if ('Yes' == $wordPress->getCustomOption('bootstrapAuth', 'Yes')) {\n $adapter = new Vulnero_Auth_Adapter_WordPress($wordPress);\n $auth = Zend_Auth::getInstance();\n $result = $auth->authenticate($adapter);\n\n // register an action helper to enforce any Acl requirements\n Zend_Controller_Action_HelperBroker::addHelper(new Vulnero_Controller_Action_Helper_Acl());\n }\n }", "public function plugin_enable(){\r\n\r\n\t}", "function activate_sitewide_plugin() {\n\t_deprecated_function( __FUNCTION__, '3.0.0', 'activate_plugin()' );\n\treturn false;\n}", "function dd_base_register_required_plugins() {\n\n\t\t$plugins = array(\n\t\t\tarray(\n\t\t\t\t'name' => esc_html__( 'TP Framework', 'dd-base' ),\n\t\t\t\t'slug' => 'tp-framework',\n\t\t\t\t'required' => false\n\t\t\t),\n\t\t);\n\n\t\t$config = array(\n\t\t\t'has_notices' => true,\n\t\t\t'is_automatic' => false\n\t\t);\n\n\t\ttgmpa( $plugins, $config );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the short display name of the qualification
public function getShortDisplayName(){ if (isset($this->shortDisplayName)){ return $this->shortDisplayName; } $name = ""; $name .= $this->getStructureName() . " "; $name .= $this->getLevelShortName() . " "; $name .= $this->getSubTypeShortName() . " "; $name .= "- "; $name .= $this->getName(); $this->shortDisplayName = $name; return $this->shortDisplayName; }
[ "public function getDisplayName(){\n \n if (isset($this->displayName)){\n return $this->displayName;\n }\n \n // CHeck if we have a custom display name first\n $QualStructure = new \\GT\\QualificationStructure($this->getStructureID());\n if ( ($format = $QualStructure->getCustomDisplayNameFormat()) ){\n \n $level = $this->getBuild()->getLevel();\n $subType = $this->getBuild()->getSubType();\n\n $name = $format;\n $name = str_replace(\"%sn%\", $QualStructure->getName(), $name);\n $name = str_replace(\"%sdn%\", $QualStructure->getDisplayName(), $name);\n $name = str_replace(\"%ln%\", $level->getName(), $name);\n $name = str_replace(\"%lns%\", $level->getShortName(), $name);\n $name = str_replace(\"%sbn%\", $subType->getName(), $name);\n $name = str_replace(\"%sbns%\", $subType->getShortName(), $name);\n $name = str_replace(\"%n%\", $this->getName(), $name);\n \n } else {\n \n $name = \"\";\n $name .= $this->getStructureName() . \" \";\n $name .= $this->getLevelName() . \" \";\n $name .= $this->getSubTypeName() . \" \";\n $name .= \"- \";\n $name .= $this->getName();\n \n }\n \n $this->displayName = $name;\n return $this->displayName;\n \n }", "public function getShortName() {\n $newValues = array(\n self::TYPE_STANDALONE_QA => 'SubQC',\n self::TYPE_AUDIO_QC => 'AudioQC',\n self::TYPE_ACCEPTANCE => 'Acc',\n self::TYPE_DUB_SCRIPT => 'SubQC', // This type will be handled as Standalone QA\n self::TYPE_STANDALONE_ACCEPTANCE => 'Acc' // This type will be handled as Acceptance\n );\n\n if(ClientDetectorComponent::getInstance()->isNetflix())\n return (isset($newValues[$this->id])) ? $newValues[$this->id] : $this->name;\n else\n return $this->name;\n }", "public function getQualification(): string\n {\n return $this->qualification;\n }", "public function shortName(): String\n {\n return $this->shortNames[$this->suit];\n }", "public function getQuickbookDisplayName()\n {\n $displayName = $this->number;\n\n if ($this->full_alt_id) {\n $displayName .= ' Job # ' . $this->full_alt_id;\n }\n\n if($this->qb_display_name && $this->canBlockFinacials()){\n\t\t\t$displayName =\t$this->qb_display_name.' - '.$displayName;\n\t\t}\n\n\t\treturn $displayName;\n }", "public function get_type_qual_title()\n {\n return \"\";\n }", "public function get_type_qual_title()\r\n {\r\n return \"\";\r\n }", "public function getShortName()\n {\n return $this->short_name;\n }", "public function getShortName()\n {\n return $this->shortName;\n }", "public function get_display_name() {\n\t\treturn $this->display_name;\n\t}", "public function displayName()\n {\n return $this->countryName().' '.$this->cardtypeName();\n }", "final public function getQualifiedName() {\n\t\t$chunks = array(\n\t\t\t$this->getAcronym()->getFieldValue(),\n\t\t\t$this->getName()->getFieldValue() );\n\n\t\t$qname = implode(' - ', array_filter($chunks));\n\t\treturn str_replace('<nop>', '', $qname);\n\t}", "public function get_shortname() {\n if ($this->is_custom()) {\n return $this->shortname;\n }\n return null;\n }", "public function valueShortName(): string {\n if(array_key_exists($this->value, $this->shortFaceNames)){\n $shortNameValue = $this->shortFaceNames[$this->value];\n } else {\n $shortNameValue = $this->value;\n }\n return strtoupper($shortNameValue);\n }", "public function getShortNameAttribute()\n {\n $faculty_name = str_replace(\"Faculty of \",\"\",$this->name);\n\n $words = explode(\" \", $faculty_name);\n \n $short_name = \"\";\n\n foreach ($words as $w) \n {\n $short_name .= $w[0];\n }\n\n return $short_name;\n }", "public function getNameShort() {\n return $this->getDatabaseValue('station_name_short');\n }", "public function getShortName()\n {\n $value = $this->get(self::SHORT_NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getDisplayname()\n\t{\n\t\treturn $this->displayname;\n\t}", "public function getShortCode()\n\t{\n\t\treturn $this->getValue() . $this->getSuit();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Order ID filter setter
public function addOrderIdFilter($orderId) { $this->_orderId = (int)$orderId; return $this; }
[ "function setOrderID( $order )\r\n {\r\n $this->OrderID = $order;\r\n }", "public function setOrderID($orderID);", "function filter_id($filtername){}", "public function setOrderFilter($incrementId) {\n $this->addFieldToFilter('order_id', $incrementId);\n\n return $this;\n }", "function filter_id ($filtername) {}", "protected function _getOrderIdFieldName()\n {\n return 'order_id';\n }", "public function getQuoteOrderIdFilter($quoteid, $orderId){\r\n\t\t$this->getSelect()->where('quote_id='.intval($quoteid))\r\n\t\t\t\t\t\t->where('order_id='.intval($orderId));\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public function setOrderItemId($id);", "function set_order_id($new_order_id) {\n $this->order_id = $new_order_id;\n}", "private function setMenuIdFilter()\n\t{\n\t\t$this->setFilters(array('menu_id' => $this->getUser()->getAttribute('menu_id')));\n\t}", "static function getIdArray(\n &$count, $order=null, $filter=null, $offset=0, $limit=0\n ) {\n global $objDatabase;\n//DBG::activate(DBG_ADODB);\n//DBG::log(\"Order::getIdArray(): Order $order\");\n\n $query_id = \"SELECT `order`.`id`\";\n $query_count = \"SELECT COUNT(*) AS `numof_orders`\";\n $query_from = \"\n FROM `\".DBPREFIX.\"module_shop_orders` AS `order`\";\n $query_where = \"\n WHERE 1\".\n (empty($filter['id'])\n ? ''\n : (is_array($filter['id'])\n ? \" AND `order`.`id` IN (\".join(',', $filter['id']).\")\"\n : \" AND `order`.`id`=\".intval($filter['id']))).\n (empty($filter['id>'])\n ? ''\n : \" AND `order`.`id`>\".intval($filter['id>'])).\n (empty($filter['customer_id'])\n ? ''\n : (is_array($filter['customer_id'])\n ? \" AND `order`.`customer_id` IN (\".\n join(',', $filter['customer_id']).\")\"\n : \" AND `order`.`customer_id`=\".\n intval($filter['customer_id']))).\n (empty($filter['status'])\n ? ''\n // Include status\n : (is_array($filter['status'])\n ? \" AND `order`.`status` IN (\".join(',', $filter['status']).\")\"\n : \" AND `order`.`status`=\".intval($filter['status']))).\n (empty($filter['!status'])\n ? ''\n // Exclude status\n : (is_array($filter['!status'])\n ? \" AND `order`.`status` NOT IN (\".join(',', $filter['!status']).\")\"\n : \" AND `order`.`status`!=\".intval($filter['!status']))).\n (empty($filter['date>='])\n ? ''\n : \" AND `order`.`date_time`>='\".\n addslashes($filter['date>=']).\"'\");\n (empty($filter['date<'])\n ? ''\n : \" AND `order`.`date_time`<'\".\n addslashes($filter['date<']).\"'\");\n\n if (isset($filter['letter'])) {\n $term = addslashes($filter['letter']).'%';\n $query_where .= \"\n AND ( `profile`.`company` LIKE '$term'\n OR `profile`.`firstname` LIKE '$term'\n OR `profile`.`lastname` LIKE '$term')\";\n }\n if (isset($filter['term'])) {\n $term = '%'.addslashes($filter['term']).'%';\n $query_where .= \"\n AND ( `user`.`username` LIKE '$term'\n OR `user`.`email` LIKE '$term'\n OR `profile`.`company` LIKE '$term'\n OR `profile`.`firstname` LIKE '$term'\n OR `profile`.`lastname` LIKE '$term'\n OR `profile`.`address` LIKE '$term'\n OR `profile`.`city` LIKE '$term'\n OR `profile`.`phone_private` LIKE '$term'\n OR `profile`.`phone_fax` LIKE '$term'\n OR `order`.`company` LIKE '$term'\n OR `order`.`firstname` LIKE '$term'\n OR `order`.`lastname` LIKE '$term'\n OR `order`.`address` LIKE '$term'\n OR `order`.`city` LIKE '$term'\n OR `order`.`phone` LIKE '$term'\n OR `order`.`note` LIKE '$term')\";\n }\n\n// NOTE: For customized Order IDs\n // Check if the user wants to search the pseudo \"account names\".\n // These may be customized with pre- or postfixes.\n // Adapt the regex as needed.\n// $arrMatch = array();\n// $searchAccount = '';\n// (preg_match('/^A-(\\d{1,2})-?8?(\\d{0,2})?/i', $term, $arrMatch)\n// ? \"OR ( `order`.`date_time` LIKE '__\".$arrMatch[1].\"%'\n// AND `order`.`id` LIKE '%\".$arrMatch[2].\"')\"\n// : ''\n// );\n\n // Need to join the User for filter and sorting.\n // Note: This might be optimized, so the join only occurs when\n // searching or sorting by Customer name.\n $query_join = \"\n LEFT JOIN `\".DBPREFIX.\"access_users` AS `user`\n ON `order`.`customer_id`=`user`.`id`\n LEFT JOIN `\".DBPREFIX.\"access_user_profile` AS `profile`\n ON `user`.`id`=`profile`.`user_id`\";\n // The order *SHOULD* contain the direction. Defaults to DESC here!\n $direction = (preg_match('/\\sASC$/i', $order) ? 'ASC' : 'DESC');\n if (preg_match('/customer_name/', $order)) {\n $order =\n \"`profile`.`lastname` $direction, \".\n \"`profile`.`firstname` $direction\";\n }\n $query_order = ($order ? \" ORDER BY $order\" : '');\n $count = 0;\n // Some sensible hardcoded limit to prevent memory problems\n $limit = intval($limit);\n if ($limit < 0 || $limit > 1000) $limit = 1000;\n // Get the IDs of the Orders according to the offset and limit\n//DBG::activate(DBG_ADODB);\n $objResult = $objDatabase->SelectLimit(\n $query_id.$query_from.$query_join.$query_where.$query_order,\n $limit, intval($offset));\n//DBG::deactivate(DBG_ADODB);\n if (!$objResult) return Order::errorHandler();\n $arrId = array();\n while (!$objResult->EOF) {\n $arrId[] = $objResult->fields['id'];\n $objResult->MoveNext();\n }\n//DBG::log(\"Order::getIdArray(): limit $limit, count $count, got \".count($arrId).\" IDs: \".var_export($arrId, true));\n//DBG::deactivate(DBG_ADODB);\n // Get the total count of matching Orders, set $count\n $objResult = $objDatabase->Execute(\n $query_count.$query_from.$query_join.$query_where);\n if (!$objResult) return Order::errorHandler();\n $count = $objResult->fields['numof_orders'];\n//DBG::log(\"Count: $count\");\n // Return the array of IDs\n return $arrId;\n }", "public function set_order_id($value)\n {\n }", "public function getArticleFilterId() : Uuid{\n\treturn($this->articleFilterId);\n}", "public function setOrderFilter(?LoyaltyEventOrderFilter $orderFilter): void\n {\n $this->orderFilter = $orderFilter;\n }", "function bosa_reservation_action_order_id($order) {\n error_log(basename(__FILE__) . ':' . __LINE__ . ' Var: $order = ' . print_r($order->order_id, 1));\n return $order;\n}", "public function getIdOrders()\n {\n return $this->idOrders;\n }", "public function getOrderItemId();", "public function userIdFiltering(&$filter)\n {\n // Enter your code here\n }", "public function filterByOrder($order)\n {\n $this->filter[] = $this->field('order').' = '.$this->quote($order);\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads a resource, given a resource id. Stores the loaded resource in $this>resource. Returns nothing.
protected function loadResource( ResourceId $resource_id ) { // Get a mapper $mapper = Mapper::getMapper( $resource_id->getClass() ); // Load the resource $this->resource = $mapper->loadModel( array( 'id' => $resource_id->getId() )); // Load the components $mapper->loadComponents( $this->resource ); }
[ "public function load($resource)\n {\n $hooks = $this;\n\n require_once($resource);\n }", "public function fetchByResource($resourceId);", "public function load($resourceName);", "public function readFromResource($resource);", "public function getResourceById($resourceType, $id);", "public function load($id)\n\t{\n\t\t$this->entity = $this->entity->find($id);\n\t}", "public function loadOne($id)\n {\n }", "public function registerResource($id, $resource);", "public static function retrieve(string $resource, string $id): self\n {\n if (empty($resource) || empty($id)) {\n throw new \\InvalidArgumentException();\n }\n return new self(\"{$resource}/{$id}\");\n }", "function get_resource_by_id($id) {\n\n return $this->dbc->get_record('block_assmgr_resource', array('id' => $id));\n }", "public function item(string $id): ResourceInterface;", "abstract public function Resource_Link_load($resource_link);", "public static function get($id) {\n $Resource = static::find($id);\n return $Resource;\n }", "public function LoadByID($id) {\n\t\t$this->ID = $id;\n\t\t$this->loadFullDetails();\n\t\t$this->hasLoadedFullDetails = true;\n\t}", "function tryLoad($id){\n if(is_null($id))throw $this->exception('Record ID must be specified, otherwise use loadAny()');\n return $this->_load($id,true);\n }", "public static function byID($resource_id) {\n\n // Get the resource info.\n $sql = \"SELECT * FROM {tripal_remote_resource} WHERE resource_id = :resource_id\";\n $resource = db_query($sql, array(':resource_id' => $resource_id))->fetch(PDO::FETCH_ASSOC);\n\n // Add connection info.\n $sql = \"SELECT * FROM {tripal_remote_ssh} WHERE resource_id = :resource_id\";\n $ssh_resource = db_query($sql, array(':resource_id' => $resource_id))->fetch(PDO::FETCH_ASSOC);\n $resource['resource_id'] = $ssh_resource['resource_id'];\n $resource['hostname'] = $ssh_resource['hostname'];\n $resource['ssh_port'] = $ssh_resource['ssh_port'];\n $resource['username'] = $ssh_resource['username'];\n $resource['ssh_key_location'] = $ssh_resource['ssh_key_location'];\n\n // Return the instance of this class.\n if ($resource) {\n return new self($resource);\n }\n else {\n return NULL;\n }\n }", "public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn ResourceStatus::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::ResourceStatus()->Id, $intId)\n\t\t\t);\n\t\t}", "public function load($id) {\n\t\t$this->logger->debug('[EntityManager]Loading Entity with id '.$id);\n\t\treturn $this->getRepository()\n\t\t->find($id);\n\t}", "public function getResource($resource_id)\n {\n // Make sure the resource exists\n if (! array_key_exists($resource_id, $this->resources))\n {\n throw new NotFoundException(\"Resource not found\");\n }\n $resource = $this->resources[$resource_id];\n\n // Get the annotations\n try\n {\n $class_annotations = Annotations::extractFromObject($resource->class);\n }\n catch (Exception $e)\n {\n throw new Exception(\"Could not obtain information on the resource\");\n }\n\n // Create the Resource Description object and set some values\n $resource_desc = new ResourceDescription();\n $resource_desc->resourceId = $resource->resourceId;\n $resource_desc->name = $resource->name;\n\n // See if we have a comment for the class\n foreach($class_annotations->class as $annotation)\n {\n if ($annotation->name == \"_comment\")\n {\n // Set the description\n $resource_desc->description = $annotation->value;\n break;\n }\n }\n\n // Go through the public properties in the object\n foreach($class_annotations->properties as $property => $annotations)\n {\n // Create a new entry for the property and give it its name\n $value = new Value();\n $value->name = $property;\n\n // Go through the annotations\n foreach($annotations as $annotation)\n {\n switch($annotation->name)\n {\n case \"_comment\":\n $value->description = $annotation->value;\n break;\n case \"var\":\n // Get the values from the annotation\n $values = array_combine(array(\"type\", \"description\"),\n array_pad(\n preg_split('/\\s+/u', $annotation->value, 2),\n 2, \"\"));\n\n // Generate the proper name\n $value->type = $this->generateResourceName(\n $values[\"type\"], $value->list);\n\n // See if this is a resource\n $filtered_resources = Arrays::dataFilter(\n $this->resources, \"name\", $value->type);\n if ($filtered_resources)\n {\n // Yep, it's a resource\n $value->isResource = true;\n }\n\n // See if we have a description\n if ($values[\"description\"] && ! $value->description)\n {\n $value->description = $values[\"description\"];\n }\n break;\n case \"View\":\n // See if the field is hidden or optional\n if (mb_strpos($annotation->value, \"hidden\") !== false ||\n mb_strpos($annotation->value, \"optional\") !== false)\n {\n $value->optional = true;\n }\n break;\n case \"Optional\":\n $value->optional = true;\n break;\n }\n }\n\n // Add the value\n $resource_desc->values[] = $value;\n }\n\n // Return the description\n return $resource_desc;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return peak memory usage
public function getPeakMemoryUsage() { return memory_get_peak_usage($this->real_usage); }
[ "function peakMemoryUsage()\n {\n return memory_get_peak_usage(true) / 1024 / 1024;\n }", "protected function getMemoryPeakUsage()\n {\n return $this->memoryPeakUsage;\n }", "public function getMemoryPeak()\n\t{\n\t\treturn $this->_formatMemory(memory_get_peak_usage());\n\t}", "public function getMemoryPeakUsage(): float\n {\n return $this->memoryPeakUsage;\n }", "function memory_get_peak_usage ($real_usage = null) {}", "public function getCurrentMeasurePeakMemory() {\n $peakMemory = $this->getPeakMemory();\n return $peakMemory - $this->peakMemory;\n }", "function safe_memory_get_peak_usage() {\n\t\tif ( function_exists( 'memory_get_peak_usage' ) ) {\n\t\t\t$usage = memory_get_peak_usage();\n\t\t} else {\n\t\t\t$usage = memory_get_usage();\n\t\t}\n\n\t\treturn $usage;\n\t}", "public function getMemoryPeakEmalloc(): int\n {\n return $this->getLastPeriod()->getMemory()->getEndMemoryPeakEmalloc();\n }", "public static function getMemoryUsage() {\n\t\treturn memory_get_peak_usage();\n\t}", "public function getPeakMemoryUsage()\n {\n return \\array_reduce($this->loggedStatements, static function ($carry, StatementInfo $info) {\n $mem = $info->memoryUsage;\n return $mem > $carry\n ? $mem\n : $carry;\n });\n }", "function displayPeakMemUsage() {\n $mem_peak = memory_get_peak_usage();\n echo 'Peak usage: <strong>' . round($mem_peak / 1024) . 'KB</strong> of memory.<br><br>';\n exit;\n}", "function getPeak()\r\n {\r\n $maxi = 0;\r\n $maxval = 0;\r\n $i = 0;\r\n \r\n foreach ($this->usage as $mem_array) {\r\n if ($maxval < $mem_array[\"Size\"]) {\r\n $maxi = $i;\r\n $maxval = $mem_array[\"Size\"];\r\n \r\n }\r\n $i++;\r\n }\r\n return $maxi;\r\n }", "function log_peak_memory()\n{\n\tglobal $memory_peak;\n\n\tif(($usage = memory_get_usage()) > $memory_peak)\n\t\t$memory_peak = $usage;\n}", "public function getAbsoluteEndMemoryPeak(): int\n {\n $memoryPeak = 0;\n foreach ($this->getPeriods() as $period) {\n if ($period->getMemory()->getEndMemoryPeak() > $memoryPeak) {\n $memoryPeak = $period->getMemory()->getEndMemoryPeak();\n }\n }\n\n return $memoryPeak;\n }", "private function formatPeakMemoryUsage()\n {\n $bytes = memory_get_peak_usage(true);\n return File::format_size($bytes);\n }", "public static function peak($decimals = 3)\r\n {\r\n return (float) round((memory_get_peak_usage() / 1024 / 1024), $decimals);\r\n }", "protected function stopMemory()\n {\n return memory_get_peak_usage();\n }", "public function getMaxMemory();", "protected function getMemoryUsage()\n {\n $memory = round(memory_get_usage() / (1024 * 1024), 0); // to get usage in Mo\n $memoryMax = round(memory_get_peak_usage() / (1024 * 1024)); // to get max usage in Mo\n $message = '(RAM : current='.$memory.'Mo peak='.$memoryMax.'Mo)';\n\n return $message;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provides the ability to start a new timer with the provided name.
public static function start(string $name): Timer { Timers::register($timer = new Timer($name)); return $timer; }
[ "public function start($name = '_default') {\n $now = microtime(true);\n\t\t// If there isn't a timer for this name already, start one\n if (!isset($this->_timers[$name]['start'])) {\n\t\t\t$this->_timers[$name]['start'] = $now;\n $this->_timers[$name]['total'] = 0;\n $this->_timers[$name]['count'] = 1;\n\t\t} else {\n // We have a started timer already. If there is no stop, stop it\n if (!isset($this->_timers[$name]['stop']) || $this->_timers[$name]['stop'] < $now) {\n $this->total($name);\n $this->_timers[$name]['start'] = $now;\n $this->_timers[$name]['count']++;\n }\n }\n\t}", "public static function start($name) {\n static::$timers[$name]['start'] = microtime(TRUE);\n static::$timers[$name]['count'] = isset(static::$timers[$name]['count']) ? ++static::$timers[$name]['count'] : 1;\n }", "function timer_start($name) {\n global $timers;\n\n $timers[$name]['start'] = microtime(TRUE);\n $timers[$name]['count'] = isset($timers[$name]['count']) ? ++$timers[$name]['count'] : 1;\n}", "private function createTimer($timer_name)\n {\n $this->db->insert_from_array(\"timer\", array(\"name\" => $timer_name)); // Will fail if the timer already exists, because name is unique index\n }", "private function timerAction($timer_name)\n\t{\n\t\t$timer = new Timer($timer_name);\n \n // $this->pprint($this->model->timer, \"timer\");\n \n $this->view->values['timer']=$timer->val;\n \n // Set view to timer\n $this->view->setToTimer();\n\t}", "protected function resetTimer($name = 'default')\n {\n $this->timer[$name] = microtime(true);\n }", "public static function start($name = null)\n {\n if (null === $name) {\n static::$time = -static::getTime();\n } else {\n static::$times[$name] = -static::getTime();\n }\n }", "public function startTimer();", "function __resumeTimer($name){\n $this->trace.=\"resume $name\\n\";\n $this->startTime[$name] = $this->getMicroTime();\n }", "public static function getTimer($name = '')\n {\n /** @var Timer|null $timer */\n $timer = isset(self::$timers[$name])\n ? self::$timers[$name]\n : null\n ;\n if (is_null($timer)) {\n throw new \\Exception(__CLASS__ . ' timer \"' . $name . '\" not found');\n }\n\n return $timer;\n }", "private function resumeTimer(string $name): void\n\t{\n\t\t$this->trace .= \"resume $name\\n\";\n\t\t$this->startTime[$name] = microtime(true);\n\t}", "public static function getTimer($name, $tags=array())\r\n {\r\n self::$timers[$name] = new sfPinbaTimer($name);\r\n self::$timers[$name]->setTags($tags);\r\n\t\r\n self::$timers[$name]->startTimer();\r\n\r\n return self::$timers[$name];\r\n }", "public function timer_start() {}", "public function newTimer()\n {\n return new Service\\Timer($this->getLogger());\n }", "public static function start() {\n\t\treturn new Timer();\n\t}", "public static function startTimer()\n {\n self::$started_timers[] = microtime(true);\n }", "public function createStopwatch($name, Profile_Timer_Stopwatch $parent = null)\n {\n $watch = new Profile_Timer_Stopwatch($name);\n $watch->setProfileMode($this->getProfileMode());\n $watch->registerNotificationHandler($this);\n\n // Must be in dev mode\n if ($this->getProfileMode() !== Profile::PROFILE_MODE_DEVELOPMENT) {\n return $watch;\n }\n\n // Assign to parent\n if (is_null($parent)) {\n if ($parent = $this->getNewestRunningStopwatch($this->_stop_watches)) {\n $watch->setParent($parent);\n }\n } else {\n $watch->setParent($parent);\n }\n\n // Add to collection\n $this->_stop_watches[] = $watch;\n\n // Return stopwatch instance\n return $watch;\n }", "public function switchTimer( $newName, $oldName = false )\n {\n if ( $this->totalRunningTimers < 1 )\n {\n return false;\n }\n\n if ( $oldName === false )\n {\n if ( $this->totalRunningTimers > 1 )\n {\n return false;\n }\n\n $oldName = key( $this->runningTimers );\n }\n\n if ( isset( $this->runningTimers[ $oldName ] ) )\n {\n if ( $newName != $oldName )\n {\n $this->runningTimers[$newName] = $this->runningTimers[$oldName];\n unset( $this->runningTimers[$oldName] );\n }\n\n $switchStruct = new ezcDebugSwitchTimerStruct();\n $switchStruct->name = $newName;\n $switchStruct->time = microtime( true );\n\n $this->runningTimers[$newName]->switchTime[] = $switchStruct;\n return true;\n }\n\n return false;\n }", "public function start(string $name): void\n {\n $this->tester->notifyAndWait('phpactor/service/start', ['name' => $name]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the API specified list of models with the API specified data then return the updated list
protected function processApiPutList() { if (empty($this->oRouter->search)) { throw new \Limbonia\Exception\Web("No list criteria specified", null, 403); } $hModelList = $this->getList(['id']); if (empty($hModelList)) { return true; } $aModelList = array_keys($hModelList); $aList = []; $sTable = $this->oModel->getTable(); $hPutData = $this->putData(); foreach ($aModelList as $iModel) { $oModel = $this->oApp->modelFromId($sTable, $iModel); $oModel->setAll($hPutData); $oModel->save(); $aList[] = $oModel->getAll(); } return $aList; }
[ "public function bulkUpdate()\n\t{\n\t\t$input = Input::json()->all();\n\t\t$responseData = array();\n\t\tforeach($input as $inputItem) {\n\t\t\t$todo = Todo::findOrFail($inputItem['id']);\n\t\t\t$todo->update($inputItem);\n\t\t\tarray_push($responseData, $todo);\n\t\t}\n\t\t// TODO check strange response content\n\t\treturn Response::json($responseData, 200);\n\t}", "public function updateListAction()\n {\n if ($this->request->hasArgument('data')) {\n $bearbeiterlist = $this->request->getArgument('data');\n }\n if (empty($bearbeiterlist)) {\n $this->throwStatus(400, 'Required data arguemnts not provided', null);\n }\n foreach ($bearbeiterlist as $uuid => $bearbeiter) {\n $bearbeiterObj = $this->bearbeiterRepository->findByIdentifier($uuid);\n $bearbeiterObj->setBearbeiter($bearbeiter['bearbeiter']);\n $this->bearbeiterRepository->update($bearbeiterObj);\n }\n $this->persistenceManager->persistAll();\n $this->throwStatus(200, null, null);\n }", "public function testUpdateByCriteriaMultipleItems()\n {\n $ids = array_map(function ($model) {\n return $model['id'];\n }, func_get_args()[0]);\n $models = $this->group->update([\n [\n 'name' => $this->newModelData()['name']\n ],\n [\n 'password' => $this->newModelData()['password']\n ]\n ], [['id', $ids]]);\n // test method is returning array and not Laravel class instances\n $this->assertFalse(is_object($models));\n $this->assertTrue(is_array($models));\n // test reading multiple\n $this->assertCount(count($ids), $models);\n // test getting correct items\n $this->assertEquals($ids[0], $models[0]);\n }", "public function bulk_update(){\n // using updateBatch\n\n $model = new TodoModel();\n // $data = [\n // 'title' => $this->request->getVar('title'),\n // 'completed' => $this->request->getVar('completed'),\n // ];\n $data = json_decode(json_encode($this->request->getVar('todos')),true);\n // $data = json_decode($todoStr,true);\n \n $op = $model->updateBatch($data, 'id');\n if($op){\n $response = [\n 'status' => 201,\n 'error' => null,\n 'messages' => [\n 'success' => 'Todo updated successfully'\n ]\n ];\n return $this->respond($response);\n }\n else{\n return $this->failNotFound('No todo found');\n }\n \n }", "public function updateMultiple_data()\n {\n \n }", "public function update_request_lists ($id = '', $data = array()) {\n\t\t$this->db->where('id', $id);\n\t\t$database = $this->db->update('request_lists', $data);\n\t\treturn $database;\n\t}", "public function bulkUpdate(ModelBulkUpdateRequest $request) {\n \n try {\n \n $attributes = $request->get('attributes');\n $id = $request->get('id');\n \n $updated = $this->userService->update($id, $attributes);\n \n $response = [\n 'success' => true,\n 'data' => $updated,\n ];\n \n \n return response()->json($response);\n \n } catch (ModelNotFoundException $e) {\n \n return $this->exceptionResponse($e, 'Model not found exception', 200);\n \n } catch (Exception $e) {\n \n return $this->exceptionResponse($e, 'Exception occurred on bulk update request');\n }\n }", "public function MultiUpdate(Request $request)\n {\n $reqExecTimeId = 35;\n if ($this->privileges[\"role\"] != 3) {\n return response()->json([\n 'message' => 'Forbidden'\n ], 403);\n }\n try {\n $success = [];\n $fail = [];\n $requests = $request->all();\n $updating_posts = json_decode($requests[\"posts\"], true);\n if ($updating_posts == null) return [];\n foreach ($updating_posts as $updating_post) {\n $extraPost = ExtraPost::findOrFail($updating_post['id']);\n if ($this->privileges[\"role\"] == 2 && !in_array($extraPost->hotel_id, $this->privileges[\"hotel_id\"])) {\n return response()->json([\n 'message' => 'Forbidden'\n ], 403);\n }\n $extraPost->setSelf($updating_post);\n $validation = $extraPost->isValide();\n if ($validation === true) {\n $extraPost->save();\n array_push($success, $updating_post['id']);\n } else {\n $fail[$updating_post['id']] = $validation;\n }\n }\n $res = response()->json([\n 'success' => $success,\n 'fail' => $fail\n ], 200);\n } catch (ModelNotFoundException $e) {\n $res = response()->json([\n 'error' => \"Invalid_or_missing_fields\"\n ], 500);\n }\n $this->workEnd($reqExecTimeId);\n return $res;\n }", "public function bulkUpdate(ModelBulkUpdateRequest $request) {\n \n try {\n \n $attributes = $request->get('attributes');\n $id = $request->get('id');\n \n $updated = $this->emailTemplateService->update($id, $attributes);\n \n $response = [\n 'success' => true,\n 'data' => $updated,\n ];\n \n \n return response()->json($response);\n \n } catch (ModelNotFoundException $e) {\n \n return $this->exceptionResponse($e, 'Model not found exception', 200);\n \n } catch (Exception $e) {\n \n return $this->exceptionResponse($e, 'Exception occurred on bulk update request');\n }\n }", "public function updateBatch()\n\t{\n\t\t$input=Input::all();\n\t\t$items=$input['id'];\n\t\tif($input['changeTo']==='Other'&& isset($input['Other'])) {\n\t\t\t$input['changeTo']=$input['Other'];\n\t\t}\n\t\t$changeTo=$input['changeTo'];\n\t\t$field=$input['field'];\n\t\tforeach ($items as $id) {\n\t\t\t$donation=AuctionDonation::find($id);\n\t\t\t$donation->$field=$changeTo;\n\t\t\t$donation->save();\n\t\t}\n\t\tSession::flash('auc_update_success', true);\n\t\treturn Redirect::back();\n\t\t\n\t}", "public function batchUpdate() {\n\t\t\n\t\t$data = $this->_data;\n\t\t$this->withData();\n\t\t\n\t\t$parent_model = $this->_model;\n\t\t$this->forModel();\n\t\t\n\t\t$passed_conditions = $this->_passed_conditions;\n\t\t$this->withPassedConditions();\n\t\t\n\t\t$field_exceptions = $this->_field_exceptions;\n\t\t$this->withFieldExceptions();\n\t\t\n\t\t// Cannot Update Multiple Models\n\t\tif (count(array_keys($data)) > 1) {\n\t\t\t$this->setResponseCode(4015);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Data Should Not Be Indexed\n\t\tif (Hash::numeric(array_keys($data[$parent_model]))) {\n\t\t\t$this->setResponseCode(4008);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Cannot Pass ID\n\t\tif (!empty($data[$parent_model]['id'])) {\n\t\t\t$this->setResponseCode(4001);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Field Map Based Off Read for Querying\n\t\t$field_map = $this\n\t\t\t->withParentModel()\n\t\t\t->forModel($parent_model)\n\t\t\t->returnsFieldMap('read');\n\t\t\n\t\t$modelObject = $this->Controller->{$parent_model};\n\t\t\n\t\t$fields = array();\n\t\tif (!empty($field_map)) {\n\t\t\t\n\t\t\t$fields = $this\n\t\t\t\t->forModel($parent_model)\n\t\t\t\t->withFieldMap($field_map)\n\t\t\t\t->withDataFields($data[$parent_model])\n\t\t\t\t->withFieldExceptions($field_exceptions)\n\t\t\t\t->returnsFilteredDataFields();\n\t\t\t\n\t\t}\n\t\t\n\t\t$field_names = $modelObject->getFieldNames($field_map);\n\t\t\n\t\tif (empty($passed_conditions)) {\n\t\t\t$passed_conditions = $this->Query\n\t\t\t\t->withFieldMap($field_map)\n\t\t\t\t->rendersConditions();\n\t\t}\n\n\t\tif (empty($passed_conditions)) {\n\t\t\t$this->setResponseCode(4017);\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t$conditions = $this\n\t\t\t->withParentModel()\n\t\t\t->forModel($parent_model)\n\t\t\t->withFields($field_names)\n\t\t\t->withPassedConditions($passed_conditions)\n\t\t\t->on('update')\n\t\t\t->rendersConditions();\n\t\t\n\t\tif (empty($conditions)) {\n\t\t\t$this->setResponseCode(4017);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Find IDs of Records to Update\n\t\t$ids = $modelObject->find('list', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'fields' => array(\n\t\t\t\t$parent_model . '.id'\n\t\t\t),\n\t\t\t'contain' => false\n\t\t));\n\t\t\n\t\tif (empty($ids)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// ID `0` Could Come from Special Cases like FormRecordFolder `Uncategorized`\n\t\tif (false !== $key = array_search(0, $ids)) {\n\t\t\tunset($ids[$key]);\n\t\t}\n\t\t\n\t\tif (empty($ids)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$modelObject->begin();\n\t\t\n\t\tforeach ($ids as $id) {\n\t\t\t\n\t\t\t$modelObject->create(false);\n\t\t\t$modelObject->id = $id;\n\t\t\t$modelObject->set(array($parent_model => $fields));\n\t\t\t\n\t\t\t// Validation\n\t\t\tif (!$modelObject->validates() ||\n\t\t\t\t!is_null($this->getIndexValidationErrors())) {\n\t\t\t\t\n\t\t\t\t$validationErrors = $modelObject->validationErrors;\n\t\t\t\t\n\t\t\t\t$modelObject->rollback();\n\t\t\t\t$this->setResponseCode(4012);\n\t\t\t\t\n\t\t\t\tif (!empty($validationErrors)) {\n\t\t\t\t\t$this->forModel($parent_model)\n\t\t\t\t\t\t ->withFieldMap($field_map)\n\t\t\t\t\t\t ->setValidationErrors($validationErrors);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Can Update\n\t\t\tif (!$this->Permissions\n\t\t\t\t->forModel($parent_model)\n\t\t\t\t->canUpdate($id, $fields)) {\n\t\t\t\t$this->setResponseCode(4013);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$fieldList = array_keys($field_map);\t\n\t\t\tif (!empty($field_exceptions)) {\n\t\t\t\t$fieldList = array_merge($fieldList, $field_exceptions);\n\t\t\t}\n\t\t\n\t\t\t// Save Data\n\t\t\tif (!$modelObject->save(array(\n\t\t\t\t\t$data\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'fieldList' => $fieldList,\n\t\t\t\t\t'validate' => false\n\t\t\t\t)\n\t\t\t)) {\n\t\t\t\t$modelObject->rollback();\n\t\t\t\t$this->setResponseCode(5001);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$modelObject->commit();\n\t\t\n\t\t$this->Controller->request->params['paging'][$parent_model]['count'] = count($ids);\n\t\t\n\t\treturn true;\n\t\t\t\t\n\t}", "public function updateModel() {\n $path = $this->model->getApiPath();\n $response = $this->patch($path, $this->model->toArray());\n\n return $this->handleResponse($response);\n }", "public function testBatchUpdateIndexedData() {\n\t\t\n\t\t$this->ApiResource->forModel($this->test_model);\n\t\t\n\t\t$this->ApiResource->withData(array(\n\t\t\t$this->test_model => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'name' => 'Name'\n\t\t\t\t),\n\t\t\t\t1 => array(\n\t\t\t\t\t'name' => 'Name 2'\n\t\t\t\t)\n\t\t\t)\n\t\t));\n\t\t\n\t\t$this->ApiResource->Api\n\t\t\t->expects($this->once())\n\t\t\t->method('setResponseCode')\n\t\t\t->with($this->equalTo(4008));\n\t\t\n\t\t$test = $this->ApiResource->batchUpdate();\n\t\t\n\t\t$this->assertFalse($test);\n\t\t\n\t}", "function bulk_update_packages($data, $ids) {\n\n\n\n if (!isset($ids) || !isset($data))\n return;\n\n\n\n $this->db->where_in('id', $ids);\n\n $this->db->update('packages', $data);\n }", "public function testUpdateUsersBatch()\n {\n // Parameters for the API call\n $userA = new Models\\UserModel();\n $userB = new Models\\UserModel();\n\n $userA->userId = \"12345\";\n $userA->companyId = \"67890\";\n $userA->metadata = [\n \"email\" => \"moesifphp2@email.com\",\n \"name\" => \"moesif php2\",\n \"custom\" => \"randomdata2\"\n ];\n\n $userB->userId = \"1234\";\n $userB->companyId = \"6789\";\n $userB->metadata = [\n \"email\" => \"moesifphp2@email.com\",\n \"name\" => \"moesif php2\",\n \"custom\" => \"randomdata2\"\n ];\n\n $users = array();\n array_push($users, $userA);\n array_push($users, $userB);\n\n // Set callback and perform API call\n self::$controller->setHttpCallBack($this->httpResponse);\n try {\n self::$controller->updateUsersBatch($users);\n } catch (APIException $e) {\n };\n\n // Test response code\n $this->assertEquals(\n 201,\n $this->httpResponse->getResponse()->getStatusCode(),\n \"Status is not 201\"\n );\n }", "public function updated(Lists $lists)\n {\n //\n }", "function company_admin_update($params){\n if(!empty($params)){ \n $this->BullhornConnection->BHConnect(); \n $curl_data=array();\n $i=0;\n $curl_data[$i]['url']=$url = $_SESSION['BH']['restURL'] . '/entity/ClientCorporation/' . $params['ClientCorporation']['id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];\n $curl_data[$i]['post_data']=json_encode($params['ClientCorporation']);\n $curl_data[$i]['req_method'] = 'POST'; \n $j=1;\n $curl_data[$j]['url']=$url = $_SESSION['BH']['restURL'] . '/entity/ClientContact/' . $params['ClientContact']['id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];\n $curl_data[$j]['post_data']=json_encode($params['ClientContact']);\n $curl_data[$j]['req_method'] = 'POST'; \n return $response = $this->BullhornCurl->multiRequest($curl_data); \n }\n }", "public function putItem() {\n\t\tswitch ($this->request->type) {\n\t\t\tcase RequestType::REFERENCE: \n\t\t\t\t$model = $this->request->model;\n\t\t\t\t$modelLeft = $this->request->modelLeft;\n\t\t\t\tif(!isset($this->request->id)) {\n\t\t\t\t\tErrorHandler::throwOne(ErrorHandler::API_ID_MISSING);\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\t$dataSet = $this->request->data->{$modelLeft->modelNamePlural.'2'.$model->modelName};\n\t\t\t\t$dataSet['modBy'] = $this->account->id;\n\t\t\t\tunset($dataSet['modDate']);\n\n\t\t\t\t$success = $model->updateMany2Many($modelLeft, $this->request->id, $dataSet);\n\t\t\t\t\n\t\t\t\tif($success) { \n\t\t\t\t\t$response = new \\stdClass();\n\t\t\t\t\t$this->items = new \\stdClass();\n\t\t\t\t\t$this->items->{$modelLeft->modelNamePlural.'2'.$model->modelName} = $this->request->model->getMany2Many($this->request->id, $modelLeft->modelNamePlural);\n\t\t\t\t\treturn $this->items;\n\t\t\t\t} else {\n\t\t\t\t\tErrorHandler::add(ErrorHandler::DB_UPDATE);\n\t\t\t\t\tErrorHandler::throwOne(array('DB-Error', 'Could not updateMany2Many in '.__FILE__.': '.__LINE__.' with dbError: '.$this->db->getLastError(), 500, ErrorHandler::CRITICAL_EMAIL, true));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbreak;\n\n\t\t\tcase RequestType::COALESCE:\n\t\t\t\techo \"REQUEST TYPE COALESCE not implemented for PUT requests\";\n\t\t\t\texit;\n\t\t\tcase RequestType::QUERY:\n\t\t\t\techo \"REQUEST TYPE QUERY not implemented for PUT requests\";\n\t\t\t\texit;\n\t\t\tcase RequestType::NORMAL:\n\t\t\t\tif(isset($this->request->special)) {\n\t\t\t\t\tswitch ($this->request->special) {\n\t\t\t\t\t\tcase \"sort\":\n\t\t\t\t\t\t\tif($this->request->model->isSortable) {\n\t\t\t\t\t\t\t\t// method sort returns ALL items in the reference\n\t\t\t\t\t\t\t\t$items = $this->request->model->sort($this->request->data->reference, $this->request->data->id, $this->request->data->direction, $this->request->data->currentSort);\n\t\t\t\t\t\t\t\tif($items) {\n\t\t\t\t\t\t\t\t\t$response = new \\stdClass();\n\t\t\t\t\t\t\t\t\t$response->{$this->request->model->modelNamePlural} = $items;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$logData = new \\stdClass();\n\t\t\t\t\t\t\t\t\t$logData->for = new Log\\LogDefaultFor(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);\n\t\t\t\t\t\t\t\t\t$logData->meta = new Log\\LogDefaultMeta($this->request->data->id,$this->request->data->reference, $this->request->data->currentSort,$this->request->data->direction, $this->request->model->sortBy);\n\t\t\t\t\t\t\t\t\tLog::write($this->account->id, 'sort', $this->request->model->modelName, $logData);\n\t\t\t\t\t\t\t\t\treturn $response;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tErrorHandler::sendApiErrors();\n\t\t\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tErrorHandler::throwOne(ErrorHandler::MODEL_NOT_SORTABLE);\n\t\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t*\there we check if there is a special method implemented in the current model.\n\t\t\t\t\t\t\t*\tbut we need to make sure, that no unintended methods get called, so we introduce\n\t\t\t\t\t\t\t*\ta property 'specialMethods' to the model. Unless this method is listed there it wont be called. \n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tif(!in_array($this->request->special, $this->request->model->specialMethods)) {\n\t\t\t\t\t\t\t\tErrorHandler::throwOne(array(\"SEC ALERT\", \"a un-registered special method was tried to be called via ApiPut: \".$this->request->special,500, ErrorHandler::CRITICAL_EMAIL, true));\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$methodExists = method_exists($this->request->model, $this->request->special);\n\t\t\t\t\t\t\t$return = $this->request->model->{$this->request->special}($this->request->data, $this->account, $this->request);\n\t\t\t\t\t\t\tif(isset($return->log)) {\n\t\t\t\t\t\t\t\tLog::write($return->log->account, $return->log->type, $return->log->item, $return->log->data);\n\t\t\t\t\t\t\t\tunset($return->log);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn $return;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t#echo \"ApiPut 145: normal PUT\";\n\t\t\t\t\tif($this->request->model->modifiedByField) {\n\t\t\t\t\t\t// default: 'modBy'\n\t\t\t\t\t\t$this->request->data->{$this->request->model->modelName}[$this->request->model->modifiedByField] = $this->account->id;\n\t\t\t\t\t}\n\t\t\t\t\tunset($this->request->data->{$this->request->model->modelName}['modDate']);\n\n\t\t\t\t\t$dataSet = (isset($this->request->data->{$this->request->model->modelName})) ? $this->request->data->{$this->request->model->modelName} : $this->request->data;\n\n\t\t\t\t\t$updateReturn = $this->request->model->update($this->request->id, $dataSet);\n\n\t\t\t\t\tif(ErrorHandler::hasErrors()) {\n\t\t\t\t\t\tErrorHandler::sendApiErrors();\n\t\t\t\t\t\tErrorHandler::sendErrors();\n\t\t\t\t\t}\n\n\t\t\t\t\tif($updateReturn) {\n\t\t\t\t\t\t$this->item->{$this->request->model->modelName} = $this->request->model->getOneById($updateReturn->id);\n\t\t\t\t\t\t$this->request->data->{$this->request->model->modelName}['id'] = $updateReturn->id;\n\t\t\t\t\t\tLog::write($this->account->id, 'update', $this->request->model->modelName, $this->request->data);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $this->item;\n\t}", "public function bulkUpdateProjectPeople()\n {\n $data = request('data');\n foreach($data as $d)\n {\n /*DB::table('project_peoples')->where([\n ['staff_id', '=', $d['staff_id']],\n ['project_id', '=', $d['project_id']]\n ])->delete();*/\n }\n return response()->json([\n 'code' => SUCCESS,\n 'messsage' => 'Project people data updated succeessfully'\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates, saves and returns a current Std Dev for $value.
function calc($value) { $this->xCount = array_push($this->xWindow, $value); // recalculate if a window size specified if ($this->maxWindow && $this->xCount > $this->maxWindow) { array_shift($this->xWindow); $this->xCount = sizeof($this->xWindow); $this->xTotal = array_sum($this->xWindow); } else { $this->xTotal += $value; } $this->xMean = ($this->xTotal / $this->xCount); // calculate standard deviation $dTotal = 0; foreach ($this->xWindow as $x) { $d = abs($x - $this->xMean); $dTotal += ($d * $d); } $this->stdDev = sqrt($dTotal / $this->xCount); return $this->stdDev; }
[ "public function getWeightStdDev()\n {\n return $this->weight_std_dev;\n }", "public function getStandardValue()\n {\n }", "public function getValue()\n {\n return (float) $this->value;\n }", "public static function STDEV() {\n\t\t// Return value\n\t\t$returnValue = null;\n\n\t\t$aMean = self::AVERAGE(func_get_args());\n\t\tif (!is_null($aMean)) {\n\t\t\t$aArgs = self::flattenArray(func_get_args());\n\n\t\t\t$aCount = -1;\n\t\t\tforeach ($aArgs as $arg) {\n\t\t\t\t// Is it a numeric value?\n\t\t\t\tif ((is_numeric($arg)) && (!is_string($arg))) {\n\t\t\t\t\tif (is_null($returnValue)) {\n\t\t\t\t\t\t$returnValue = pow(($arg - $aMean),2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$returnValue += pow(($arg - $aMean),2);\n\t\t\t\t\t}\n\t\t\t\t\t++$aCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Return\n\t\t\tif (($aCount > 0) && ($returnValue > 0)) {\n\t\t\t\treturn sqrt($returnValue / $aCount);\n\t\t\t}\n\t\t}\n\t\treturn self::$_errorCodes['divisionbyzero'];\n\t}", "public function getStdDeviationValues()\n {\n if ( !isset( $this->stdDeviationValues ) )\n {\n $this->calculateStdDeviationValues();\n }\n return $this->stdDeviationValues;\n }", "public function getStdDevGrade()\n {\n $this->_setStudentGrades();\n return gradeStdDev($this->studentGrades);\n }", "private function std_square($value, $mean) {\n\t\t\treturn pow($value - $mean, 2);\n\t\t}", "public function getDeviation()\n {\n return $this->deviation;\n }", "public function getDoubleValue() {}", "public function discountValue()\n {\n return floatval(data_get($this->discount, 'value'));\n }", "public function getAgeStandardDeviation()\n {\n return sqrt($this->getAgeVariance());\n }", "public function getValueDouble()\n {\n $value = $this->get(self::VALUE_DOUBLE);\n return $value === null ? (double)$value : $value;\n }", "public function getMeanStDev()\n {\n return (float) $this->xpath()->evaluate('sum(//stats/@stdev) div count(//stats)');\n }", "public static function STDEVP() {\n\t\t// Return value\n\t\t$returnValue = null;\n\n\t\t$aMean = self::AVERAGE(func_get_args());\n\t\tif (!is_null($aMean)) {\n\t\t\t$aArgs = self::flattenArray(func_get_args());\n\n\t\t\t$aCount = 0;\n\t\t\tforeach ($aArgs as $arg) {\n\t\t\t\t// Is it a numeric value?\n\t\t\t\tif ((is_numeric($arg)) && (!is_string($arg))) {\n\t\t\t\t\tif (is_null($returnValue)) {\n\t\t\t\t\t\t$returnValue = pow(($arg - $aMean),2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$returnValue += pow(($arg - $aMean),2);\n\t\t\t\t\t}\n\t\t\t\t\t++$aCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Return\n\t\t\tif (($aCount > 0) && ($returnValue > 0)) {\n\t\t\t\treturn sqrt($returnValue / $aCount);\n\t\t\t}\n\t\t}\n\t\treturn self::$_errorCodes['divisionbyzero'];\n\t}", "public function valueWithoutVat($value)\n {\n if(!$value) {\n return $value;\n }\n\n return $value / (1 + ($this->config->TVA / 100));\n }", "public function getresistanceValue()\n {\n return $this->value;\n }", "function standard_deviation($std) {\n $total = 0;\n while (list($key, $val) = each($std))\n {\n $total += $val;\n }\n reset($std);\n $mean = $total / count($std);\n\n while (list($key, $val) = each($std))\n {\n $sum += pow(($val - $mean), 2);\n }\n $var = sqrt($sum / (count($std) - 1));\n return $var;\n}", "public function getValue()\n\t{\n\t\treturn $this->amount * $this->unit->getUnit();\n\t}", "public function getFineValue()\n {\n return isset($this->fine_value) ? $this->fine_value : 0;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Confirms that we can mergeupdate without any update fields.
public function testMergeUpdateWithoutUpdate() { $num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField(); $this->connection->merge('test_people') ->key('job', 'Speaker') ->execute(); $num_records_after = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField(); $this->assertEquals($num_records_before, $num_records_after, 'Merge skipped properly.'); $person = $this->connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetch(); $this->assertEquals('Meredith', $person->name, 'Name skipped correctly.'); $this->assertEquals(30, $person->age, 'Age skipped correctly.'); $this->assertEquals('Speaker', $person->job, 'Job skipped correctly.'); $this->connection->merge('test_people') ->key('job', 'Speaker') ->insertFields(['age' => 31]) ->execute(); $num_records_after = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField(); $this->assertEquals($num_records_before, $num_records_after, 'Merge skipped properly.'); $person = $this->connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetch(); $this->assertEquals('Meredith', $person->name, 'Name skipped correctly.'); $this->assertEquals(30, $person->age, 'Age skipped correctly.'); $this->assertEquals('Speaker', $person->job, 'Job skipped correctly.'); }
[ "public function isMerge();", "public function testMergeWithFields(): void\n {\n $data = [\n 'title' => 'My title',\n 'body' => null,\n 'author_id' => 1,\n ];\n $marshall = new Marshaller($this->articles);\n $entity = new Entity([\n 'title' => 'Foo',\n 'body' => 'My content',\n 'author_id' => 2,\n ]);\n $entity->setAccess('*', false);\n $entity->setNew(false);\n $entity->clean();\n $result = $marshall->merge($entity, $data, ['fields' => ['title', 'body']]);\n\n $expected = [\n 'title' => 'My title',\n 'body' => null,\n 'author_id' => 2,\n ];\n\n $this->assertSame($entity, $result);\n $this->assertEquals($expected, $result->toArray());\n $this->assertFalse($entity->isAccessible('*'));\n }", "public function testMergeUpdateExplicit() {\n $num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n\n $this->connection->merge('test_people')\n ->key('job', 'Speaker')\n ->insertFields([\n 'age' => 31,\n 'name' => 'Tiffany',\n ])\n ->updateFields([\n 'name' => 'Joe',\n ])\n ->execute();\n\n $num_records_after = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n $this->assertEquals($num_records_before, $num_records_after, 'Merge updated properly.');\n\n $person = $this->connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetch();\n $this->assertEquals('Joe', $person->name, 'Name set correctly.');\n $this->assertEquals(30, $person->age, 'Age skipped correctly.');\n $this->assertEquals('Speaker', $person->job, 'Job set correctly.');\n }", "public function isUpdateSecurityRelevant() {}", "function allow_update()\n {\n return !empty($this->moodle_choice_instance->allowupdate);\n }", "public function testMergeWithValidation(): void\n {\n $data = [\n 'title' => 'My title',\n 'author_id' => 'foo',\n ];\n $marshall = new Marshaller($this->articles);\n $entity = new Entity([\n 'id' => 1,\n 'title' => 'Foo',\n 'body' => 'My Content',\n 'author_id' => 1,\n ]);\n $this->assertEmpty($entity->getInvalid());\n\n $entity->setAccess('*', true);\n $entity->setNew(false);\n $entity->clean();\n\n $this->articles->getValidator()\n ->requirePresence('thing', 'update')\n ->requirePresence('id', 'update')\n ->add('author_id', 'numeric', ['rule' => 'numeric'])\n ->add('id', 'numeric', ['rule' => 'numeric', 'on' => 'update']);\n\n $expected = clone $entity;\n $result = $marshall->merge($expected, $data, []);\n\n $this->assertSame($expected, $result);\n $this->assertSame(1, $result->author_id);\n $this->assertNotEmpty($result->getError('thing'));\n $this->assertEmpty($result->getError('id'));\n\n $this->articles->getValidator()->requirePresence('thing', 'create');\n $result = $marshall->merge($entity, $data, []);\n\n $this->assertEmpty($result->getError('thing'));\n $this->assertSame(['author_id' => 'foo'], $result->getInvalid());\n }", "public function testMergeUpdate() {\n $num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n\n $result = $this->connection->merge('test_people')\n ->key('job', 'Speaker')\n ->fields([\n 'age' => 31,\n 'name' => 'Tiffany',\n ])\n ->execute();\n\n $this->assertEquals(Merge::STATUS_UPDATE, $result, 'Update status returned.');\n\n $num_records_after = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();\n $this->assertEquals($num_records_before, $num_records_after, 'Merge updated properly.');\n\n $person = $this->connection->query('SELECT * FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetch();\n $this->assertEquals('Tiffany', $person->name, 'Name set correctly.');\n $this->assertEquals(31, $person->age, 'Age set correctly.');\n $this->assertEquals('Speaker', $person->job, 'Job set correctly.');\n }", "private function needToUpdateResponse()\n {\n return $this->collectQueries || !$this->debug->isEmpty();\n }", "public function testMergeSimple(): void\n {\n $data = [\n 'title' => 'My title',\n 'author_id' => 1,\n 'not_in_schema' => true,\n ];\n $marshall = new Marshaller($this->articles);\n $entity = new Entity([\n 'title' => 'Foo',\n 'body' => 'My Content',\n ]);\n $entity->setAccess('*', true);\n $entity->setNew(false);\n $entity->clean();\n $result = $marshall->merge($entity, $data, []);\n\n $this->assertSame($entity, $result);\n $this->assertEquals($data + ['body' => 'My Content'], $result->toArray());\n $this->assertTrue($result->isDirty(), 'Should be a dirty entity.');\n $this->assertFalse($result->isNew(), 'Should not change the entity state');\n }", "public function allowDerivedUpdate()\n {\n return !$this->isDerived();\n }", "public function updateNecessary() : bool {}", "public function canMerge()\n {\n if (!$this->getId()) {\n return false;\n }\n if (!$this->checkCoreFlag()) {\n return false;\n }\n if ($this->isStatusProcessing()) {\n return false;\n }\n if ($this->canUnschedule()) {\n return false;\n }\n return true;\n }", "public function isAllowedToUpdate()\n { }", "public function testMergeAssociationNullOut(): void\n {\n $user = new Entity([\n 'id' => 1,\n 'username' => 'user',\n ]);\n $article = new Entity([\n 'title' => 'title for post',\n 'user_id' => 1,\n 'user' => $user,\n ]);\n\n $user->setAccess('*', true);\n $article->setAccess('*', true);\n\n $data = [\n 'title' => 'Chelsea',\n 'user_id' => '',\n 'user' => '',\n ];\n\n $marshall = new Marshaller($this->articles);\n $marshall->merge($article, $data, [\n 'associated' => ['Users'],\n ]);\n $this->assertNull($article->user);\n $this->assertSame('', $article->user_id);\n $this->assertTrue($article->isDirty('user'));\n }", "public function isMerging() : bool\n {\n\n return ( $this->mergeCols > 1 || $this->mergeRows > 1 );\n }", "public function testHasNoUpdatesDev()\n {\n $this->expectIsCurrent();\n $this->assertFalse($this->model->hasUpdates());\n }", "public function schemaInSyncWithMetadata()\n {\n return count($this->getUpdateSchemaList()) === 0;\n }", "final public function DeniesUpdate()\n {\n return ! static::AllowsUpdate();\n }", "public function testApplyUpdatesNone()\n {\n $this->environment->id = 'dev';\n\n $upstream_data = (object)[\n 'remote_head' => '2f1c945d01cd03250e2b6668ad77bf24f54a5a56',\n 'ahead' => 1,\n 'update_log' => (object)[],\n ];\n\n $this->upstream_status->expects($this->once())\n ->method('getUpdates')\n ->with()\n ->willReturn($upstream_data);\n\n $this->logger->expects($this->once())\n ->method('log')\n ->with(\n $this->equalTo('warning'),\n $this->equalTo('There are no available updates for this site.')\n );\n\n $this->environment->expects($this->never())\n ->method('applyUpstreamUpdates');\n\n $out = $this->command->applyUpstreamUpdates('123', ['accept-updates' => true, 'updatedb' => true,]);\n $this->assertNull($out);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'editDocumentDocxGetTableRow'
protected function editDocumentDocxGetTableRowRequest($req_config) { // verify the required parameter 'req_config' is set if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $req_config when calling editDocumentDocxGetTableRow' ); } $resourcePath = '/convert/edit/docx/get-table-row'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // body params $_tempBody = null; if (isset($req_config)) { $_tempBody = $req_config; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json', 'text/json', 'application/xml', 'text/xml'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json', 'text/json', 'application/xml', 'text/xml'], ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { $httpBody = \GuzzleHttp\json_encode($httpBody); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); } } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); if ($apiKey !== null) { $headers['Apikey'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function editDocumentDocxInsertTableRowRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxInsertTableRow'\n );\n }\n\n $resourcePath = '/convert/edit/docx/insert-table-row';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function editDocumentDocxDeleteTableRowRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxDeleteTableRow'\n );\n }\n\n $resourcePath = '/convert/edit/docx/delete-table-row';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function editDocumentDocxGetTableByIndexRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxGetTableByIndex'\n );\n }\n\n $resourcePath = '/convert/edit/docx/get-table/by-index';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function editDocumentDocxInsertTableRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxInsertTable'\n );\n }\n\n $resourcePath = '/convert/edit/docx/insert-table';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function editDocumentDocxUpdateTableCellRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxUpdateTableCell'\n );\n }\n\n $resourcePath = '/convert/edit/docx/update-table-cell';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function editDocumentDocxGetTablesRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxGetTables'\n );\n }\n\n $resourcePath = '/convert/edit/docx/get-tables';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function editDocumentXlsxGetSpecificRowRequest($input)\n {\n // verify the required parameter 'input' is set\n if ($input === null || (is_array($input) && count($input) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $input when calling editDocumentXlsxGetSpecificRow'\n );\n }\n\n $resourcePath = '/convert/edit/xlsx/get-specific-row';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($input)) {\n $_tempBody = $input;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testEditDocumentDocxInsertTableRow()\n {\n }", "public function getTableRowRequest($table_id_or_name, $row_id)\n {\n // verify the required parameter 'table_id_or_name' is set\n if ($table_id_or_name === null || (is_array($table_id_or_name) && count($table_id_or_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $table_id_or_name when calling getTableRow'\n );\n }\n // verify the required parameter 'row_id' is set\n if ($row_id === null || (is_array($row_id) && count($row_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $row_id when calling getTableRow'\n );\n }\n if (!preg_match(\"/\\\\d+/\", $row_id)) {\n throw new \\InvalidArgumentException(\"invalid value for \\\"row_id\\\" when calling RowsApi.getTableRow, must conform to the pattern /\\\\d+/.\");\n }\n\n\n $resourcePath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($table_id_or_name !== null) {\n $resourcePath = str_replace(\n '{' . 'tableIdOrName' . '}',\n ObjectSerializer::toPathValue($table_id_or_name),\n $resourcePath\n );\n }\n // path params\n if ($row_id !== null) {\n $resourcePath = str_replace(\n '{' . 'rowId' . '}',\n ObjectSerializer::toPathValue($row_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', '*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', '*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function editDocumentDocxDeleteTableRowWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\DeleteDocxTableRowResponse';\n $request = $this->editDocumentDocxDeleteTableRowRequest($req_config);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\DeleteDocxTableRowResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function editDocumentDocxBodyRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxBody'\n );\n }\n\n $resourcePath = '/convert/edit/docx/get-body';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createTableRowRequest($table_id_or_name, $hub_db_table_row_v3_request)\n {\n // verify the required parameter 'table_id_or_name' is set\n if ($table_id_or_name === null || (is_array($table_id_or_name) && count($table_id_or_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $table_id_or_name when calling createTableRow'\n );\n }\n // verify the required parameter 'hub_db_table_row_v3_request' is set\n if ($hub_db_table_row_v3_request === null || (is_array($hub_db_table_row_v3_request) && count($hub_db_table_row_v3_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $hub_db_table_row_v3_request when calling createTableRow'\n );\n }\n\n $resourcePath = '/cms/v3/hubdb/tables/{tableIdOrName}/rows';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($table_id_or_name !== null) {\n $resourcePath = str_replace(\n '{' . 'tableIdOrName' . '}',\n ObjectSerializer::toPathValue($table_id_or_name),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', '*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', '*/*'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($hub_db_table_row_v3_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($hub_db_table_row_v3_request));\n } else {\n $httpBody = $hub_db_table_row_v3_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testEditDocumentDocxDeleteTableRow()\n {\n }", "public function editDocumentDocxInsertTableRowWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\InsertDocxTableRowResponse';\n $request = $this->editDocumentDocxInsertTableRowRequest($req_config);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InsertDocxTableRowResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function editDocumentDocxUpdateTableRow($req_config)\n {\n list($response) = $this->editDocumentDocxUpdateTableRowWithHttpInfo($req_config);\n return $response;\n }", "protected function docEditRequest($path)\n {\n // verify the required parameter 'path' is set\n if ($path === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $path when calling docEdit'\n );\n }\n\n $resourcePath = '/core/docedit';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($path !== null) {\n $formParams['path'] = ObjectSerializer::toFormValue($path);\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function editDocumentDocxDeleteTableRow($req_config)\n {\n list($response) = $this->editDocumentDocxDeleteTableRowWithHttpInfo($req_config);\n return $response;\n }", "public function editDocumentDocxGetTableByIndexWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\GetDocxTableByIndexResponse';\n $request = $this->editDocumentDocxGetTableByIndexRequest($req_config);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\GetDocxTableByIndexResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function editDocumentDocxPagesRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxPages'\n );\n }\n\n $resourcePath = '/convert/edit/docx/get-pages';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set CurrentBalance value This property belongs to a choice that allows only one property to exist. It is therefore removable from the request, consequently if the value assigned to this property is null, the property is removed from this object
public function setCurrentBalance(\PayPal\StructType\AmountType $currentBalance = null) { // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) if ('' !== ($currentBalanceChoiceErrorMessage = self::validateCurrentBalanceForChoiceConstraintsFromSetCurrentBalance($currentBalance))) { throw new \InvalidArgumentException($currentBalanceChoiceErrorMessage, __LINE__); } if (is_null($currentBalance) || (is_array($currentBalance) && empty($currentBalance))) { unset($this->CurrentBalance); } else { $this->CurrentBalance = $currentBalance; } return $this; }
[ "public function setCurrentbalance($currentbalance)\r\n {\r\n $this->currentbalance = $currentbalance;\r\n\r\n return $this;\r\n }", "function setBalance(){\n foreach($this->_withdrawals as $withdrawal){\n $this->_balance = $this->_balance - $withdrawal;\n }\n\n foreach($this->_deposits as $deposit){\n $this->_deposits = $this->_deposits + $deposit;\n }\n }", "public function setBalance($balance) {\n\t\t$this->balance = $balance;\n\t}", "public function setBalance($newBalance)\r\n {\r\n \tif (is_numeric($newBalance)){\r\n\t if ($newBalance <= 0) {\r\n\t return false;\r\n\t } \r\n\t else\r\n\t \t$newBalance = round($newBalance, 2); //round function to set the balance to 2 decimal places. means we can accept values with more than 2 decimal points\r\n\t return $this -> balance = $newBalance;;\r\n\t }\r\n }", "public function setBalance($value)\n {\n return $this->set(self::balance, $value);\n }", "private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }", "public function setCurrentBalance(\\Nogrod\\eBaySDK\\Trading\\AmountType $currentBalance)\n {\n $this->currentBalance = $currentBalance;\n return $this;\n }", "public function setBalance(float $balance): void\n {\n $this->_balance = $balance;\n }", "public function getCurrentBalance(): float\n {\n return $this->currentBalance;\n }", "public function setCurrent($var)\n {\n GPBUtil::checkMessage($var, \\Io\\Token\\Proto\\Common\\Money\\Money::class);\n $this->current = $var;\n\n return $this;\n }", "public function setCurrentAmount(?string $value): void {\n $this->getBackingStore()->set('currentAmount', $value);\n }", "function testSetBalance(){\n\t\tsetBalance(\"udubey@usc.edu\", 1000);\n\t\t$this->assertEquals(getBalance(\"udubey@usc.edu\"), 1000);\n\t\tsetBalance(\"udubey@usc.edu\", 10000);\n\t\t$this->assertEquals(getBalance(\"udubey@usc.edu\"), 10000);\n\t}", "public function setOpeningBalance ($newBalance = 0)\r\n\t{\r\n\t\tif ($this->balance == 0) {\r\n\t\t\t$this->balance = $newBalance;\r\n\t\t}\r\n\t}", "public function setBalanceOld($balanceOld) {\n\t\t$this->balanceOld = $balanceOld;\n\t}", "public function testSetPositiveBalance(){\n\t\t\t// Arrange\n\t\t\t$pm = new PortfolioManager(14);\n\t\t\t// Act\n\t\t\t$pm->setBalance(5);\n\t\t\t// Assert\n\t\t\t$this->assertEquals(5, $pm->getBalance());\n\t\t}", "public function withBalance($value)\n {\n $this->setBalance($value);\n return $this;\n }", "function updateBalance(): void {\n\t}", "function balanceUpdate()\n\t{\n\t\t// Get Current Balance\n\t\t$x = SQL::fetch_one('SELECT sum(amount) AS balance_update FROM account_ledger WHERE account_id = ?', array($this->_data['id']));\n\t\t$balance = floatval($x);\n\n\t\t// Sum the Child Accounts\n\t\t// $rs = $this->child_accounts;\n\t\t// foreach ($rs as $a) {\n\t\t//\t $x = $db->fetchOne(\"select sum(amount) from account_ledger where account_id=$a->id\");\n\t\t//\t $balance += floatval($x);\n\t\t// }\n\n\t\t// Update Account\n\t\tSQL::query(\"UPDATE account SET balance = ? WHERE id = ?\", array($balance, $this->_data['id']));\n\t\treturn $balance;\n\t}", "private function _updateBalance()\n\t{\n\t\t$id = $this->_data['id'];\n\n\t\t$sql = 'update workorder set ';\n\t\t$sql.= 'bill_amount = (';\n\t\t\t$sql.= \"select sum(a_quantity * a_rate) from workorder_item \";\n\t\t\t$sql.= \" where workorder_id=$id and status = 'Billed' ) \";\n\t\t$sql.= ',';\n\t\t$sql.= 'open_amount = (';\n\t\t\t$sql.= 'select sum(a_quantity * a_rate) from workorder_item ';\n\t\t\t$sql.= \" where workorder_id = $id and status in ('Active','Complete') \";\n\t\t$sql.= \") where id=$id\";\n\t\tSQL::query($sql);\n\n\t\t$this->bill_amount = SQL::fetch_one(\"SELECT bill_amount FROM workorder WHERE id = $id\");\n\t\t$this->open_amount = SQL::fetch_one(\"SELECT open_amount FROM workorder WHERE id = $id\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the URL of the image relative to the base of the site Arguments: None Returns: The URL relative to the base URL of the site (e.g. /images/foo.jpg
public function relative_url() { return '/images/' . $this->filename; }
[ "public function image_url()\n\t{\n\t\treturn URL::site('media/img/projects/'.$this->main_image->filename);\n\t}", "static public function imageurlpath(){\r\n global $base_url;\r\n return $base_url.'/'.drupal_get_path('module','tracking').'/images/';\r\n }", "public function getBaseUrl()\n {\n return $this->_urlBuilder->getBaseUrl(['_type' => \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA]).$this->_subDir.'/image';\n }", "public function baseImgUrl() {\n\t\t$host = 'https://' . $_SERVER['HTTP_HOST'];\n\t\t//images come from qa7, when on dev3\n\t\tif(strpos($host, '.dev3')) {\n\t\t\t$host = str_replace('dev3', 'qa7', $host);\n\t\t}\n\n\t\treturn $host;\n\t}", "public function getBaseUrl()\n {\n return $this->imageHelper->getBaseUrl();\n }", "public function getBaseUrl()\n { \n return $this->_storeManager->getStore()->getBaseUrl(\n \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA\n ). 'images/' . self::MEDIA_PATH . '/';\n }", "public function getImageBaseURL() {\n return $this->_data['images']['base_url'];\n }", "public function getBaseUrl()\n {\n return Mage::getBaseUrl('media') . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY . '/';\n }", "static function urlToWebrootImg(){\r\n \t \r\n \treturn 'http://'.$_SERVER['SERVER_NAME'].'/'.Router::url('/').'/img/';\r\n }", "function getExternalUrl() {\n $path = str_replace('\\\\', '/', $this->getTarget());\n return url('shoov/images/' . $path, array('absolute' => TRUE));\n }", "public static function getImgBaseUri()\n {\n return '/modules/Ekom/img';\n }", "public static function getNoImageAbsPath()\n {\n return self::getSiteDirectoryBasePath(NO_IMAGE_PATH);\n }", "public function getUrl()\n {\n return self::IMAGE_BASE_URL . $this->_size . '/' . $this->_path;\n }", "public function getDefaultFileUrl()\n { \n return $this->baseUrl.'/default_image.png';\n }", "public function GetRelativeURL()\n {\n if (false === $this->_isThumbnail) {\n $sImageURL = $this->GetImageUrlPathPrefix().$this->aData['path'];\n } else {\n $sImageURL = URL_MEDIA_LIBRARY_THUMBS_PATH.$this->GetThumbPathExtension().'/'.$this->aData['path'];\n }\n $sImageURL = $this->addRefreshToken($sImageURL);\n\n return $sImageURL;\n }", "public function getImageURL()\n \t{\n \t\tglobal $_CMAPP;\n \t\n \t\t$url = \"\";\n \t\tswitch($this->method) {\n \t\tcase self::METHOD_DB:\n \t\t\t$url = \"$_CMAPP[media_url]/imagewrapper.php?method=db&frm_codeFile=\".$this->codeFile;\n \t\t\tbreak;\n \t\tcase self::METHOD_SESSION:\n \t\t\t$rand = rand(0,100000);\n \t\t\t$_SESSION['amadis']['imageview'][$rand] = serialize($this->imageObj) ;\n \t\t\t$url = \"$_CMAPP[media_url]/imagewrapper.php?method=session&frm_id=$rand\";\n \t\t\tbreak;\n \t\tcase self::METHOD_DEFAULT:\n \t\t\tif($this->thumb) $url = $_CMAPP['thumbs_url']. '/' . $this->imageObj;\n \t\t\telse $url = $_CMAPP['images_url'] . '/' . $this->imageObj;\n \t\t\tbreak;\n \t\t}\n \t\treturn $url;\n \t}", "public function getOGImageURL()\n {\n /** =========================================\n * @var OpenGraphSiteConfigExtension $siteConfig\n * ========================================*/\n\n $siteConfig = SiteConfig::current_site_config();\n\n if ($this->owner->OGImage() && $this->owner->OGImage()->exists()) {\n return $this->owner->OGImage()->Fit(1200, 630)->AbsoluteURL;\n } elseif ($firstImage = $this->owner->getFirstImage()) {\n return Controller::join_links(Director::absoluteBaseURL(), $firstImage);\n } elseif ($siteConfig->DefaultOpenGraphImage() && $siteConfig->DefaultOpenGraphImage()->exists()) {\n return $siteConfig->DefaultOpenGraphImage()->Fit(1200, 630)->AbsoluteURL;\n }\n\n return '';\n }", "public function getImageUrl(){\n return Url::to($this->detailDir.$this->pic); \n }", "function get_photo_base($file_name = null, $variables = []) {\n\t$url = get_file_base(Candidat::$photoPath, $file_name, $variables);\n\tif (!file_exists($url)) {\n\t\t$url = site_base('public/assets/static/candidat/no-photo.png');\n\t}\n\treturn $url;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When a configured field is missing from the table, an exception should be thrown
public function testMissingColumn() { $this->table->setPublishStatusField('foo'); $this->table->find('published'); }
[ "public function testGetValueWithInvalidFieldname()\n {\n $expected = null;\n $result = $this->db->getValue('settings', 'invalid');\n $this->assertSame($expected, $result);\n }", "private static function validateFieldsAreSet()\n\t{\n\t\tif(empty(static::$fields))\n\t\t{\n\t\t\tthrow new ActiveRecordException('No fields are set for ' . get_called_class() . '.');\n\t\t}\n\t}", "public function testReturnsFormatedValueWithANonexistentField() {\n\t\t\n\t\t$field = 'this_do_not_exists_in_schema';\n\t\t\n\t\t$value = uniqid();\n\t\t\n\t\t$results = $this->Query\n\t\t\t->onModel('OtherModel')\n\t\t\t->onField($field)\n\t\t\t->withValue($value)\n\t\t\t->returnsFormattedValue();\n\t\t\n\t\t$this->assertEquals($value, $results);\n\t\t\n\t}", "public function testGetUnknownPropertyWhenFieldsDefinedThrowsException()\n {\n TestActiveRecord1::setManager($this->manager);\n $ar = new TestActiveRecord1();\n $value = $ar->thisPropertyShouldNeverExist;\n }", "protected function fieldDoesNotExist($name)\n {\n throw new \\InvalidArgumentException('Field ['.$name.'] does not exist in '.get_class($this));\n }", "public function testSelectTableMissed()\n {\n try\n {\n self::$builder->fields(['first_name', 'last_name'])\n ->select()\n ->run();\n } catch (QueryBuilderException $exception)\n {\n return;\n }\n\n $this->fail(\n 'An expected exception has not been raised.'\n );\n }", "public function testHasFieldReturnsFalseForNonExistingField()\n {\n $flexModel = new FlexModel($this->defaultIdentifier);\n $flexModel->load($this->loadFlexModelTestFile(), $this->cacheDirectory);\n\n $this->assertFalse($flexModel->hasField('Test', 'non_existing'));\n }", "public function testCannotGetExtraField()\n {\n $this->expectException(\\InvalidArgumentException::class);\n\n $post = new Post();\n $post->getExtraField('');\n }", "public function fieldHasError($field);", "public function testColumnCanBeSetForInvalidColumn()\n {\n $builder = $this->getMockBuilder(Model::class);\n $instance = $builder->getMock();\n\n $instance->setField_1('foobar');\n $this->assertEquals('foobar', $instance->getField_1());\n }", "public function testFetchCustomFieldUnexistingField(): void\n {\n // setup\n $fieldsAlgorithms = new FieldsAlgorithms($this->getFields1(), 'entity');\n $record = [];\n\n // test body\n $result = $fieldsAlgorithms->fetchCustomField($record, 'unexisting');\n\n // assertions\n $this->assertEquals(0, count($result), 'Something was returned, but should not');\n }", "public function testFieldMissingType() {\n $this->expectException(PluginNotFoundException::class);\n $this->expectExceptionMessage(\"Unable to determine class for field type 'foo_field' found in the 'field.field.entity_test_mulrev.entity_test_mulrev.{$this->fieldName}' configuration\");\n $entity = EntityTestMulRev::create([\n 'name' => $this->randomString(),\n 'field_test_item' => $this->randomString(),\n $this->fieldName => $this->randomString(),\n ]);\n $entity->save();\n // Hack the field to use a non-existent field type.\n $this->config('field.field.entity_test_mulrev.entity_test_mulrev.' . $this->fieldName)->set('field_type', 'foo_field')->save();\n \\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();\n EntityTestMulRev::load($entity->id());\n }", "public function testInvalidFields() {\n // Unknown plugin.\n $bundle = $this->bundles[0];\n try {\n Og::CreateField('undefined_field_name', 'node', $bundle);\n $this->fail('Undefined field name was attached');\n }\n catch (\\Exception $e) {\n }\n\n // Field that can be attached only to a certain entity type, being attached\n // to another one.\n try {\n Og::CreateField('entity_restricted', 'user', 'user');\n $this->fail('Field was attached to a prohibited entity type.');\n }\n catch (\\Exception $e) {\n }\n }", "public function testHasAssociationWillReturnFalseForNonExistingField(): void\n {\n $metadata = new Metadata($this->classMetadata);\n\n $fieldName = 'testFieldName';\n\n $this->classMetadata->expects($this->once())\n ->method('hasAssociation')\n ->with($fieldName)\n ->willReturn(false);\n\n $this->assertFalse($metadata->hasAssociation($fieldName));\n }", "public function testGetFieldReturnsNullForNonExistingField()\n {\n $flexModel = new FlexModel($this->defaultIdentifier);\n $flexModel->load($this->loadFlexModelTestFile(), $this->cacheDirectory);\n\n $this->assertNull($flexModel->getField('Test', 'non_existing'));\n }", "public function testWrongFieldAddException3(): void\n {\n $datasource = new DataSource($this->createDriverMock());\n $this->expectException(DataSourceException::class);\n $datasource->addField('field');\n }", "public function testNonExistantFieldIsNeverRegistered()\n {\n $oTest = new _oxBase();\n $oTest->modifyCacheKey(\"nonExistantFieldTest\", true);\n $oTest->enableLazyLoading();\n $this->cleanTmpDir();\n $oTest->init('oxarticles');\n //trying to access the field\n $sTestValue = $oTest->oxarticles__oxnonexistantfield;\n\n //checking, should NOT be cached\n $sCacheKey = 'fieldnames_oxarticles_nonExistantFieldTest';\n $aFieldNames = oxRegistry::getUtils()->fromFileCache($sCacheKey);\n\n $this->assertFalse(isset($aFieldNames['nonexistantfield']));\n }", "public function testSettingInvalidColumnThrowsException()\n {\n $this->expectException(RuntimeException::class);\n $mockMetadata = $this->createMock(Metadata::class);\n $mockMetadata\n ->expects($this->once())\n ->method('prefix')\n ->with('field_1')\n ->willReturn('field_1')\n ;\n $mockMetadata\n ->expects($this->once())\n ->method('hasColumn')\n ->with('field_1')\n ->willReturn(false);\n $mockMetadata\n ->expects($this->never())\n ->method('primaryKey');\n $builder = $this->getMockBuilder(Model::class);\n $builder->setMethods(['metaData']);\n $instance = $builder->getMock();\n $instance\n ->expects($this->exactly(2))\n ->method('metaData')\n ->willReturn($mockMetadata)\n ;\n\n $instance->setField_1('foobar');\n }", "public function getFieldOrRelationNotExistsException($name)\n {\n return new TableException(\"'$name' is neither a field nor a relation on table '$this->tableName'!\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run textarea with iframe.
function vodi_sanitize_textarea_iframe( $var ) { $allowed_tags = wp_kses_allowed_html( 'post' ); // iframe $allowed_tags['iframe'] = array( 'src' => array(), 'height' => array(), 'width' => array(), 'frameborder' => array(), 'allowfullscreen' => array(), ); return wp_kses( $var, $allowed_tags ); }
[ "public function it_shows_textarea_input()\n {\n // configure\n $inputs = [\n [\n 'type' => 'textarea',\n 'name' => 'message'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('textarea')\n ->assertSee('message');\n }", "function textarea( $name, $label = FALSE, $args = array() ){\r\techo get_textarea( $name, $label, $args );\r}", "function pyis_dpd_helpscout_do_field_textarea( $args = array() ) {\n\tpyis_dpd_helpscout_fieldhelpers()->fields->do_field_textarea( $args['name'], $args );\n}", "public function testValidateForTextarea()\n {\n $employ_code = $this->makeData()->employ_code;\n\n $this->browse(function (Browser $browser) use ($employ_code) {\n $browser->loginAs($this->user)\n ->visit('admin/books/create')\n ->resize(900, 1000)\n ->type('title', 'Title for book')\n ->type('price', '1000')\n ->type('author', 'Cao Nguyen V.')\n ->type('year', '1995')\n ->type('from_person', $employ_code)\n ->type('page_number', '200');\n \n\n $this->fillTextArea('.wysihtml5-sandbox', $browser, '');\n\n $browser->press('Create')\n ->assertSee('The description field is required.');\n });\n }", "function BCMH_settings_field_sample_textarea() {\n\t$options = BCMH_get_theme_options();\n\t?>\n\t<textarea class=\"large-text\" type=\"text\" name=\"BCMH_theme_options[sample_textarea]\" id=\"sample-textarea\" cols=\"50\" rows=\"10\" /><?php echo esc_textarea( $options['sample_textarea'] ); ?></textarea>\n\t<label class=\"description\" for=\"sample-textarea\"><?php _e( 'Sample textarea', 'BCMH' ); ?></label>\n\t<?php\n}", "public function textarea()\n {\n return $this->content(false, false, false, true);\n }", "function syntax_textarea($name = 'textarea', $syntax = 'html', $columns = '80', $rows = '15', $encoding = '', $content = '', $stylesheet = '', $addtext = '');", "function tlspi_make_text_area() { ?>\n\t<div class=\"wrap\"> \n\t\t<h1>The La Source Newspaper Post Importer</h1> \n \n\t\t<form method=\"post\" action=\"\"> \n\t\t\t<label>copy and paste document here... <br />\n\t\t\t<textarea rows=\"60\" cols=\"100\" name=\"preview\" id=\"code\" ></textarea> </label>\n\t\t\t\n\t\t\t<br> \n\t\t\t<input type =\"submit\" value=\"Preview\" name=\"submit\" class=\"button-primary\"> \n\t\t\t<br>\n\t\t</form> <br> \n\t\t<script>\n\t\t\tvar editor = CodeMirror.fromTextArea(document.getElementById(\"code\"), {\n\t\t\t\tmode: { name: \"xml\", alignCDATA: true},\n\t\t\t\tlineNumbers: true\n\t\t\t});\n\t\t</script>\n\t</div>\n<?php\n}", "function handle_legacy_widget_preview_iframe()\n {\n }", "public function test_input_field_textarea()\n\t{\n\t\t$id = '';\n\t\t$value = '';\n\t\t$rows = '';\n\t\t$cols = '';\n\t\t$style = '';\n\t\t$readonly = true;\n\t\t$parameters = array($id, $value, $rows, $cols, $style, $readonly);\n $msg = self::invokeMethod('LiteSpeed_Cache_Admin_Display','input_field_textarea', $parameters);\n\t\t$bool = self::isString($msg);\n \t$this->assertTrue($bool);\t\t\n \t\n\t}", "function print_wysiwyg_editor($fieldname = '', $text = '', $instanceid = 'bbeditor', $enablewysiwyg = '1', $showswitchmode = '1', $ishtml = false, $width = '', $height = '')\n{\n global $ilance, $myapi, $ilconfig, $phrase, $headinclude, $show;\n \n $cssclass = 'ilance_wysiwyg';\n \n $show['footerwysiwygpopup'] = true;\n \n if (isset($text))\n { // bbcode coming from db or preview\n $text = htmlspecialchars_uni($text);\n }\n \n $html = '';\n if ($instanceid == 'bbeditor')\n {\n // we'll only show one css style since there may be multiple instances of the bbeditor being loaded on same page\n $headinclude .= '\n<style id=\"wysiwyg_html\" type=\"text/css\">\n<!--\n' . $ilance->styles->css_cache['csswysiwyg'] . '\n//-->\n</style>\n';\n }\n \n$html .= '<div class=\"' . $cssclass . '\"><textarea style=\"visibility: hidden; position: absolute; top: 0; left: 0;\" name=\"' . $fieldname . '\" id=\"' . $fieldname . '_id\" rows=\"1\" cols=\"1\" tabindex=\"2\">' . $text . '</textarea>';\nif ($instanceid == 'bbeditor')\n{\n $headinclude .= '\n<script type=\"text/javascript\" language=\"Javascript\">\n<!--\nvar view_richtext = ' . (int)$enablewysiwyg . ';\nvar show_switch = ' . (int)$showswitchmode . ';\nvar show_mode_editor = ' . (int)$showswitchmode . ';\nif (view_richtext == 0)\n{\n show_mode_editor = 0;\n}\n//-->\n</script>\n<script type=\"text/javascript\" src=\"' . $ilconfig['template_relativeimagepath'] . DIR_FUNCT_NAME . '/javascript/functions_wysiwyg.js\"></script>';\n}\n$html .= '\n<script type=\"text/javascript\" language=\"Javascript\">\n<!--';\nif ($instanceid == 'bbeditor')\n{\n $html .= '\nfunction fetch_bbeditor_data()\n{\n prepare_bbeditor_wysiwygs(); \n var bbcode_output = fetch_js_object(\\'bbeditor_bbcode_ouput_' . $instanceid . '\\').value;\n fetch_js_object(\\'' . $fieldname . '_id\\').value = bbcode_output;\n}\n';\n}\nelse\n{\n $html .= '\nfunction fetch_bbeditor_data_' . $instanceid . '()\n{\n prepare_bbeditor_wysiwygs(); \n var bbcode_output = fetch_js_object(\\'bbeditor_bbcode_ouput_' . $instanceid . '\\').value;\n fetch_js_object(\\'' . $fieldname . '_id\\').value = bbcode_output;\n}\n';\n}\n$html .= '\nvar bbcodetext = fetch_js_object(\\'' . $fieldname . '_id\\').value;\nprint_wysiwyg_editor(\\'max\\', \\'' . $instanceid . '\\', bbcodetext, \\'100%\\', \\'250px\\');\n//-->\n</script></div>';\n \n ($apihook = $ilance->api('print_wysiwyg_editor_end')) ? eval($apihook) : false;\n \n return $html;\n}", "public function renderFormDhtmlTextArea(\\XoopsFormDhtmlTextArea $element)\n {\n static $js_loaded;\n\n xoops_loadLanguage('formdhtmltextarea');\n $ret = '';\n // actions\n $ret .= $this->renderFormDhtmlTAXoopsCode($element) . \"<br>\\n\";\n // fonts\n $ret .= $this->renderFormDhtmlTATypography($element);\n // length checker\n\n $ret .= \"<br>\\n\";\n // the textarea box\n $ret .= \"<textarea class='form-control' id='\"\n . $element->getName()\n . \"' name='\"\n . $element->getName()\n . \"' title='\"\n . $element->getTitle()\n . \"' onselect=\\\"xoopsSavePosition('\"\n . $element->getName()\n . \"');\\\" onclick=\\\"xoopsSavePosition('\"\n . $element->getName()\n . \"');\\\" onkeyup=\\\"xoopsSavePosition('\"\n . $element->getName()\n . \"');\\\" cols='\"\n . $element->getCols()\n . \"' rows='\"\n . $element->getRows()\n . \"'\"\n . $element->getExtra()\n . '>'\n . $element->getValue()\n . \"</textarea>\\n\";\n\n if (empty($element->skipPreview)) {\n if (empty($GLOBALS['xoTheme'])) {\n $element->js .= file_get_contents(XOOPS_ROOT_PATH . '/class/textsanitizer/image/image.js');\n } else {\n $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', ['type' => 'text/javascript']);\n }\n $button = \"<button type='button' class='btn btn-primary' onclick=\\\"form_instantPreview('\"\n . XOOPS_URL\n . \"', '\"\n . $element->getName()\n . \"','\"\n . XOOPS_URL\n . \"/images', \"\n . (int)$element->doHtml\n . \", '\"\n . $GLOBALS['xoopsSecurity']->createToken()\n . \"')\\\" title='\"\n . _PREVIEW\n . \"'>\"\n . _PREVIEW\n . '</button>';\n\n $ret .= '<br>' . \"<div id='\" . $element->getName() . \"_hidden' style='display: block;'> \" . ' <fieldset>' . ' <legend>' . $button . '</legend>' . \" <div id='\" . $element->getName() . \"_hidden_data'>\" . _XOOPS_FORM_PREVIEW_CONTENT . '</div>' . ' </fieldset>' . '</div>';\n }\n // Load javascript\n if (empty($js_loaded)) {\n $javascript = ($element->js ? '<script type=\"text/javascript\">' . $element->js . '</script>' : '') . '<script type=\"text/javascript\" src=\"' . XOOPS_URL . '/include/formdhtmltextarea.js\"></script>';\n $ret = $javascript . $ret;\n $js_loaded = true;\n }\n\n return $ret;\n }", "public function addTextarea($args) {\r\n\t\t$default = array(\r\n\t\t\t'rows' => 5,\r\n\t\t\t'cols' => 30,\r\n\t\t\t'width' => 500,\r\n\t\t);\r\n\t\t$args = array_merge($default, $args);\r\n\t\t$args['type'] = 'textarea';\r\n\t\t$this->addField($args);\r\n\t}", "function iframe($id){\r\n\t\t//$this->set(\"id\",$id);\r\n\t\t$this->Widget->id = $id;\r\n\t\t$widg = $this->Widget->read();\r\n\t\t//$output = array(\"name\"=>$widg['Widget']['name'], \"widgetcode\"=>$widg['Widget']['admin_xhtml'], \"id\"=>$widg['Widget']['id'], \"type\"=>$widg['Widget']['type'] );\r\n\t\t$this->set('output',$widg['Widget']['admin_xhtml']);\r\n\t\t$this->render('iframe','ajax');\r\n\t}", "function instant_ide_file_editor_console() {\n\t\n\t// Include the console configuration file.\n\tif ( file_exists( IIDE_DIR . '/console/includes/console-config.php' ) )\n\t\trequire_once( IIDE_DIR . '/console/includes/console-config.php' );\n \n $console_file = instant_ide_get_console_file( IIDE_DIR . '/console' );\n?>\n <div id=\"instant-ide-file-editor-console-container\">\n <script type=\"text/javascript\">\n var console_iframe = '<iframe id=\"instant-ide-file-editor-console\" src=\"<?php echo IIDE_URL; ?>console/<?php echo $console_file; ?>?<?php echo IIDE_NL_CON_PASS; ?>\"></iframe>';\n </script>\n </div>\n<?php\n\t\n}", "public function iframe()\n\t{\n\t\tlog_message('debug', 'iframe view controller started');\n\t\t\n\t\tif (!isset($this->subdomain))\n\t\t{\n\t\t\tshow_error('Iframe view should be launched from a survey subdomain', 404);\n\t\t\treturn;\n\t\t}\n\t\tif (!$this->Survey_model->is_launched_survey())\n\t\t{\n\t\t\tshow_error('This survey has not been launched in enketo', 404);\n\t\t\treturn;\n\t\t}\n\t\tif ($this->Survey_model->has_offline_launch_enabled())\n\t\t{\n\t\t\treturn show_error('The iframe view can only be launched in offline mode', 404);\n\t\t}\n\t \n\t\t$form = $this->_get_form();\n\n\t\tif ($form === FALSE)\n\t\t{\n\t\t\treturn show_error('Could not find server url and/or form ID in enketo database.', 404);\t\n\t\t}\n\t\t\n\t\tif ($form === NULL)\n\t\t{\n\t\t\treturn show_error('An error occurred during transformation or processing instances. ', 404);\n\t\t}\n\t\n\t\t$data = array\n\t\t(\n\t\t\t'title_component'=>'webform iframe', \n\t\t\t'html_title'=> $form->title,\n\t\t\t'form'=> $form->html,\n\t\t\t'form_data'=> $form->default_instance,\n\t\t\t'form_data_to_edit' => NULL,\n\t\t\t'return_url' => NULL,\n\t\t\t'stylesheets'=> $this->default_stylesheets\n\t\t);\n\n\t\tif (ENVIRONMENT === 'production')\n\t\t{\n\t\t\t$data['scripts'] = array\n\t\t\t(\n\t\t\t\t'/libraries/libraries-all-min.js',\n\t\t\t\t'/js-min/webform-iframe-all-min.js'\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\t\t\n\t\t\t$data['scripts'] = array_merge\n\t\t\t(\n\t\t\t\t$this->default_library_scripts,\n\t\t\t\t$this->default_main_scripts,\n\t\t\t\tarray\n\t\t\t\t(\n\t\t\t\t\t'/js-source/webform_iframe.js'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t$this->load->view('webform_basic_view',$data);\n\t}", "function fbWriteTextarea($areaname, $html, $width, $height, $useRte, $emoticons)\r\n {\r\n // well $html is the $message to edit, generally it means in PLAINTEXT @FireBoard!\r\n global $editmode;\r\n // ERROR: mixed global $editmode\r\n global $fbConfig;\r\n\r\n // (JJ) JOOMLA STYLE CHECK\r\n if ($fbConfig->joomlastyle < 1) {\r\n $boardclass = \"fb_\";\r\n }\r\n ?>\r\n\r\n <tr class = \"<?php echo $boardclass; ?>sectiontableentry1\">\r\n <td class = \"fb_leftcolumn\" valign = \"top\">\r\n <strong><a href = \"<?php echo sefRelToAbs(JB_LIVEURLREL.'&amp;func=faq').'#boardcode';?>\"><?php echo _COM_BOARDCODE; ?></a></strong>:\r\n </td>\r\n\r\n <td>\r\n <table border = \"0\" cellspacing = \"0\" cellpadding = \"0\" class = \"fb-postbuttonset\">\r\n <tr>\r\n <td class = \"fb-postbuttons\">\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"b\" name = \"addbbcode0\" value = \" B \" style = \"font-weight:bold; \" onclick = \"bbstyle(0)\" onmouseover = \"helpline('b')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"i\" name = \"addbbcode2\" value = \" i \" style = \"font-style:italic; \" onclick = \"bbstyle(2)\" onmouseover = \"helpline('i')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"u\" name = \"addbbcode4\" value = \" u \" style = \"text-decoration: underline;\" onclick = \"bbstyle(4)\" onmouseover = \"helpline('u')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"q\" name = \"addbbcode6\" value = \"Quote\" onclick = \"bbstyle(6)\" onmouseover = \"helpline('q')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"c\" name = \"addbbcode8\" value = \"Code\" onclick = \"bbstyle(8)\" onmouseover = \"helpline('c')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"k\" name = \"addbbcode10\" value = \"ul\" onclick = \"bbstyle(10)\" onmouseover = \"helpline('k')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"o\" name = \"addbbcode12\" value = \"ol\" onclick = \"bbstyle(12)\" onmouseover = \"helpline('o')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"l\" name = \"addbbcode18\" value = \"li\" onclick = \"bbstyle(18)\" onmouseover = \"helpline('l')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"p\" name = \"addbbcode14\" value = \"Img\" onclick = \"bbstyle(14)\" onmouseover = \"helpline('p')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"w\" name = \"addbbcode16\" value = \"URL\" style = \"text-decoration: underline; \" onclick = \"bbstyle(16)\" onmouseover = \"helpline('w')\"/>\r\n\r\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"h\" name = \"addbbcode24\" value = \"Hide\" onclick = \"bbstyle(20)\" onmouseover = \"helpline('h')\"/>\r\n\r\n &nbsp;<?php echo _SMILE_COLOUR; ?>:\r\n\r\n <select name = \"addbbcode20\"\r\n onchange = \"bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');\" onmouseover = \"helpline('s')\" class = \"<?php echo $boardclass;?>slcbox\">\r\n <option style = \"color:black; background-color: #FAFAFA\" value = \"\"><?php echo _COLOUR_DEFAULT; ?></option>\r\n\r\n <option style = \"color:#FF0000; background-color: #FAFAFA\" value = \"#FF0000\"><?php echo _COLOUR_RED; ?></option>\r\n\r\n <option style = \"color:#800080; background-color: #FAFAFA\" value = \"#800080\"><?php echo _COLOUR_PURPLE; ?></option>\r\n\r\n <option style = \"color:#0000FF; background-color: #FAFAFA\" value = \"#0000FF\"><?php echo _COLOUR_BLUE; ?></option>\r\n\r\n <option style = \"color:#008000; background-color: #FAFAFA\" value = \"#008000\"><?php echo _COLOUR_GREEN; ?></option>\r\n\r\n <option style = \"color:#FFFF00; background-color: #FAFAFA\" value = \"#FFFF00\"><?php echo _COLOUR_YELLOW; ?></option>\r\n\r\n <option style = \"color:#FF6600; background-color: #FAFAFA\" value = \"#FF6600\"><?php echo _COLOUR_ORANGE; ?></option>\r\n\r\n <option style = \"color:#000080; background-color: #FAFAFA\" value = \"#000080\"><?php echo _COLOUR_DARKBLUE; ?></option>\r\n\r\n <option style = \"color:#825900; background-color: #FAFAFA\" value = \"#825900\"><?php echo _COLOUR_BROWN; ?></option>\r\n\r\n <option style = \"color:#9A9C02; background-color: #FAFAFA\" value = \"#9A9C02\"><?php echo _COLOUR_GOLD; ?></option>\r\n\r\n <option style = \"color:#A7A7A7; background-color: #FAFAFA\" value = \"#A7A7A7\"><?php echo _COLOUR_SILVER; ?></option>\r\n </select>\r\n\r\n &nbsp;<?php echo _SMILE_SIZE; ?>:\r\n\r\n <select name = \"addbbcode22\" onchange = \"bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')\" onmouseover = \"helpline('f')\" class = \"<?php echo $boardclass;?>button\">\r\n <option value = \"1\"><?php echo _SIZE_VSMALL; ?></option>\r\n\r\n <option value = \"2\"><?php echo _SIZE_SMALL; ?></option>\r\n\r\n <option value = \"3\" selected = \"selected\"><?php echo _SIZE_NORMAL; ?></option>\r\n\r\n <option value = \"4\"><?php echo _SIZE_BIG; ?></option>\r\n\r\n <option value = \"5\"><?php echo _SIZE_VBIG; ?></option>\r\n </select>\n\n\t\t\t\t\t<?php if ($fbConfig->showspoilertag) {?>\n <script type=\"text/javascript\">\n\t\t\t\t\t\tfunction fb_spoiler_help() {document.postform.helpbox.value = 'Spoiler: [spoiler] ... [/spoiler]';}\n\t\t\t\t\t</script>\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"s\" name = \"addbbcode40\" value = \"Spoiler\" onclick = \"bbfontstyle('[spoiler]', '[/spoiler]')\" onmouseover = \"fb_spoiler_help()\"/>\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<?php if ($fbConfig->showebaytag) {?>\n <script type=\"text/javascript\">\n\t\t\t\t\t\tfunction fb_ebay_help() {document.postform.helpbox.value = 'eBay: [ebay]ItemId[/ebay]';}\n\t\t\t\t\t</script>\n <input type = \"button\" class = \"<?php echo $boardclass;?>button\" accesskey = \"e\" name = \"addbbcode30\" value = \"eBay\" onclick = \"bbfontstyle('[ebay]', '[/ebay]')\" onmouseover = \"fb_ebay_help()\"/>\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<?php if ($fbConfig->showvideotag) {?>\n &nbsp;<span style=\"white-space:nowrap;\">\r\n\t\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t\tfunction fb_vid_help1() {document.postform.helpbox.value = 'Video: [video type=provider size=100 width=480 height=360]xyz[/video]';}\r\n\t\t\t\t\t\tfunction fb_vid_help2() {document.postform.helpbox.value = 'Video: [video size=100 width=480 height=360]http://myvideodomain.com/myvideo[/video]';}\r\n\t\t\t\t\t</script>\r\n\t\t\t\t\t<a href = \"javascript: bbfontstyle('[video]', '[/video]')\" onmouseover = \"fb_vid_help2()\">Video:</a>\r\n\t\t\t\t\t<select name = \"fb_vid_code1\" onchange = \"bbfontstyle('[video type=' + this.form.fb_vid_code1.options[this.form.fb_vid_code1.selectedIndex].value, '[/video]');\" onmouseover = \"fb_vid_help1()\" class = \"<?php echo $boardclass;?>button\">\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$vid_provider = array('','AnimeEpisodes','Biku','Bofunk','Break','Clip.vn','Clipfish','Clipshack','Collegehumor','Current',\r\n\t\t\t\t\t\t\t'DailyMotion','DivX,divx]http://','DownloadFestival','Flash,flash]http://','FlashVars,flashvars param=]http://','Fliptrack',\r\n\t\t\t\t\t\t\t'Fliqz','Gametrailers','Gamevideos','Glumbert','GMX','Google','GooglyFoogly','iFilm','Jumpcut','Kewego','LiveLeak','LiveVideo',\r\n\t\t\t\t\t\t\t'MediaPlayer,mediaplayer]http://','MegaVideo','Metacafe','Mofile','Multiply','MySpace','MyVideo','QuickTime,quicktime]http://','Quxiu',\r\n\t\t\t\t\t\t\t'RealPlayer,realplayer]http://','Revver','RuTube','Sapo','Sevenload','Sharkle','Spikedhumor','Stickam','Streetfire','StupidVideos','Toufee','Tudou',\r\n\t\t\t\t\t\t\t'Unf-Unf','Uume','Veoh','VideoclipsDump','Videojug','VideoTube','Vidiac','VidiLife','Vimeo','WangYou','WEB.DE','Wideo.fr','YouKu','YouTube');\r\n\t\t\t\t\t\tforeach($vid_provider as $vid_type) {\r\n\t\t\t\t\t\t\tlist($vid_name, $vid_type) = explode(',', $vid_type);\r\n\t\t\t\t\t\t\techo '<option value = \"'.(($vid_type)?$vid_type:strtolower($vid_name).']').'\">'.$vid_name.'</option>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t</select></span>\r\n\t\t\t\t\t<?php } ?>\n\r\n &nbsp;&nbsp;<a href = \"javascript: bbstyle(-1)\"onmouseover = \"helpline('a')\"><small><?php echo _BBCODE_CLOSA; ?></small></a>\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <td class = \"<?php echo $boardclass;?>posthint\">\r\n <input type = \"text\" name = \"helpbox\" size = \"45\" class = \"<?php echo $boardclass;?>inputbox\" maxlength = \"100\" value = \"<?php echo _BBCODE_HINT;?>\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n\r\n <tr class = \"<?php echo $boardclass; ?>sectiontableentry2\">\r\n <td valign = \"top\" class = \"fb_leftcolumn\">\r\n <strong><?php echo _MESSAGE; ?></strong>:\r\n\r\n <?php\r\n if ($emoticons != 1)\r\n {\r\n ?>\r\n\r\n <br/>\r\n\r\n <br/>\r\n\r\n <div align = \"right\">\r\n <table border = \"0\" cellspacing = \"3\" cellpadding = \"0\">\r\n <tr>\r\n <td colspan = \"4\" style = \"text-align: center;\">\r\n <strong><?php echo _GEN_EMOTICONS; ?></strong>\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <?php\r\n generate_smilies(); //the new function Smiley mod\r\n ?>\r\n </tr>\r\n </table>\r\n </div>\r\n\r\n <?php\r\n }\r\n ?>\r\n </td>\r\n\r\n <td valign = \"top\">\r\n <textarea class = \"<?php echo $boardclass;?>txtarea\" name = \"<?php echo $areaname;?>\" id = \"<?php echo $areaname;?>\"><?php echo htmlspecialchars($html, ENT_QUOTES); ?></textarea>\r\n<?php\r\nif ($editmode) {\r\n // Moderator edit area\r\n ?>\r\n <fieldset>\r\n <legend><?php echo _FB_EDITING_REASON?></legend>\r\n <input name=\"modified_reason\" size=\"40\" maxlength=\"200\" type=\"text\"><br />\r\n\r\n </fieldset>\r\n<?php\r\n}\r\n?>\r\n </td>\r\n </tr>\r\n\r\n<?php\r\n }", "function nn_wysiwyg(){\n\t\t\n\t\t$options = get_option('nn_sub_general_options');\n\t\tif(!isset($options['nn_wp_edit'])) $options['nn_wp_edit'] = '';\n\t\t$wysiwyg_settings = array('textarea_name' => 'nn_sub_general_options[nn_wp_edit]', 'media_buttons' => false);\n\t\t$wysiwyg_content = $options['nn_wp_edit'];\n\t\t$wysiwyg_id = 'nn_wp_edit';\n\t\twp_editor( $wysiwyg_content, $wysiwyg_id, $wysiwyg_settings );\n\t}", "function islamic_center_print_tinymce_editor(){\n\t\t\t\twp_editor( islamic_center_stopbackslashes($_POST['content']), \n\t\t\t\t\t$_POST['id'], array('textarea_name'=> $_POST['name']) );\t\t\t\n\t\t\t\tdie();\n\t\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
actionMigrations [View migration file info].
public function actionMigrations() { $jsonPath = craft()->config->get('modelsPath', 'theArchitect'); $masterJson = $jsonPath.'_master_.json'; if (file_exists($masterJson)) { $exportTime = filemtime($masterJson); } else { $exportTime = null; } if (file_exists($masterJson)) { list($dbAddedIDs, $dbUpdatedIDs, $dbDeleteIDs, $modelAddedIDs, $modelUpdatedIDs, $modelDeleteIDs) = craft()->theArchitect->getAddedUpdatedDeletedIds(file_get_contents($masterJson)); } $variables = array( 'automation' => craft()->theArchitect->getAutomation(), 'exportTime' => $exportTime, 'importTime' => craft()->theArchitect->getLastImport(), 'apiKey' => craft()->theArchitect->getAPIKey(), 'jsonPath' => $jsonPath, 'mismatch' => craft()->theArchitect->compareMigrationConstruct(), 'dbAdditions' => (isset($dbAddedIDs)) ? $dbAddedIDs : null, 'dbUpdates' => (isset($dbUpdatedIDs)) ? $dbUpdatedIDs : null, 'dbDeletions' => (isset($dbDeleteIDs)) ? $dbDeleteIDs : null, 'modelAdditions' => (isset($modelAddedIDs)) ? $modelAddedIDs : null, 'modelUpdates' => (isset($modelUpdatedIDs)) ? $modelUpdatedIDs : null, 'modelDeletions' => (isset($modelDeleteIDs)) ? $modelDeleteIDs : null, ); craft()->templates->includeCssResource('thearchitect/css/thearchitect.css'); craft()->templates->includeJsResource('thearchitect/js/clipboard.min.js'); craft()->templates->includeJs('var clipboard = new Clipboard("[data-clipboard-text]");clipboard.on("success",function(){Craft.cp.displayNotice("Copied to clipboard!");});clipboard.on("error",function(){Craft.cp.displayError("Error copying to clipboard.");});'); $this->renderTemplate('thearchitect/migrations', $variables); }
[ "public function actionMigrate()\n {\n $action = Yii::$app->request->get('action');\n if(is_null($action)) {\n throw new BadRequestHttpException(\"Action parameter required\");\n } else if($action !== 'up' && $action !== 'down') {\n throw new HttpException(\"Action not found\");\n }\n\n $oldApp = Yii::$app;\n new Application([\n 'id' => 'yii-web-console',\n 'basePath' => '@app',\n 'bootstrap' => ['log'],\n 'components' => [\n 'db' => $oldApp->db,\n 'cache' => [\n 'class' => 'yii\\caching\\FileCache',\n ],\n 'log' => [\n 'targets' => [\n [\n 'class' => 'yii\\log\\FileTarget',\n 'levels' => ['error', 'warning'],\n ],\n ],\n ],\n ],\n ]);\n Yii::setAlias('@migrations', '@app/migrations/');\n $migrateAction = 'migrate/' . $action;\n Yii::$app->runAction($migrateAction, ['migrationPath' => '@migrations', 'interactive' => false]);\n Yii::$app = $oldApp;\n }", "public function getMigrations();", "public function show_migrated_files() {\n\n if($this->is_table_exist()) {\n\n $migrated_version_list = $this->get_migrated_version_list();\n\n if(empty($migrated_version_list)) {\n echo \"No migration executed so far. \\n\";\n }\n Utility::show_list($this->get_migrated_version_list());\n }\n }", "protected function showMigrationsList()\n {\n $totalItems = 0;\n\n $table = new Table($this->getOutput());\n $table->setHeaders([\n 'ID', 'Description', 'Date', 'Status'\n ]);\n\n $tableStyle = new TableStyle();\n $tableStyle->setCellHeaderFormat('%s');\n $table->setStyle($tableStyle);\n\n $migrations = new Migrations($this);\n $appliedMigrations = $migrations->getAppliedMigrations();\n $notAppliedMigrations = $migrations->getNotAppliedMigrations();\n\n $migrationsList = array_merge($appliedMigrations, $notAppliedMigrations);\n ksort($migrationsList);\n\n $migrationsPath = Configuration::getInstance()->getPathToMigrations();\n $missingFiles = 0;\n\n foreach ($migrationsList as $migration) {\n $totalItems++;\n $pathToMigrationFile = $migrationsPath . '/' . $migration['id'] . '.mgr';\n\n if ($migration['applied']) {\n $isCurrent = isset($migration['current']) && $migration['current'] === true;\n $migrationFileExists = file_exists($pathToMigrationFile);\n\n if (!$migrationFileExists) {\n $missingFiles++;\n }\n\n $status = $isCurrent ? '<-- Current --' : ' ';\n if (!$migrationFileExists) {\n $status = '<fg=red>x-- Not Found --</>';\n }\n\n $table->addRow([\n ($isCurrent ? '<fg=green>' : '') . $migration['id'] . ($isCurrent ? '</>' : ''),\n $migration['name'],\n date('d M Y', $migration['ts']),\n $status\n ]);\n } else {\n $totalItems++;\n $parser = new MigrationFileParser($pathToMigrationFile);\n $description = $parser->getDescription();\n $ts = $parser->getTimestamp();\n\n $table->addRow([\n '<fg=cyan>' . $migration['id'] . '</>',\n '<fg=cyan>' . $description . '</>',\n '<fg=cyan>' . ($ts > 0 ? date('d M Y', $ts) : '') . '</>',\n '<fg=cyan>x-- Not applied --</>',\n ]);\n unset($parser);\n }\n }\n\n if ($totalItems > 0) {\n $this->report('<options=bold>Applied Migrations</>');\n $table->render();\n\n if ($missingFiles > 0) {\n $this->report('');\n $this->report('<error>Missing Migration Files</error>');\n $this->report('Some migration files are missing. This usually can happen if you switch to a different version in GIT where some migrations are not available yet.');\n $this->report('You should run \"voyage reset\", this command will rollback database to it\\'s initial state and then will apply all available migration files.');\n $this->report('');\n }\n } else {\n $this->report('There\\'re no applied migrations. Run \"voyage make\" to create the first migration.');\n }\n unset($migrations);\n }", "public function actionMigrate($migrate)\n {\n // $migration->run('up', ['migrationPath' => $migrate, 'interactive' => false]);\n return $this->render('install\\\\dbInstall', ['migrate'=>$migrate]);\n }", "public function lists(){\n print_r($this->migration->find_migrations());\n }", "public function actionRunMigrations()\n {\n header('Content-Type: application/json');\n \n $response = $this->runMigrationTool(Yii::app()->session['dsn']);\n \n $data = array('migrated' => false, 'details' => $response);\n \n if (strpos($response, 'Migrated up successfully.') || strpos($response, 'Your system is up-to-date.'))\n $data = array('migrated' => true, 'details' => $response);\n \n echo CJavaScript::jsonEncode($data);\n Yii::app()->end();\n }", "public function action_up_migration_get()\n {\n $this->load->library('migration');\n $this->migration->current();\n }", "public function view_migration(){\n\t\t\n\t\t$post = $this->input->post();\n $filename = render_migration_filename($post['type'], $post['name']);\n $filecontent = render_migration_content($post['type'],$post['name'],$post['columns']);\n echo \"<br><br><b> Will generate $filename </b><br><br>\";\n echo '<div id=\"file-preview\">';\n highlight_string($filecontent);\n echo '</div>';\n\t}", "public function actionIndex()\n {\n if (!$this->confirm('Create migration files for all database tables?')) {\n return;\n }\n\n $tables = Yii::$app->db->schema->getTableSchemas();\n\n foreach ($tables as $table) {\n $this->createSchemaMigration($table);\n }\n\n foreach ($tables as $table) {\n $this->createFKMigration($table);\n }\n }", "public function getMigration();", "protected function writeMigrations()\n {\n $files = $this->migrator->create($this->options);\n\n foreach($files as $file)\n {\n $path = pathinfo($file, PATHINFO_FILENAME);\n $this->line(\" <fg=green;options=bold>create</fg=green;options=bold> $path\");\n }\n }", "public function getMigrations()\n {\n return $this->migrations;\n }", "function generateMigration()\n {\n $content = $this->getAssetFile('Migration');\n $content = $this->replace($content,\n ['{package}', \"{table_name}\"],\n [$this->getGeneratedMigrationName(), $this->getGeneratedMigrationName(true)]);\n file_put_contents($this->getDatabasesPath() . $this->fileSeparator() . $this->getMigrationName() . '.php', $content);\n $this->printConsole($msg ?? \"< Migration > generated successfully\");\n }", "public function migration(){}", "private function publishMigrations(): void\n {\n static $migrations = [\n '0000_00_00_000000_create_scout_database_words_table.php' => '_create_scout_database_words_table.php',\n '0000_00_00_000001_create_scout_database_documents_table.php' => '_create_scout_database_documents_table.php',\n '0000_00_00_000002_create_scout_database_index_table.php' => '_create_scout_database_index_table.php',\n ];\n\n $index = 0;\n foreach ($migrations as $originalName => $targetSuffix) {\n // Migration files are only published if no migration files with similar names exist already.\n if (count(glob(database_path(\"migrations/*{$targetSuffix}\"))) === 0) {\n $this->publishes([\n __DIR__.\"/../migrations/{$originalName}\" => database_path('migrations/'.date('Y_m_d_His', time()+$index).$targetSuffix),\n ], 'migrations');\n\n $index++;\n }\n }\n }", "protected function callMigrate(): void\n {\n if ($this->confirm('Migrate the database?')) {\n $this->call('migrate');\n }\n }", "protected function loadMigrations()\n {\n $migrations = sfFinder::type('file')->name('/^\\d{3}.*\\.php$/')->maxdepth(0)->in($this->getMigrationsDir());\n sort($migrations);\n foreach($migrations as $migration)\n {\n $this->migrations[current(explode('_', basename($migration), 2))] = $migration;\n }\n \n // grab \n }", "public function touchAction()\n {\n $this->output->info('Creating an upgrade file...');\n\n $schemaDir = project_root($this->config->path('application.schemaDir'));\n $fileName = (new DateTime())->format('YmdHis') .'.sql';\n\n if (touch($schemaDir . $fileName)) {\n $this->output->darkGray($fileName . ' created.');\n return;\n }\n\n $this->output->red('File creation error, please check permissions.');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recibe el titulo de un ambiente y busca por el en la base de datos
function buscarPorTitulo($titulo) { $query = "SELECT * FROM ambiente WHERE titulo LIKE '".$titulo."';"; $database = new Database(); $resultado = $database->getConn()->query($query); $arr = array(); while ($row = $resultado->fetch(PDO::FETCH_ASSOC)) { $ambiente = new ambiente(); $ambiente->id=$row["id_Ambiente"]; $ambiente->titulo=$row["titulo"]; $ambiente->descripcion=$row["descripcion"]; $ambiente->enUso=$row["enUso"]; array_push($arr, $ambiente); } $paraDevolver = json_encode($arr); return $paraDevolver; }
[ "public function titulo($titulo) {\n $db = new MySQL(Router::getDefaultConexion());\n $sql = \"SELECT * FROM `aplicacion_cargos` \"\n . \"WHERE `titulo`='\" . $titulo . \"';\";\n $consulta = $db->sql_query($sql);\n $fila = $db->sql_fetchrow($consulta);\n $db->sql_close();\n return($fila);\n }", "public function buscarTitulo($titulo)\n {\n \n $libro = DB::table('libros')->where('titulo', $titulo)->get();\n $result = json_decode($libro, true);\n $respuesta = array();\n\n $autor = Autor::find($result [0][\"autor_id\"]);\n $genero= Genero::find($result [0] [\"genero_id\"]);\n\n $respuesta [\"id\"] = $result [0] [\"id\"];\n $respuesta [\"titulo\"] = $result [0][\"titulo\"];\n $respuesta [\"anno\"] = $result [0] [\"anno\"];\n $respuesta [\"autor\"] = $autor;\n $respuesta [\"genero\"] = $genero;\n \n\n if (!isset($libro)) {\n $datos = [\n 'errors' => true,\n 'msg' => 'No se encontró la libro con ese titulo = ' . $titulo,\n ];\n $respuesta = \\Response::json($datos, 404); \n }\n\n \n \n\n return $respuesta;\n }", "function getTitulo() {\n // mistura os arrays somente do bloco 1\n shuffle($this->bloco[1]);\n return ucfirst($this->bloco[1][0]); // deixa a primeira letra da string maiúscula\n }", "public function GetPorTitulo($pTitulo)\r\n {\r\n \t$this->Consultar(\"SELECT * FROM general WHERE titulo = '$pTitulo';\", false);\r\n }", "function busqueda($dato){\n\t$dato=strtolower($dato);\n\t$con= ConectaBD::getInstance();\n\t//se busqua dicho libro en la tabla Libros se busca por titulo y autor\n\tif ( !( $query = $con->prepare( \"select * from Libros where lower(autor) like '%\".$dato.\"%' or lower(titulo) like '%\".$dato.\"%'\" ) ) ){\n\t\techo \"Falló la preparacioón: \" . $con->errno . \" - \" . $con->error; \n\t}else{\n\t\t$query->execute();\n\t\t$resultado= $query ->fetchAll(PDO::FETCH_ASSOC);\n\t\techo json_encode($resultado);\n\t}\n\n}", "function buscar_passageiros($nome) {\n\t\trequire_once('conexao.class.php');\n\t\t$conexao = new conexao();\n\t\t\n\t\t$sql = \"select cliente.id, cliente.cliente, cliente_telefones.telefone\n\t\t\t\t\tfrom cliente\n\t\t\t\t\t\tleft join cliente_telefones on cliente_telefones.id_cliente = cliente.id and cliente_telefones.principal = 1\n\t\t\t\t\t\t\twhere cliente like '\".$nome.\"%'\n\t\t\t\t\t\t\tand cliente.id_situacao = 1\n\t\t\t\t\t\t\t\t-- order by cliente\n\t\t\t\t\t\t\t\t\tlimit 10\";\n\t\t$r = $conexao -> query($sql);\n\t\treturn $r;\n\t}", "protected function _getTitulo()\n {\n $c = new ServiciosController();\n $related=$c->getRelated($this->_properties['id']);\n if($related==null)\n return '';\n return $this->_properties['nombre'].' de '.$related->renta->nombre;\n }", "public function titulo () \r\n\t\t{\r\n\t\t\techo $this->get_detail(name);\r\n\t\t}", "public function buscarAnuncioPorTitulo($titulo) {\n $script = ScriptsSQL::getInstancia()->buscarAnuncioPorTitulo();\n $stmt = ConectarPDO::getConexaoPDO()->prepare($script);\n $stmt->bindParam(1, $titulo);\n $stmt->execute();\n\n return $this->popularAnuncio($stmt->fetch(PDO::FETCH_ASSOC));\n }", "function buscarPorApellido(){\n\t\tif(!is_blank($this->params['q'])){\n\t\t\t\n\t\t\t$cod_programa = upper($this->params['cod_programa']);\n if(is_user_login(COD_TIPO_VISITANTE_1))\n $cod_programa = '001';\n\t\t\telseif($cod_programa != NULL && $cod_programa != 'ALL'){\n\t\t\t\tif($cod_programa == 'CURRENT'){\n\t\t\t\t\t$this->includeModel('TPrograma');\n\t\t\t\t\t$cod_programa = TPrograma::actual();\n\t\t\t\t}\n\t\t\t}\n $this->params['cod_programa'] = $cod_programa;\n\t\t\t$personas = TPersona::buscarPorApellido($this->params['q'], $this->params); \n\t\t\t$this->vista->set('personas', $personas);\n\t\t\t$this->vista->display();\n\t\t}\n\t}", "private function getPerTitol(){\n $result = $this->llibreGateway->buscarPerTitol();\n \n return $this->crearResposta('200 OK', $result);\n }", "public function pasarTitulo()\n\t{\n\t\t$nuevoContenido = str_replace('<title>','<title>'.$this->pagina->obtenerTitulo(),$this->pagina->obtenerContenido());\n\t\t$this->pagina->fijarContenido($nuevoContenido);\n\t}", "function obtenerTitulo($idcarrera) {\r\n\t$carreratitulo = consulta(\"SELECT CARRERA_NOMBRE FROM CARRERAS WHERE ID_CARRERA = \".$idcarrera.\"\");\r\n\treturn $carreratitulo[0]['CARRERA_NOMBRE'];\r\n}", "public function buscarComentario($texto){\n $consulta = \"SELECT * FROM Comentario WHERE comentario LIKE ?\";\n /* stmt representa una consulta lista */\n $stmt = $this->$mysqli->prepare($consulta);\n $busqueda = \"%\" . $texto . \"%\";\n $stmt->bind_param(\"s\", $busqueda);\n $stmt->execute();\n $res=$stmt->get_result();\n $stmt->close();\n\n $lista_comentarios = array();\n \n /* Para cada evento obtenido obtengo sus fotos y pongo la primera en la portada */\n while($row=$res->fetch_assoc()){\n $comentario = array('id' => $row['id'], 'autor' => $row['autor'], 'comentario' => $row['comentario'], 'fecha' => $row['fecha'], 'evento' => $row['evento'], 'editado' => $row['editado']); \n $lista_comentarios[] = $comentario;\n }\n \n return $lista_comentarios;\n }", "public static function bucarNombre($cadena){\n $c = Connection::dameInstancia();\n $conexion = $c->dameConexion();\n $consulta = \"Select * from cursos where titulo like '%\".$cadena.\"%' ;\";\n $resultado = $conexion->query($consulta);\n if($resultado->num_rows != 0){\n while($row = $resultado->fetch_assoc()){\n $rows[] = $row ;\n }\n $datos = array('numero' => $resultado->num_rows,'filas_consulta' => $rows );\n return $datos ;\n } else {\n return $datos = array('numero' => 0 ) ;\n }\n }", "private function getTextoById()\n\t{\n\t\t//Valida o id do texto\n\t\tif($this->getParam('id_rel_idioma') !== false && is_numeric($this->getParam('id_rel_idioma')))\n\t\t{\n\t\t\t//Busca os dados do texto\n\t\t\t$recordset = $this->Delegator('ConcreteTextos', 'getTextos', array(\"cod_texto\" => $this->getParam('id_rel_idioma')));\n\n\t\t\t//Verifica o resultado da consulta\n\t\t\tif($recordset !== false)\n\t\t\t{\t\t\n\t\t\t\t//Leva os dados para a view\n\t\t\t\t$this->View()->assign('dados_texto',$recordset);\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\t\n\t\t\t\tdie(\"Ocorreu um erro ao tentar localizar o registro solicitado\");\n\t\t\t}\n\t\t}\n\t}", "function tituloTabla(){\n $datos['identificacion']=$this->identificacion;\n $datos['cod_proyecto']=$_REQUEST['cod_proyecto'];\n $proyecto = $this->consultarProyectosCoordinador($datos);\n $titulo =\"<br><div align='center' ><b>Tabla de Homologaciones - \".$proyecto[0][0].\" \".$proyecto[0][1].\"</b></div><hr>\";\n echo $titulo;\n }", "function buscar($carrera, $cantidad) {\r\n $universitario = new universitario();\r\n //carga la plantilla \r\n $pagina = $this->load_template('- Resultados de la busqueda -');\r\n //carga html del buscador\r\n $buscador = $this->load_page('app/views/modules/m.buscador.php');\r\n //obtiene los registros de la base de datos\r\n ob_start();\r\n //realiza consulta al modelo\r\n $tsArray = $universitario->universitarios($carrera, $cantidad);\r\n if ($tsArray != '') {//si existen registros carga el modulo en memoria y rellena con los datos \r\n $titulo = 'Resultado de busqueda por \"' . $carrera . '\" ';\r\n //carga la tabla de la seccion de VIEW\r\n include 'app/views/modules/m.table_univ.php';\r\n $table = ob_get_clean();\r\n //realiza el parseado \r\n $pagina = $this->replace_content('/\\#CONTENIDO\\#/ms', $buscador . $table, $pagina);\r\n } else {//si no existen datos -> muestra mensaje de error\r\n $pagina = $this->replace_content('/\\#CONTENIDO\\#/ms', $buscador . '<h1>No existen resultados</h1>', $pagina);\r\n }\r\n $this->view_page($pagina);\r\n }", "function buscar($carrera, $cantidad)\n {\n\t\t$universitario = new universitario();\t\n\t\t//carga la plantilla \n\t\t$pagina=$this->load_template('- Resultados de la busqueda -');\t\t\t\t\n\t\t//carga html del buscador\n \t $buscador = $this->load_page('app/views/default/modules/m.buscador.php');\t\t\t\t\n\t //obtiene los registros de la base de datos\n\t\t // ob_start();\n\t\t //realiza consulta al modelo\n\t\t $tsArray = $universitario->universitarios($carrera,$cantidad);\t\n\t\t\t\n\n\t \t\tif($tsArray!=''){//si existen registros carga el modulo en memoria y rellena con los datos \n\t\t\t\t\t\t$titulo = 'Resultado de busqueda por \"'.$carrera.'\" ';\n\t\t\t\t\t\t//carga la tabla de la seccion de VIEW\n\t\t\t \t\t\tinclude 'app/views/default/modules/m.table_univ.php';\n\t\t\t\t\t\t$table = ob_get_clean();\t\n\t\t\t\t\t\t//realiza el parseado \n\t\t\t\t\t\t$pagina = $this->replace_content('/\\#CONTENIDO\\#/ms', $buscador.$table , $pagina);\t\n\t \t\t}else{//si no existen datos -> muestra mensaje de error\n\t\t \t\t\t$pagina = $this->replace_content('/\\#CONTENIDO\\#/ms' ,$buscador.'<h1>No existen resultados</h1>' , $pagina);\t\n\t \t\t}\t\t\n\t\t$this->view_page($pagina);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Switch Driver's 'isAvailableToWork' field to On or Off
public function actionAvailable() { $on = \Yii::$app->request->post('on'); $driver = Driver::getCurrent(); $userDriver = $driver->userDriver; $userDriver->updateAttributes([ 'isAvailableToWork' => (int) $on, ]); return Driver::getCurrent(); }
[ "public function switchOn();", "public function toggleSystemSchedule()\n {\n $this->sqlquery->querySQL(\"UPDATE Enabled set enabled= !enabled;\");\n return $this->getSystemEnabled();\n }", "public function turn_on()\n {\n $this->testing = TRUE;\n }", "public function toggleWiFi()\n {\n return $this->driverCommand(BaseConstants::$POST, '/appium/device/toggle_wifi');\n }", "function ppi_test_driving() {\n return get_option('ppi_test_driving') === 'enabled';\n}", "public function toggleEnabled(){\n \n global $DB;\n \n $obj = new \\stdClass();\n $obj->id = $this->id;\n $obj->enabled = !$this->enabled;\n $DB->update_record(\"bcgt_qual_structures\", $obj);\n \n }", "function ChangeDriverVehicleRideDeliveryFeatureDisable($iDriverId) {\n global $obj, $APP_TYPE, $generalobj;\n $eShowRideVehicles = \"Yes\";\n $eShowDeliveryVehicles = \"Yes\";\n\n $sqldata = \"SELECT iTripId FROM `trips` WHERE ( iActive='On Going Trip' OR iActive='Active' ) AND iDriverId='\" . $iDriverId . \"'\";\n $TripData = $obj->MySQLSelect($sqldata);\n $TripRunCount = count($TripData);\n\n if ($APP_TYPE == \"Ride-Delivery-UberX\" && $TripRunCount == 0) {\n $RideDeliveryIconArr = getGeneralVarAll_IconBanner();\n for ($i = 0; $i < count($RideDeliveryIconArr); $i++) {\n $vName = $RideDeliveryIconArr[$i]['vName'];\n $vValue = $RideDeliveryIconArr[$i]['vValue'];\n $$vName = $vValue;\n $Data[0][$vName] = $$vName;\n }\n if ($Data[0]['RIDE_SHOW_SELECTION'] == 'None' && $Data[0]['RENTAL_SHOW_SELECTION'] == 'None' && $Data[0]['MOTO_RIDE_SHOW_SELECTION'] == 'None' && $Data[0]['MOTO_RENTAL_SHOW_SELECTION'] == 'None') {\n $eShowRideVehicles = \"No\";\n $sql = \"SELECT eType FROM `driver_vehicle` as dv LEFT JOIN register_driver as rd ON dv.iDriverVehicleId=rd.iDriverVehicleId WHERE rd.iDriverId='\" . $iDriverId . \"'\";\n $DriverVehicleType = $obj->MySQLSelect($sql);\n $eType = $DriverVehicleType[0]['eType'];\n if ($eType == \"Ride\") {\n $sql = \"UPDATE register_driver set iDriverVehicleId='0' WHERE iDriverId='\" . $iDriverId . \"'\";\n $obj->sql_query($sql);\n }\n }\n if ($Data[0]['DELIVERY_SHOW_SELECTION'] == 'None' && $Data[0]['MOTO_DELIVERY_SHOW_SELECTION'] == 'None') {\n $eShowDeliveryVehicles = \"No\";\n $sql = \"SELECT eType FROM `driver_vehicle` as dv LEFT JOIN register_driver as rd ON dv.iDriverVehicleId=rd.iDriverVehicleId WHERE rd.iDriverId='\" . $iDriverId . \"'\";\n $DriverVehicleType = $obj->MySQLSelect($sql);\n $eType = $DriverVehicleType[0]['eType'];\n if ($eType == \"Delivery\") {\n $sql = \"UPDATE register_driver set iDriverVehicleId='0' WHERE iDriverId='\" . $iDriverId . \"'\";\n $obj->sql_query($sql);\n }\n }\n }\n\n return $iDriverId;\n}", "public static function check_enabled() {\n self::$skipenabled = false;\n }", "public function isDriverSupported();", "public static function turnSystemOn()\n\t{\n\t\treturn static::_setSystemStatus(1);\n\t}", "public function isWorkTimeCheckEnabled()\n {\n return $this->isWorkTimeCheckEnabled;\n }", "public function changeStatus(): void\n {\n if ('online' === $this->online_status) {\n if ($this->used_machine_id > 0) {\n $query = 'UPDATE '. \\rex::getTablePrefix() .'d2u_machinery_used_machines '\n .\"SET online_status = 'offline' \"\n .'WHERE used_machine_id = '. $this->used_machine_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'offline';\n\n // Remove from export\n if (rex_plugin::get('d2u_machinery', 'export')->isAvailable()) {\n ExportedUsedMachine::removeMachineFromAllExports($this->used_machine_id);\n }\n } else {\n if ($this->used_machine_id > 0) {\n $query = 'UPDATE '. \\rex::getTablePrefix() .'d2u_machinery_used_machines '\n .\"SET online_status = 'online' \"\n .'WHERE used_machine_id = '. $this->used_machine_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'online';\n }\n\n // Don't forget to regenerate URL cache / search_it index\n \\d2u_addon_backend_helper::generateUrlCache();\n }", "public function switchOnCellularData() {\n shell_exec($this->switchOnCellularDataCommand);\n }", "abstract protected function enableTestMode();", "function set_enabled() {\n\t\t$options = it_exchange_table_rate_shipping_get_table_rate( $this->table_rate_args['ID'] );\n\t\t$this->enabled = ! empty( $options['enabled'] );\n\t}", "public function toggle_activeness( $curr ) { // param type: int\n\t\t$bypass_list = self::get_option( 'bypass_list' , array() );\n\t\tif ( in_array( $curr, $bypass_list ) ) { // when the ith opt was off / in the bypassed list, turn it on / remove it from the list\n\t\t unset( $bypass_list[ array_search( $curr, $bypass_list ) ] );\n\t\t\t$bypass_list = array_values( $bypass_list );\n\t\t\tself::update_option( 'bypass_list', $bypass_list );\n\t\t\treturn true;\n\t\t} else { \t// when the ith opt was on / not in the bypassed list, turn it off / add it to the list\n\t\t\t$bypass_list[] = ( int ) $curr;\n\t\t\tself::update_option( 'bypass_list', $bypass_list );\n\t\t\treturn false;\n\t\t}\n\t}", "public function enable() {\n\t\t$sql = \"UPDATE\twcf\".WCF_N.\"_linkus\n\t\t\tSET\tdisabled = 0\t\t\t\n\t\t\tWHERE\tlinkusID = \".$this->linkusID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t\t\n\t\t// reset cache\n\t\tself::resetCache();\n\t}", "public function enable()\n {\n $this->status = true;\n }", "public function change_driver_mode_status() {\n if ($this->checkLogin('C') == '') {\n redirect(COMPANY_NAME);\n } else {\n $driver_id = $this->uri->segment(5, 0);\n\t\t\t\n\t\t\n\t\t$dri_LastRide_satate = $this->driver_model->get_driver_last_ride_status($driver_id );\n\t\t\n\t\t$doAction = FALSE;\n\t\tif($dri_LastRide_satate->num_rows() == 0){\n\t\t\t$doAction = TRUE;\n\t\t}\n\t\tif(isset($dri_LastRide_satate->row()->ride_status) && ($dri_LastRide_satate->row()->ride_status == 'Completed' || $dri_LastRide_satate->row()->ride_status == 'Finished' || $dri_LastRide_satate->row()->ride_status == 'Cancelled') ){\n\t\t\t$doAction = TRUE;\n\t\t}\n\t\t\n\t\tif($doAction){\n\t\t $newdata = array('mode' => 'Available');\n\t\t $condition = array('_id' => MongoID($driver_id));\n\t\t $this->driver_model->update_details(DRIVERS, $newdata, $condition);\n\t\t $this->setErrorMessage('success', 'Driver Verification Status Changed Successfully','admin_driver_verification_status');\n\t } else {\n\t\t\t $this->setErrorMessage('error', 'Sorry! This driver is on ride, You can not make him available right now','this_driver_on_ride_make_him_available_now');\n\t }\n redirect(COMPANY_NAME.'/drivers/display_drivers_list');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pg_cancel_query cancels an asynchronous query sent with pg_send_query, pg_send_query_params or pg_send_execute. You cannot cancel a query executed using pg_query.
function pg_cancel_query($connection): void { error_clear_last(); $safeResult = \pg_cancel_query($connection); if ($safeResult === false) { throw PgsqlException::createFromPhpError(); } }
[ "public function cancel()\n\t{\n\t\t$this->_statement=null;\n\t}", "public function cancel()\n\t{\n\t\t$this->pdoStatement = null;\n\t}", "protected function _cancelOperation(){ }", "public function cancel() {}", "public function stopQuery();", "protected function cancelOperation()\n {\n }", "public function stopQuery(){}", "public function stopQuery(): void;", "public function cancel(){}", "public function maybeCancelWPQuery($query, $wp_query) {\r\r\n if ( $this->checkSearchOverride(true, $wp_query) === true ) {\r\r\n $query = false;\r\r\n }\r\r\n return $query;\r\r\n }", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "public function canceled();", "public function cancel_process()\n {\n }", "public function cancel($reason)\n {\n // todo: Implement transaction cancelling on data store\n\n // todo: Populate $cancel_time with value\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n // todo: Change $state to cancelled (-1 or -2) according to the current state\n\n if ($this->state == self::STATE_COMPLETED) {\n // Scenario: CreateTransaction -> PerformTransaction -> CancelTransaction\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n // Scenario: CreateTransaction -> CancelTransaction\n $this->state = self::STATE_CANCELLED;\n }\n\n // set reason\n $this->reason = $reason;\n\n // todo: Update transaction on data store\n $this->save();\n }", "protected function cancel_abort() {\n\t\t$this->abort = false;\n\t}", "abstract public function cancel(UserAccount $user, $reason = NULL);", "public function cancelCommit() {\n\n return $this->sendRPC(\"<cancel-commit/>\");\n\n }", "public function scopeCancelled($query)\n {\n return $query->where('cancelled', 1);\n }", "public function stopQuery() {\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets minimal token length
public function getMinimalTokenLength() { return $this->minimalTokenLength; }
[ "public function getMinimalTokenCount()\n {\n return $this->minimalTokenCount;\n }", "public function getFinalTokenLength() {}", "public function getMinimumLength()\n {\n return $this->minimumLength;\n }", "function getMinWordLen()\n\t{\n\t\treturn $this->minWordLen;\n\t}", "public function getTermMinLength()\n {\n return $this->termMinLength;\n }", "public function getMltMinWordLength(): int {}", "public function getMinimalLength()\n {\n return $this->minimalLength;\n }", "public function getMinLength()\n {\n return $this->getProperty(self::MIN_LENGTH);\n }", "public function getMinLength()\n\t{\n\t\treturn $this->minValue;\n\t}", "private function getTokenLenght(){\n return 8;\n }", "public function getMinLength() {\n return $this->forgot_pass['minLength'];\n }", "protected function getMinPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getPasscodeMinimumLength()\n {\n if (array_key_exists(\"passcodeMinimumLength\", $this->_propDict)) {\n return $this->_propDict[\"passcodeMinimumLength\"];\n } else {\n return null;\n }\n }", "public function getMinLength() { return $this->_minLength; }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(\n AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH\n );\n }", "public function getMinimalPasswordLength() : int\n {\n return $this->userPasswordRequirements['minLength'] ?? 4;\n }", "public function getPasswordMinimumLength()\n {\n if (array_key_exists(\"passwordMinimumLength\", $this->_propDict)) {\n return $this->_propDict[\"passwordMinimumLength\"];\n } else {\n return null;\n }\n }", "public function getSearchMinLength() {\n\t\treturn $this->config->getSystemValue('user.search_min_length', 2);\n\t}", "protected function _getMinWordLength()\n\t{\n\t\treturn 3;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show last 5 trainings
public function showLast5Training($userID) { $queryBuilder = $this->db->createQueryBuilder(); $queryBuilder ->select('*') ->from('Sport_Name', 'sn') ->innerJoin('sn','Sport', 's','s.Sport_Name_ID = sn.Sport_Name_ID') ->innerJoin('s','Training_day', 'td','s.Training_day_ID = td.Training_day_ID') ->where('s.User_ID = '.$userID) ->orderBy('td.Training_day_day_number', 'ASC') ->setMaxResults(5); return $queryBuilder->execute()->fetchAll(); }
[ "public function showLast5TrainingAction(Application $app)\n {\n $userRepository = new UserRepository($app['db']);\n $userID = $userRepository->getUserByLogin($app['user']->getUsername())['User_ID'];\n\n $trainingRepository = new TrainingRepository($app['db']);\n return $app['twig']->render(\n 'training/training_show_last_5.html.twig',\n ['paginator' => $trainingRepository->showLast5Training($userID)]\n );\n }", "public function getTop5AllTime()\n {\n \t//Returns the updated results page\n \treturn View::make('results');\n }", "public function getFiveLatestRecords();", "public function getTop5Today()\n {\n \t//Returns the updated results page\n \treturn View::make('results');\n }", "static function getTopFive()\n {\n try\n {\n $users = User::all();\n $sorted = collect($users)->sortBy('points', 1, true);\n $ranked = array();\n $rank = 1;\n\n foreach($sorted as $value)\n {\n $ranked[$rank] = $value;\n $rank++;\n if($rank > 5)\n {\n break;\n }\n }\n\n //foreach ($sorted as $value){\n // $ranked[$rank] = $value;\n // $rank++;\n //}\n }\n catch (Exception $ex)\n {\n return redirect()->route('home')->withErrors($ex->getMessage());\n }\n return view('home')->with('ranked', $ranked);\n }", "public function getLastFiveRecordingsAttribute(): Collection\n {\n return $this->recordings()->orderBy('created_at', 'DESC')->limit(5)->get();\n }", "function get_recent()\n {\n $this->db->limit(5);\n $this->db->order_by('game_id','desc');\n return $this->db->get($this->table)->result();\n }", "public function scopeLastFive()\n {\n return Tag::orderBy('tag_id', 'desc')\n ->take(5);\n }", "public function scopeLastFive()\n {\n return Media::orderBy('media_id', 'desc')\n ->take(5);\n }", "public function actionTopfive(){\n return User::find()->orderBy(['score' => SORT_DESC])->limit(5)->all();\n }", "public function getLimit5(){\n\n \n \n // $users = $this->allUsers;\n echo '<br/>';\n echo '<br/>';\n $this->collection = $this->collection->take(5);\n // $this->FirstFiveUsers= $this->allUsers->take(5);\n // echo $this->FirstFiveUsers;\n return $this;\n \n \n }", "public function getTopFiveBets(){\n return $this->find()\n ->orderBy('total_points DESC')\n ->limit(5)\n ->all();\n }", "function latest(){\n $courses=Course::orderBy('id','desc')->take(3)->get();\n $feeds=Feedback::get();\n $courses_count=Course::count();\n $trainers_count=Trainer::count();\n $students_count=Student::count();\n return view('front/index',[\n 'courses'=>$courses,\n 'feeds'=>$feeds,\n 'courses_count'=>$courses_count,\n 'trainers_count'=>$trainers_count,\n 'students_count'=>$students_count\n ]);\n }", "public function actionGetLast5Spottings(){\n\techo json_encode(Spottings::model()->getlast5Spottings());\n }", "public function getLastPredictions()\n\t{\n\t\treturn View::make('stockdeals.lastpredictions', array(\n\t\t\t\t\t\t\t\t\t\t\t\t'records' => $this->latestPredictions(),\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t);\n\t}", "public function top20Week() {\n\t\t//Set the setting to determine what will be rated\n\t\t$setting = 'scores';\n\t\t//get the Carbon model\n\t\t$carbon = App::make('Carbon\\Carbon');\n\t\t//Calculate the scores from the last 7 days for every user and put them in an array\n\t\t$rows = Score::whereIn('user_id' , Score::select('user_id')\n\t\t\t\t->groupBy('user_id')\n\t\t\t\t->get()->toArray() )\n\t\t\t\t\t->groupBy('user_id')\n\t\t\t\t\t->where('guest_user','!=','1')\n\t\t\t\t\t->selectRaw('user_id,name,level,sum(score_gained) as score')\n\t\t\t\t\t->whereBetween('scores.updated_at',array($carbon->now()->subWeek()->addDay()->toDateString(),$carbon->now()->addDay()->toDateString()))\n\t\t\t\t\t->orderBy('score','desc')\n\t\t\t\t\t->leftJoin('users', 'scores.user_id', '=', 'users.id')\n\t\t\t\t\t->get()->toArray();\n\t\t$userRank = null;\n\t\tif($rows){\n\t\t\t//if the $rows array is full of scores, make $rows null.\n\t\t\t$i=0;\n\t\t\t//go over all rows to add the ranks in the array\n\t\t\tforeach($rows as $todayScore){\n\t\t\t\t$rank = $i+1;\n\t\t\t\t$rows[$i]['currentRank']=$rank;\n\t\t\t\t//If the user is logged in and the user id is equal to the id of the user that is now logged in, fill the $userRank variable\n\t\t\t\tif((Auth::user()->check()) && ($rows[$i]['user_id'] == Auth::user()->get()->id)){\n\t\t\t\t\t$userRank = $rank;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t//Take the first 20 entries of the list\n\t\t\t$rows = array_slice($rows, 0, 20);\n\t\t}\n\t\n\t\t//Make the standard view with the top 20 scores of today\n\t\treturn View::make('leaderboard')->with('rows', $rows)->with('userRank',$userRank)->with('setting',$setting);\n\t}", "public static function TopFiveUserEstates()\n {\n return self::withCount('estates')->take(5)->orderByDesc('estates_count')->get();\n }", "function fetchLatestFiveArticles() {\n\t\treturn $this->fetchAllArticles ( \"latest_articles_view\" );\n\t}", "public function get_last_ten_entries()\r\n\t{\r\n\t\t$query = $this->db->get(\"email_workflow\", 10);\r\n\r\n\t\treturn $query->result();\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get country flag This method accepts a 2charcter, lowercase, country code. It then matches the code to the corresponding image file in the includes/famfamfamcountryflags directory. Finally, it returns a complete HTML IMG tag.
private function getFlag($countryCode) { $flag = '<img src="src/assets/famfamfam-countryflags/' . strtolower($countryCode) . '.gif" height="15px" width="25px"/>'; return $flag; }
[ "function display_country_flag($country){\n\t$code = get_country_code($country);\n\t$code = strtolower($code);\n\techo \"<img src='\"._IMAGES_URL_.\"flags/$code.gif'/>\";\n}", "function flag_image($country_name)\n {\n $html_dir = path(config('file_layout', 'html_dir', './html'));\n $flag_dir = config('static_files', 'flag_image_dir', 'static/images/flags');\n $ext = config('static_files', 'flag_image_ext', '.gif');\n $flagfile = $flag_dir . '/' . strtolower($country_name) . $ext;\n if (file_exists($html_dir . '/' . $flagfile)) {\n return $flagfile;\n } else {\n return '';\n }\n }", "function getTeamFlag($countryCode) {\n\tif (!empty($countryCode)) {\n\t\treturn \"<img src='http://img.fifa.com/imgml/flags/s/{$countryCode}.gif' title='{$countryCode}' />\";\n\t}\n}", "function display_flag ($country_code=''\n , $country_name=''\n , $width=16, $height=11\n , $no_flag='&nbsp;'\n , $flag_path='', $img_ext='.gif')\n {\n $country_name = trim($country_name);\n if ($flag_path == '')\n {\n $flag_path = base_url().'public/images/flags/';\n }\n $result = $no_flag;\n if ($country_code!='')\n {\n $country_code = strtolower(substr($country_code, 0, 2));\n if (strlen($country_code)==2)\n {\n $width = intval($width);\n $height = intval($height);\n $title = $country_name != '' ? \"title='{$country_name}'\" : '';\n $result = sprintf('<img src=\"%s\" alt=\"%s\" width=\"%d\" height=\"%d\" style=\"border: 0px;\" %s />',\n $flag_path.$country_code.$img_ext, $country_code, $width, $height, $title);\n }\n }\n return $result;\n }", "private function getCountryFlag($country_code) {\n if (!empty($country_code)) {\n\n // Create http client.\n $client = \\Drupal::httpClient();\n\n try {\n // Set query parameters by instructions given at https://restcountries.eu/\n $query = [\n 'codes' => $country_code,\n ];\n\n // Create URL.\n $url = Url::fromUri('https://restcountries.eu/rest/v2/alpha');\n // Pass query options.\n $url->setOption('query', $query);\n\n // Make request to url.\n $request = $client->get($url->toString());\n // Get result body and decode JSON.\n $response = json_decode($request->getBody(), TRUE);\n\n // Return icon image link.\n return $response['0']['flag'];\n\n }\n catch (RequestException $e) {\n // HTTP client error happened. Log this for admin to be able to see the exact message.\n \\Drupal::logger('current_weather')->error('HTTP Client error');\n \\Drupal::logger('current_weather')->error($e->getMessage());\n\n return '';\n }\n }\n else {\n return '';\n }\n }", "function rain_get_country_image($ip_address)\n{\n if ($ip_address == '') {\n return '';\n }\n\n require_code('locations');\n\n $country = geolocate_ip($ip_address);\n if (is_null($country)) {\n return '';\n }\n\n return find_theme_image('flags/' . $country);\n}", "function printflagimg($ip) {\n global $c_geoip_enable;\n global $c_surfidsdir;\n if ($c_geoip_enable == 1) {\n global $gi;\n $record = geoip_record_by_addr($gi, $ip);\n $countrycode = strtolower($record->country_code);\n $cimg = \"$c_surfidsdir/webinterface/images/worldflags/flag_\" .$countrycode. \".gif\";\n if (file_exists($cimg)) {\n $country = $record->country_name;\n echo \"<img class='flag' src='images/worldflags/flag_\" .$countrycode. \".gif' \" .printover($country). \" />\";\n } else {\n echo \"<img class='flag' src='images/worldflags/flag.gif' \" .printover(\"No Country Info\"). \" />\";\n }\n }\n}", "private function codeToFlag($code)\n {\n if (isset(self::$flag_cache[$code])) {\n return self::$flag_cache[$code];\n }\n $wwwLocation = \"/themes/main/images/flags/\".strtolower($code).\".png\";\n $fileLocation = Director::baseFolder().$wwwLocation;\n if (file_exists($fileLocation)) {\n self::$flag_cache[$code] = \"<img src=\\\"$wwwLocation\\\" alt=\\\"$code\\\" /> \";\n } else {\n self::$flag_cache[$code] = false;\n }\n return self::$flag_cache[$code];\n }", "public static function visitor_country()\n {\n $code = null;\n if (Director::isDev()) {\n if (isset($_GET['countryfortestingonly'])) {\n $code = $_GET['countryfortestingonly'];\n Controller::curr()->getRequest()->getSession()->set('countryfortestingonly', $code);\n }\n if ($code = Controller::curr()->getRequest()->getSession()->get('countryfortestingonly')) {\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n if (! $code) {\n if (isset($_SERVER['HTTP_CF_IPCOUNTRY']) && $_SERVER['HTTP_CF_IPCOUNTRY']) {\n return $_SERVER['HTTP_CF_IPCOUNTRY'];\n }\n $code = Controller::curr()->getRequest()->getSession()->get('MyCloudFlareCountry');\n if (! $code) {\n $address = self::get_remote_address();\n if (strlen($address) > 3) {\n $code = CloudFlareGeoIP::ip2country($address, true);\n }\n if (! $code) {\n $code = self::get_default_country_code();\n }\n if ('' === $code) {\n $code = Config::inst()->get('CloudFlareGeoip', 'default_country_code');\n }\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n\n return $code;\n }", "public function getCountryInfo()\n\t{\n\t\t$location= LocationController::getLocation();\n\n\t\t/*fetch image url from google API ... code can be found at \n\t\thttp://stackoverflow.com/a/5694812/2786529\n\t\t*/\n\t\t$jsrc = \"https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=\".$location->country_name.\"%20landmark\";\n\t\t$json = file_get_contents($jsrc);\n\t\t$jset = json_decode($json, true);\n\n\t\t/*encode to json format*/\n\t\t$country=json_encode(['country_name'=>$location->country_name,'photourl'=>$jset[\"responseData\"][\"results\"][0][\"url\"]]);\n\t\t\n\t\treturn $country;\n\t}", "public function get_browse_country_image($country_code_iso) {\n $sql = \"SELECT * FROM `travelimagedetails` WHERE CountryCodeISO = '$country_code_iso'\";\n return $this->query($sql)->fetchall(PDO::FETCH_ASSOC);\n }", "public function getCountryAsUrl() {\n if ($this->isReady) {\n $arrReturned = $this->matchRegex($this->_strSource, IMDB::IMDB_COUNTRY);\n if (count($arrReturned[2])) {\n foreach ($arrReturned[2] as $i => $strName) {\n $arrReturn[] = '<a href=\"http://www.imdb.com/country/' . $arrReturned[1][$i] . '/\">' . $strName . '</a>';\n }\n return implode(' / ', $arrReturn);\n }\n return $this->strNotFound;\n }\n return $this->strNotFound;\n }", "protected function getSuffixFlag()\r\n {\r\n if(!$this->currObj instanceof TeamSpeak3_Node_Client) return;\r\n\r\n if($this->flagpath && $this->currObj[\"client_country\"])\r\n {\r\n return $this->getImage($this->currObj[\"client_country\"]->toLower() . \".png\", $this->currObj[\"client_country\"], null, FALSE, TRUE);\r\n }\r\n }", "public function getFlagSvg($country)\n {\n return file_get_contents(\n $this->getJsonConverterHomeDir().\n DIRECTORY_SEPARATOR.\n 'data'.\n DIRECTORY_SEPARATOR.\n strtolower($country).'.svg'\n );\n }", "public static function getCodeCountry(){\n //Todo: Implement.\n return 'AR';\n return $_SERVER[\"HTTP_CF_IPCOUNTRY\"];\n }", "function flag_thumb_path($country_iso) {\n return 'assets/img/flag_thumb/'.strtolower($country_iso).'.png';\n }", "function _iban_country_get_info($country,$code) {\n _iban_load_registry();\n global $_iban_registry;\n $country = strtoupper($country);\n $code = strtolower($code);\n if(array_key_exists($country,$_iban_registry)) {\n if(array_key_exists($code,$_iban_registry[$country])) {\n return $_iban_registry[$country][$code];\n }\n }\n return false;\n}", "public function get_country_iso_code() {\n require( __DIR__ . '/../assets/lib/autoload.php' );\n require( __DIR__ . '/../assets/lib/TP_MaxMind/Db/Reader.php' );\n require( __DIR__ . '/../assets/lib/TP_MaxMind/Db/Reader/Decoder.php' );\n require( __DIR__ . '/../assets/lib/TP_MaxMind/Db/Reader/InvalidDatabaseException.php' );\n require( __DIR__ . '/../assets/lib/TP_MaxMind/Db/Reader/Metadata.php' );\n require( __DIR__ . '/../assets/lib/TP_MaxMind/Db/Reader/Util.php' );\n\n // This WP filter does not work when the redirect is triggered from the front-end ( i.e. when caching is on )\n $db_path = __DIR__ . '/../assets/lib/GeoLite2-Country/GeoLite2-Country.mmdb';\n $reader = new TP_MaxMind\\Db\\Reader( $db_path );\n\n if ( isset( $_SERVER['HTTP_CF_IPCOUNTRY'] ) && !empty( $_SERVER['HTTP_CF_IPCOUNTRY'] ) ) {\n $country_code = strip_tags( strtolower( $_SERVER['HTTP_CF_IPCOUNTRY'] ) );\n } else {\n $ip = $this->get_current_ip();\n $record = $reader->get( $ip );\n $country_code = null;\n if ( !empty( $record ) && !empty( $record['country'] ) && !empty( $record['country']['iso_code'] ) ) {\n $country_code = $record['country']['iso_code'];\n }\n }\n\n return $country_code;\n }", "public function getImgUrl(Response $response, $countryCode);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getByIdHL() get data from HL from ID $HL_ID id HL $idElement id element
public static function getByIdHL( $HL_ID, $idElement, $field = false, $valField ){ CModule::IncludeModule("highloadblock"); $hlbl = $HL_ID; $hlblock = Bitrix\Highloadblock\HighloadBlockTable::getById($hlbl)->fetch(); if (!empty($hlblock)){ $entity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hlblock); $entity_data_class = $entity->getDataClass(); $row = $entity_data_class::getById($idElement)->fetch(); if(!empty($row)){ if($field){ return $row[$valField]; }else{ return $row; } }else{ return false; } } }
[ "function &getRowDataElement($rowId) {\n\t\t$elementIterator =& $this->getData();\n\t\tif (is_a($elementIterator, 'DAOResultFactory')) {\n\t\t\t$dataArray =& $elementIterator->toAssociativeArray('id');\n\t\t} else {\n\t\t\t$dataArray =& $elementIterator->toArray();\n\t\t}\n\t\tif (!isset($dataArray[$rowId])) {\n\t\t\t$nullVar = null;\n\t\t\treturn $nullVar;\n\t\t} else {\n\t\t\treturn $dataArray[$rowId];\n\t\t}\n\t}", "public function get_weigh_in_by_id($id){\n $sql = \"SELECT * FROM `weigh_ins-170907` WHERE weigh_in_ID='$id';\";\n // prewrap($sql);\n $result = mysqli_query($this->connection, $sql);\n if($result){\n return $this->get_data($result);\n }\n }", "public function findElementById($id);", "public function getBulletPointAttachmentByEsdhId($esdhId, $load = TRUE) {\n // Getting all BPA IDs of this bullet point.\n $bpaIds = $this->getBulletPointAttachments(FALSE);\n\n if (!empty($bpaIds)) {\n $query = \\Drupal::entityQuery('node')\n ->condition('nid', $bpaIds, 'IN')\n ->condition('type', 'os2web_meetings_bpa')\n ->condition('field_os2web_m_esdh_id', $esdhId);\n\n $nids = $query->execute();\n if (!empty($nids)) {\n $nid = reset($nids);\n return ($load) ? Node::load($nid) : $nid;\n }\n }\n\n return NULL;\n }", "public function consultByIdGameData($id){\n\treturn $this->gameDataCO->_consultByIdGameData($id);\n }", "public function getElementById($id){\n\t\t\t\n\t\t$element = $this->getEntityManager()->getRepository('Collection\\Entity\\Element')->findOneBy(array('id'=>$id));\n\t\treturn element;\n\t}", "function get_element_by_id($id) {}", "function get_gel_lanes($Gel_ID){\n if(!$Gel_ID){\n echo \"Error: need gel id in lane_class.php\";\n exit;\n }\n $SQL = \"select L.ID,L.GelID,L.ExpID,L.LaneNum,L.LaneCode,B.GeneID,B.LocusTag,B.ID \n from Lane L, Gel G, Experiment E, Bait B where B.ID=E.BaitID and E.ID=L.ExpID and L.GelID=G.ID\n and G.ID='$Gel_ID' ORDER BY L.LaneNum\";\n //echo $SQL; \n $sqlResult = mysqli_query($this->link,$SQL);\n $this->count = mysqli_num_rows($sqlResult);\n $i=0;\n while (list(\n $this->ID[$i], \n $this->GelID[$i], \n $this->ExpID[$i], \n $this->LaneNum[$i], \n $this->LaneCode[$i],\n $this->BaitGeneID[$i], \n $this->BaitLocusTag[$i],\n $this->BaitID[$i] )= mysqli_fetch_row($sqlResult) ) {\n $i++;\n }//end while\n }", "function getLibellEcriture($id_libel_ecriture) { //Renvoie le libellé dun ecriture/op divers\n\tglobal $dbHandler,$global_id_agence;\n\t$db = $dbHandler->openConnection();\n\n\t$sql=\"SELECT traduction from ad_traductions where id_str = $id_libel_ecriture ;\";\n\t\n\t$result = $db->query($sql);\n\tif (DB :: isError($result)) {\n\t\t$dbHandler->closeConnection(false);\n\t\tsignalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n\t}\n\t$dbHandler->closeConnection(true);\n\t$retour = $result->fetchrow();\n\treturn $retour[0];\n}", "function get_element_by_id($element_id){\n \n $element_hwnd = $this->xml_hwnd->getElementById($element_id);\n if(!$element_hwnd){\n return false;\n }\n return $element_hwnd->nodeValue;\n }", "public function getEntry($id);", "public function getHourById($hourID){\n\t\t$this->connect();\n\n\t\t$sql=\"SELECT * FROM hours WHERE Id='$hourID'\";\n\t\t$result = mysql_query($sql);\t\n\t\tif (mysql_num_rows($result) < 1){\n\t\t\t\n\t\t\treturn $hour = null;\n\t\t}\n\t\t// extract the variables from the result of the database\n\t\t$row = mysql_fetch_assoc($result);\n\t\t$Start = $row['Start'];\n\t\t$End = $row['End'];\n\t\t$date = $row['Date'];\n\t\t$user = $row['User'];\n\t\t$id = $row['Id'];\n\t\t$task = $row['Task'];\n\t\t$status = $row['Status'];\n\t\t\n\t\t// construct and return the hour set, using the extracted information\n\t\t$hour = new Hours($user, $date, $Start, $End, $task, $status);\n\t\t$hour->id = $id;\n\t\t\n\t\treturn $hour;\n\t\t\n\t}", "function &getElementById($id){\n return $this->tree->getElementById($id);\n }", "public function geturlbyid($urlID)\n {\n $this->_sql_elements = $this->_base_sql_elements['get_urlbyid'];\n //make DBAL call\n $checkVars = ['urlid' => $urlID];\n// die(var_dump($checkVars));\n $vars_array = $this->validatePayload($checkVars, $this->_sql_elements['bind_vars'], TRUE); //will throw exception if it fails to validate\n $result = $this->run_sql($vars_array, 'return_outvar');\n return $result; \n }", "public static function byId($id = 0){\n if(is_numeric($id)){\n $objs = self::select(\" WHERE eId = '\".encode($this->eId).\"';\");\n if(count($objs) == 1){\n return $objs[0];\n } \n }\n return null;\n }", "public function getFiche_inventaire($idl){\n\t\t\t\t\t$sql = \"SELECT * FROM fiche_inventaire WHERE fiche_inventaire.id = \".$idl.\" \";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetch();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }", "public function fetchHandleFromID($id){\n\t\t\treturn Symphony::Database()->fetchVar('element_name', 0, \"SELECT `element_name` FROM `tbl_fields` WHERE `id` = '$id' LIMIT 1\");\n\t\t}", "public function getByID($id)\n {\n }", "function get( $id = -1 )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n if ( $id != -1 )\r\n {\r\n $db->array_query( $attribute_array, \"SELECT * FROM eZLink_Attribute WHERE ID='$id'\" );\r\n\r\n if ( count( $attribute_array ) > 1 )\r\n {\r\n die( \"Error: Link attribute's with the same ID was found in the database. This shouldent happen.\" );\r\n }\r\n else if( count( $attribute_array ) == 1 )\r\n {\r\n $this->ID =& $attribute_array[0][ $db->fieldName( \"ID\" ) ];\r\n $this->Name =& $attribute_array[0][ $db->fieldName( \"Name\" ) ];\r\n $this->TypeID =& $attribute_array[0][ $db->fieldName( \"TypeID\" ) ];\r\n $this->Placement =& $attribute_array[0][ $db->fieldName( \"Placement\" ) ];\r\n $this->Unit =& $attribute_array[0][ $db->fieldName( \"Unit\" ) ];\r\n }\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get bed number from bookable array of this format
public function get_bed_number_from_bookable_array($bookable, $bed_type) { $bed_num_found = array(); if (is_array($bookable)) { foreach ($bookable as $date_key => $date_val) { foreach ($date_val as $k => $v) { $key = explode('_', $k); if ($bed_type = $key[0]) { $bed_num_found[] = $key[1]; } } } } return $bed_num_found; }
[ "public function getbed_number()\n {\n return $this->bed_number;\n }", "public function getFieldNrBedroom()\n {\n return $this->fieldNrBedroom;\n }", "public function getBedroomNumber()\n {\n return $this->bedroom_number;\n }", "public function getIdBed(): int\n {\n return $this->idBed;\n }", "public function getNumBord()\n {\n return $this->numBord;\n }", "public function get_banner_bed_id()\n {\n if (!$this->loadBed()) {\n return null;\n }\n\n return $this->_bed->banner_id;\n }", "function getBinIDFromBinBarcode($barcode)\n{\n return explode('-', $barcode)[1];\n}", "public function getBedType()\n {\n return $this->bedType;\n }", "function getSerialFromBinBarcode($barcode)\n{\n return explode('-', $barcode)[2];\n}", "public function getBsbNumber()\n {\n return $this->bsbNumber;\n }", "public function setNumBed($value){\n\t\t\t$this->num_bed = $value;\n\t\t}", "public function get_bed($BId){\n return $this->db->get_where('Bed',array('BId'=>$BId))->row_array();\n }", "public function getNumBathRoom(){\n\t\t\treturn $this->num_bathroom;\n\t\t}", "protected function lookupWellNumId($wellNum)\n\t{\n\n\t\t$wellNumArray = array(\n\t\t\t\"A1\" => 1,\n\t\t\t\"A2\" => 2,\n\t\t\t\"A3\" => 3,\n\t\t\t\"A4\" => 4,\n\t\t\t\"A5\" => 5,\n\t\t\t\"A6\" => 6,\n\t\t\t\"A7\" => 7,\n\t\t\t\"A8\" => 8,\n\t\t\t\"A9\" => 9,\n\t\t\t\"A10\" => 10,\n\t\t\t\"A11\" => 11,\n\t\t\t\"A12\" => 12,\n\t\t\n\n\t\t\t'B1' => 13,\n\t\t\t'B2' => 14,\n\t\t\t'B3' => 15,\n\t\t\t'B4' => 16,\n\t\t\t'B5' => 17,\n\t\t\t'B6' => 18,\n\t\t\t'B7' => 19,\n\t\t\t'B8' => 20,\n\t\t\t'B9' => 21,\n\t\t\t'B10' => 22,\n\t\t\t'B11' => 23,\n\t\t\t'B12' => 24,\n\n\t\t\t'C1' => 25,\n\t\t\t'C2' => 26,\n\t\t\t'C3' => 27,\n\t\t\t'C4' => 28,\n\t\t\t'C5' => 29,\n\t\t\t'C6' => 30,\n\t\t\t'C7' => 31,\n\t\t\t'C8' => 32,\n\t\t\t'C9' => 33,\n\t\t\t'C10' => 34,\n\t\t\t'C11' => 35,\n\t\t\t'C12' => 36,\n\n\t\t\t'D1' => 37,\n\t\t\t'D2' => 38,\n\t\t\t'D3' => 39,\n\t\t\t'D4' => 40,\n\t\t\t'D5' => 41,\n\t\t\t'D6' => 42,\n\t\t\t'D7' => 43,\n\t\t\t'D8' => 44,\n\t\t\t'D9' => 45,\n\t\t\t'D10' => 46,\n\t\t\t'D11' => 47,\n\t\t\t'D12' => 48,\n\n\t\t\t'E1' => 49,\n\t\t\t'E2' => 50,\n\t\t\t'E3' => 51,\n\t\t\t'E4' => 52,\n\t\t\t'E5' => 53,\n\t\t\t'E6' => 54,\n\t\t\t'E7' => 55,\n\t\t\t'E8' => 56,\n\t\t\t'E9' => 57,\n\t\t\t'E10' => 58,\n\t\t\t'E11' => 59,\n\t\t\t'E12' => 60,\n\n\t\t\t'F1' => 61,\n\t\t\t'F2' => 62,\n\t\t\t'F3' => 63,\n\t\t\t'F4' => 64,\n\t\t\t'F5' => 65,\n\t\t\t'F6' => 66,\n\t\t\t'F7' => 67,\n\t\t\t'F8' => 68,\n\t\t\t'F9' => 69,\n\t\t\t'F10' => 70,\n\t\t\t'F11' => 71,\n\t\t\t'F12' => 72,\n\n\t\t\t'G1' => 73,\n\t\t\t'G2' => 74,\n\t\t\t'G3' => 75,\n\t\t\t'G4' => 76,\n\t\t\t'G5' => 77,\n\t\t\t'G6' => 78,\n\t\t\t'G7' => 79,\n\t\t\t'G8' => 80,\n\t\t\t'G9' => 81,\n\t\t\t'G10' => 82,\n\t\t\t'G11' => 83,\n\t\t\t'G12' => 84,\n\n\t\t\t'H1' => 85,\n\t\t\t'H2' => 86,\n\t\t\t'H3' => 87,\n\t\t\t'H4' => 88,\n\t\t\t'H5' => 89,\n\t\t\t'H6' => 90,\n\t\t\t'H7' => 91,\n\t\t\t'H8' => 92,\n\t\t\t'H9' => 93,\n\t\t\t'H10' => 94,\n\t\t\t'H11' => 95,\n\t\t\t'H12' => 96,\n\t\t);\n\t\t\n\t\treturn $wellNumArray[$wellNum];\n\t}", "public function getAwbNumber()\n {\n return $this->awbNumber;\n }", "public function getNum_bat()\n {\n return $this->num_bat;\n }", "public function getBedType() {\n /**\n * Getting entity attribute model\n */\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'bed_type' );\n }", "public function getHouseNumber();", "function getBaseballFieldPositionNumber($id)\n{\n $id = strtoupper($id);\n $positions = array(\n 'P' => '1',\n 'C' => '2',\n '1B' => '3',\n '2B' => '4',\n '3B' => '5',\n 'SS' => '6',\n 'LF' => '7',\n 'CF' => '8',\n 'RF' => '9'\n );\n\n return (isset($positions[$id])) ? $positions[$id] : '0';\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Required. Must be greater than zero. Generated from protobuf field float backoff_multiplier = 4;
public function setBackoffMultiplier($var) { GPBUtil::checkFloat($var); $this->backoff_multiplier = $var; return $this; }
[ "public function getMinimumBackoff()\n {\n return $this->minimum_backoff;\n }", "public function getMaximumBackoff()\n {\n return $this->maximum_backoff;\n }", "public function getBackoffStartInterval()\n {\n return $this->backoff_start_interval;\n }", "public function setBackoffMs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::INT32);\n $this->backoff_ms = $arr;\n\n return $this;\n }", "public function setInitialBackoff($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Duration::class);\n $this->initial_backoff = $var;\n\n return $this;\n }", "public function testPositiveJitter()\n {\n $this->backoff->setMaxJitter(0.5);\n $this->assertNotEquals($this->backoff->getDelay(10), $this->backoff->getDelay(10));\n }", "public function setMaximumBackoff($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Duration::class);\n $this->maximum_backoff = $var;\n\n return $this;\n }", "public function getRetryInterval(): float;", "public function staticBackoff($duration)\n {\n $this->backoff($duration);\n }", "public static function getDelayRetry()\n {\n return 5;\n }", "public function getMaximumRetryWaitTime(): int;", "public function getRequestDelay(): float;", "public function getMaximumRetryDelay()\n {\n return $this->retryMax;\n }", "public static function getThrottleDelay() {}", "public static function getThrottleDelay()\n {\n }", "public function setBonusMultiplier($var)\n {\n GPBUtil::checkFloat($var);\n $this->bonus_multiplier = $var;\n }", "private function _exponential_backoff($closure)\n {\n // Random exponential back-off. See the following for more information:\n // https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#exp-backoff\n $ret = false;\n for ($retry_count = 0; $retry_count < $this->retries; ++$retry_count) {\n $ret = $closure();\n if ($ret === false) {\n // No need to sleep the last time through the loop.\n if ($retry_count < $this->retries - 1) {\n $wait_time = (2 ^ $retry_count) * 1000 + rand(0, 1000);\n usleep($wait_time * 1000);\n }\n } else {\n return $ret; // Success\n }\n }\n return $ret; // Failure after $this->retries attempts\n }", "public function getAttemptPenalty()\n {\n return $this->attempt_penalty;\n }", "private function retryWebhook()\n {\n ($this->attempts() < $this->tries)\n ? $this->release($this->retryInterval * 60)\n : $this->fail();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if UTF8 is a recommended encoding for the carrier.
function isUtf8Carrier() { $carrier = $this->getCarrier(); if ($carrier === 'pc' || $carrier === 'softbank') { return true; } else { return false; } }
[ "public static function is_utf8_charset()\r\n {\r\n return static::$charset === 'UTF-8';\r\n }", "public function isConnectionUTF8()\n {\n $charset = mysqli_character_set_name($this->_connection);\n return $charset === 'utf8';\n }", "public function isUtf8()\n\t{\n\t\treturn strtolower($this->getMail()->getCharset())=='utf-8';\n\t}", "public function isConnectionUTF8()\n\t{\n\t\treturn true;\n\t}", "public function isConnectionUTF8()\n {\n $charsetInfo = $this->fetchAll('SHOW VARIABLES LIKE ?', array('character_set_connection'));\n\n if (empty($charsetInfo)) {\n return false;\n }\n\n $charset = $charsetInfo[0]['Value'];\n return $charset === 'utf8';\n }", "public function isUTF8() {\r\n if (preg_match('!!u', $this->contents)) return true;\r\n return false;\r\n }", "public function isDatabaseCharsetUtf8() : bool {}", "public function is8Bit()\n {\n return ($this->encoding == self::_8BIT);\n }", "public function hasEncoding ()\n {\n // check if encoding has been set\n if (isset($this->encoding) && !is_null($this->encoding))\n return true;\n else\n return false;\n\n }", "public function isUtf8Mode()\n {\n return $this->_isUtf8Mode;\n }", "protected function needsUtf8Safety(){\r\n\t\treturn is_null($this->masterForm) ? true : $this->masterForm->usesUtf8();\r\n\t}", "public function isUtf8();", "public static function isDatabaseConnectionUTF8()\n {\n return Db::get()->isConnectionUTF8();\n }", "public function isInUTF8Encoding($filename)\n {\n $file = new File($this->getStoredCsvPath($filename));\n\n if (getEncodingType($file) == self::DEFAULT_ENCODING) {\n return true;\n }\n\n return false;\n }", "function is_utf8(string $string): bool\n{\n return null !== detect_encoding($string, [Encoding::UTF_8]);\n}", "function IsUTF8($string)\r\n\t{\r\n\t\tif(is_array($string)) {\r\n\t\t\t$string = implode('',$string);\r\n\t\t}\r\n\r\n\t\t$type = mb_detect_encoding($string,\"ASCII, UTF-8\", true);\r\n\r\n\t\tif($type == \"UTF-8\") {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function tribe_detect_encoding( $string ) {\n\t\treturn function_exists( 'mb_detect_encoding' ) ? mb_detect_encoding( $string ) : false;\n\t}", "protected function detectCharset()\n {\n // set the default\n $encode = new Encode;\n $encode->from($this->defaultCharset);\n $encode->to($this->defaultCharset);\n\n if ( ! is_null($this->options->enforceEncoding)) {\n // they want to enforce the given encoding\n $encode->from($this->options->enforceEncoding);\n $encode->to($this->options->enforceEncoding);\n\n return false;\n }\n\n $meta = $this->root->find('meta[http-equiv=Content-Type]', 0);\n if (is_null($meta)) {\n // could not find meta tag\n $this->root->propagateEncoding($encode);\n\n return false;\n }\n $content = $meta->content;\n if (empty($content)) {\n // could not find content\n $this->root->propagateEncoding($encode);\n\n return false;\n }\n $matches = [];\n if (preg_match('/charset=([^; ]+)/', $content, $matches)) {\n $encode->from(trim($matches[1]));\n $this->root->propagateEncoding($encode);\n\n return true;\n }\n\n // no charset found\n $this->root->propagateEncoding($encode);\n\n return false;\n }", "static public function isDatabaseConnectionUTF8()\n\t{\n\t\treturn Zend_Registry::get('db')->isConnectionUTF8();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates an exception message from the provided unique code.
private function generateMessage($code) { static $ERRORS = array( 0x0001 => 'Missing required trait', 0x0002 => 'Missing configuration file', 0x0003 => 'Configuration file did not return an array', 0x0004 => 'Driver load failed', 0x0005 => 'Critical file missing', 0x0006 => 'Critical class missing', 0x0007 => 'Request instance not loaded', 0x0008 => 'Response instance not loaded', 0x0009 => 'View initialization error' ); // Find the error and return it if (isset($ERRORS[$code])) { return $ERRORS[$code]; } // Not found return 'Unknown exception'; }
[ "private function getExceptionMessage($code) {\n switch ($code) {\n case self::CONNECTION_FAILED:\n return \"There have been a trouble during the connection\";\n\n case self::LIMIT_EXCEEDED:\n return \"The creation limit is reached\";\n\n case self::NOT_AUTHORIZED:\n return \"No permisions to use this call\";\n\n case self::INVALID_ACTION:\n return \"This action is invalid\";\n\n case self::INVALID_CALL:\n return \"This call is undefined\";\n\n case self::INVALID_DATA:\n return \"A value contains an invalid data\";\n\n case self::INVALID_RANGE:\n return \"A value contains an invalid range\";\n\n case self::INVALID_OPTION:\n return \"You are trying to set an invalid preferences option\";\n\n case self::NO_DATA:\n return \"There aren't the expected request parameters\";\n\n case self::NOT_FOUND:\n return \"No results found\";\n\n case self::EMPTY_PARAMS:\n return \"No params where given\";\n\n case self::DB_NOT_UPDATED:\n return \"Something has gone wrong and the database has not been updated\";\n\n case self::INVALID_PARAMS:\n return \"An invalid param was given\";\n\n case self::DUPLICATED_VALUE:\n return \"This content is already added\";\n\n case self::ACTION_FAILED:\n return \"Something has gone wrong and the action could not be finished\";\n\n default:\n return \"Exception not found\";\n }\n }", "public static final function toMessage(int $code): string\n {\n return self::MESSAGES[$code] ?? 'Unknown error';\n }", "private function codeToMessage(int $code): string\n {\n return match ($code) {\n self::ERROR_RESERVED_WORD => \"Cannot use the detected PHP reserved word [\" . $this->additionalInformation . \"] as localize key.\",\n self::ERROR_INVALID_NAMING => \"Cannot use the word [\" . $this->additionalInformation . \"] as localize key since it doesn't respect the PHP constant definition.\",\n // @codeCoverageIgnoreStart\n // Hard to test cases of JSON error\n JSON_ERROR_SYNTAX => \"Syntax error.\",\n JSON_ERROR_DEPTH => \"The maximum stack depth has been exceeded.\",\n JSON_ERROR_STATE_MISMATCH => \"Invalid or malformed JSON.\",\n JSON_ERROR_CTRL_CHAR => \"Control character error, possibly incorrectly encoded.\",\n JSON_ERROR_UTF8 => \"Malformed UTF-8 characters, possibly incorrectly encoded.\",\n JSON_ERROR_RECURSION => \"One or more recursive references in the value to be encoded.\",\n JSON_ERROR_INF_OR_NAN => \"One or more NAN or INF values in the value to be encoded.\",\n JSON_ERROR_UNSUPPORTED_TYPE => \"A value of a type that cannot be encoded was given.\",\n JSON_ERROR_INVALID_PROPERTY_NAME => \"A property name that cannot be encoded was given.\",\n JSON_ERROR_UTF16 => \"Malformed UTF-16 characters, possibly incorrectly encoded.\",\n default => \"Unknown localization error\",\n // @codeCoverageIgnoreEnd\n };\n }", "public function getMessage(string $code);", "private function _get_message($code)\n {\n $message = $this->_CI->lang->line('exception_' . $code);\n if ($message === FALSE)\n {\n return $this->_CI->lang->line('exception_' . INVALID_EXCEPTION_CODE);\n }\n return $message;\n }", "public function humanize_exception_code($code)\n\t{\n\t\t$const_map = array(\n\t\t\tUNKNOWN_PROPERTY \t\t=> 'Unknown Property',\n\t\t\tUNKNOWN_METHOD \t\t\t=> 'Unknown Method',\n\t\t\tDEPRECIATED_METHOD\t\t=> 'Method has been depreciated',\n\t\t\tMISSING_PARAMETERS \t\t=> 'You are missing some parameters in your function call',\n\t\t\tINVALID_SQL \t\t\t=> 'The SQL is invalid',\n\t\t\tMEMORY_LIMIT_HIT \t\t=> 'PHP memory limit exceeded in last operation',\n\t\t\tNO_PRIMARY_KEY_FOUND\t=> 'Table has no primary key defined',\n\t\t\tDEPRECIATED_PROPERTY \t=> 'This property has been depreciated and should not be used',\n\t\t\tMISSING_DATABASE_NAME \t=> 'No database name given in constructor method',\n\t\t\tDATABASE_INSTANCE_MISSING => 'Database instance does not exist');\n\t\t\t\n\t\treturn isset($const_map[$code]) ? $const_map[$code] : 'Unknown Exception';\n\t}", "static function GetMessageForCode($pCode);", "public static function getMessage($code) {\n if (isset(ResponseCode::$_codes[$code])) {\n return ResponseCode::$_codes[$code];\n } else {\n return $code;\n }\n }", "public function get_error_message( $code = '' ) {\n\t\treturn $this->errors->get_error_message( $code );\n\t}", "public function generateErrorCode () {\n\t\t\treturn $this->resourceIdentifier + $this->generateErrorCodeOnThisLevel();\n\t\t}", "public function getCodeConstant(): string\n\t{\n\t\treturn ExceptionUtil::getExceptionCode($this->err);\n\t}", "public function getGenericErrorMessage() {\n $msg = App::config()->error_handling['errorMessage'];\n if ($this->errorMessage)\n $code = $this->errorMessage->getCode();\n else $code = '';\n return str_replace('%code%', $code, $msg);\n }", "public function getMessage($code)\n {\n return ResponseCode::getMessage($code);\n }", "private function createGenericErrorMessage(): string\n {\n return (string)__('Something went wrong while processing your order. Please try again later.');\n }", "public static function generateMessage( $message_code, $field_name = '', $required_value = '' ){\n\t\tif ( isset( self::$messages[$message_code] )){\n\t\t\treturn str_replace(array('%name', '%required'), array($field_name, $required_value), self::$messages[$message_code]);\n\t\t} else\n\t\t\treturn '';\n\t}", "private function getAttributeCode(): string\n {\n $attributeCode = $this->getRequest()->getParam('attribute_code');\n\n if (!$attributeCode) {\n $attributeCode = $this->generateCode($this->getRequest()->getParam('frontend_label')[0]);\n }\n\n if (trim($attributeCode) == '') {\n /** @var Regex $validatorAttrCode */\n $validatorAttrCode = new Regex('/^[a-z][a-z_0-9]{0,30}$/');\n\n if (!$validatorAttrCode->isValid($attributeCode)) {\n $errorMessageParts = [\n __('Attribute code \"%1\" is invalid.', $attributeCode),\n __('Please use only letters (a-z), numbers (0-9) or underscore(_) in this field.'),\n __('First character should be a letter.'),\n ];\n throw new LocalizedException(__(implode(' ', $errorMessageParts), $attributeCode));\n }\n }\n\n return $attributeCode;\n }", "public static function codeToString($code)\n {\n switch ($code) {\n case E_ERROR:\n return 'E_ERROR';\n\n case E_WARNING:\n return 'E_WARNING';\n\n case E_PARSE:\n return 'E_PARSE';\n\n case E_NOTICE:\n return 'E_NOTICE';\n\n case E_CORE_ERROR:\n return 'E_CORE_ERROR';\n\n case E_CORE_WARNING:\n return 'E_CORE_WARNING';\n\n case E_COMPILE_ERROR:\n return 'E_COMPILE_ERROR';\n\n case E_COMPILE_WARNING:\n return 'E_COMPILE_WARNING';\n\n case E_USER_ERROR:\n return 'E_USER_ERROR';\n\n case E_USER_WARNING:\n return 'E_USER_WARNING';\n\n case E_USER_NOTICE:\n return 'E_USER_NOTICE';\n\n case E_STRICT:\n return 'E_STRICT';\n\n case E_RECOVERABLE_ERROR:\n return 'E_RECOVERABLE_ERROR';\n\n case E_DEPRECATED:\n return 'E_DEPRECATED';\n\n case E_USER_DEPRECATED:\n return 'E_USER_DEPRECATED';\n\n default:\n return 'Unknown';\n }\n }", "public function getErrorDescription($code)\n {\n switch ($code) {\n case '1':\n $error = 'Transaction successful!';\n break;\n\n case '2':\n case '3':\n case '4':\n case '11':\n $error = 'Transaction was rejected. Please contact your bank.';\n break;\n\n default:\n $error = 'Something went wrong. Please try again...';\n }\n\n return $error;\n }", "private function getUniqueErrorIdentifier()\n {\n try {\n return Uuid::uuid4()->toString();\n } catch (\\Exception $e) {\n return '0000-0000-0000-0000';\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for getCharactersCharacterIdCalendar List calendar event summaries.
public function testGetCharactersCharacterIdCalendar() { }
[ "public function testGetCharactersCharacterIdCalendarEventId()\n {\n\n }", "protected function getUserCalendarList() {\r\n \r\n $url_parameters = [];\r\n $url_parameters['fields'] = 'items(id,summary,timeZone)';\r\n $url_parameters['minAccessRole'] = 'owner';\r\n $url_calendars = 'https://www.googleapis.com/calendar/v3/users/me/calendarList?' . http_build_query($url_parameters);\r\n \r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_calendars);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $_SESSION['accessToken']]);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n \r\n $data = json_decode(curl_exec($ch), true);\r\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n if ($http_code != 200) {\r\n throw new Exception('Error : Failed to get calendars list');\r\n }\r\n \r\n return $data;\r\n }", "function printCalendarContents() {\n\t\t$client = $this->businessLogic->client;\n\t $this->putCalendarTitle($client);\n\t $eventsForCalendar = $this->businessLogic->getEventsForCalendar(htmlspecialchars($_GET['showThisCalendar']));\n\t foreach ($eventsForCalendar as $event) {\n\t $this->putEventListElement($event);\n\t }\n\t}", "public function actionEventCalendar(){\n $eventsSearch = new EventSearch();\n $events = $eventsSearch->searchCalendar(Yii::$app->request->post());\n\n return $this->render('event-calendar', ['events' => $events]);\n }", "function drawEditCalendar(&$calendar, $pidList='') {\t\n\t\t/* Call the view and pass it the calendar to draw */\n\t\t$viewObj = $this->getServiceObjByKey('cal_view', 'create_calendar', '_create_calendar');\n\t\t$content = $viewObj->drawCreateCalendar($pidList, $calendar);\n\t\t\n\t\treturn $content;\n\t}", "function get_assmgr_calendar_events() {\n\n return $this->dbc->get_records('block_assmgr_calendar_event');\n }", "function getEventList(&$calendar, $start_date, $end_date, $info = '') {\n\tglobal $adb, $current_user, $mod_strings, $app_strings, $cal_log, $theme, $currentModule;\n\t$list_max_entries_per_page = GlobalVariable::getVariable('Application_ListView_PageSize', 20, $currentModule);\n\t$listview_max_textlength = GlobalVariable::getVariable('Application_ListView_Max_Text_Length', 40, $currentModule);\n\t$Entries = array();\n\t$userprivs = $current_user->getPrivileges();\n\t$cal_log->debug('> getEventList');\n\n\t$and = \"AND ((((dtstart >= ? AND dtstart <= ?) OR (dtend >= ? AND dtend <= ?) OR (dtstart <= ? AND dtend >= ?)) AND vtiger_recurringevents.activityid is NULL)\n\t\tOR\n\t\t(\n\t\t\t(CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) >= ?\n\t\t\t\tAND CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) <= ?)\n\t\t\tOR (dtend >= ? AND dtend <= ?) OR (CAST(CONCAT(vtiger_recurringevents.recurringdate,' ',time_start) AS DATETIME) <= ? AND dtend >= ?)\n\t\t)\n\t)\";\n\t$crmEntityTable = CRMEntity::getcrmEntityTableAlias('cbCalendar');\n\t$query = \"SELECT vtiger_groups.groupname, vtiger_users.ename as user_name,vtiger_crmentity.smownerid, vtiger_crmentity.crmid,vtiger_activity.*\n\t\tFROM vtiger_activity\n\t\tINNER JOIN \".$crmEntityTable.\" ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\tLEFT OUTER JOIN vtiger_recurringevents ON vtiger_recurringevents.activityid = vtiger_activity.activityid\n\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.activitytype != 'Emails' $and \";\n\n\t$list_query = $query.' AND vtiger_crmentity.smownerid = ' . $current_user->id;\n\n\t$query_filter_prefix = calendarview_getSelectedUserFilterQuerySuffix();\n\t$query .= $query_filter_prefix;\n\n\t$startDate = new DateTimeField($start_date.' 00:00');\n\t$endDate = new DateTimeField($end_date. ' 23:59');\n\t$params = $info_params = array(\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue(),\n\t\t$startDate->getDBInsertDateTimeValue(), $endDate->getDBInsertDateTimeValue()\n\t);\n\tif ($info != '') {\n\t\t$groupids = explode(',', fetchUserGroupids($current_user->id)); // Explode can be removed, once implode is removed from fetchUserGroupids\n\t\tif (count($groupids) > 0) {\n\t\t\t$com_q = ' AND (vtiger_crmentity.smownerid = ? OR vtiger_groups.groupid in ('. generateQuestionMarks($groupids) .')) GROUP BY vtiger_activity.activityid';\n\t\t} else {\n\t\t\t$com_q = ' AND vtiger_crmentity.smownerid = ? GROUP BY vtiger_activity.activityid';\n\t\t}\n\n\t\t$pending_query = $query.\" AND (vtiger_activity.eventstatus = 'Planned')\".$com_q;\n\t\t$total_q = $query.$com_q;\n\t\t$info_params[] = $current_user->id;\n\n\t\tif (count($groupids) > 0) {\n\t\t\t$info_params[] = $groupids;\n\t\t}\n\n\t\t$total_res = $adb->pquery($total_q, $info_params);\n\t\t$total = $adb->num_rows($total_res);\n\n\t\t$res = $adb->pquery($pending_query, $info_params);\n\t\t$pending_rows = $adb->num_rows($res);\n\t\t$cal_log->debug('< getEventList');\n\t\treturn array('totalevent'=>$total,'pendingevent'=>$pending_rows);\n\t}\n\tif (!$userprivs->hasGlobalReadPermission() && !$userprivs->hasModuleReadSharing(getTabid('cbCalendar'))) {\n\t\t$sec_parameter=getCalendarViewSecurityParameter();\n\t\t$query .= $sec_parameter;\n\t}\n\t$group_cond = ' GROUP BY vtiger_activity.activityid ORDER BY vtiger_activity.date_start,vtiger_activity.time_start ASC';\n\n\tif (GlobalVariable::getVariable('Application_ListView_Compute_Page_Count', 0)) {\n\t\t$count_result = $adb->pquery(mkCountQuery($query), $params);\n\t\t$noofrows = $adb->query_result($count_result, 0, 'count');\n\t} else {\n\t\t$noofrows = null;\n\t}\n\t$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true');\n\t//$viewid is used as a key for cache query and other info so pass the dates as viewid\n\t$viewid = $start_date.$end_date;\n\t$start = ListViewSession::getRequestCurrentPage($currentModule, $adb->convert2sql($query, $params), $viewid, $queryMode);\n\n\t$navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);\n\n\t$start_rec = ($start-1) * $list_max_entries_per_page;\n\t$end_rec = $navigation_array['end_val'];\n\n\t$list_query = $adb->convert2Sql($query, $params);\n\t$_SESSION['Calendar_listquery'] = $list_query;\n\n\tif ($start_rec < 0) {\n\t\t$start_rec = 0;\n\t}\n\t$query .= $group_cond.\" limit $start_rec,$list_max_entries_per_page\";\n\n\t$result = $adb->pquery($query, $params);\n\t$rows = $adb->num_rows($result);\n\t$c = 0;\n\tif ($start > 1) {\n\t\t$c = ($start-1) * $list_max_entries_per_page;\n\t}\n\tfor ($i=0; $i<$rows; $i++) {\n\t\t$element = array();\n\t\t$element['no'] = $c+1;\n\t\t$image_tag = '';\n\t\t$contact_data = '';\n\t\t$more_link = '';\n\t\t$start_time = $adb->query_result($result, $i, 'time_start');\n\t\t$end_time = $adb->query_result($result, $i, 'time_end');\n\t\t$date_start = $adb->query_result($result, $i, 'date_start');\n\t\t$due_date = $adb->query_result($result, $i, 'due_date');\n\t\t$date = new DateTimeField($date_start.' '.$start_time);\n\t\t$endDate = new DateTimeField($due_date.' '.$end_time);\n\t\tif (!empty($start_time)) {\n\t\t\t$start_time = $date->getDisplayTime();\n\t\t}\n\t\tif (!empty($end_time)) {\n\t\t\t$end_time = $endDate->getDisplayTime();\n\t\t}\n\t\t$format = $calendar['calendar']->hour_format;\n\t\t$value = getaddEventPopupTime($start_time, $end_time, $format);\n\t\t$start_hour = $value['starthour'].':'.$value['startmin'].''.$value['startfmt'];\n\t\t$end_hour = $value['endhour'] .':'.$value['endmin'].''.$value['endfmt'];\n\t\t$element['starttime'] = $date->getDisplayDate().' '.$start_hour;\n\t\t$element['endtime'] = $endDate->getDisplayDate().' '.$end_hour;\n\t\t$contact_id = $adb->query_result($result, $i, 'contactid');\n\t\t$id = $adb->query_result($result, $i, 'activityid');\n\t\t$subject = $adb->query_result($result, $i, 'subject');\n\t\t$eventstatus = $adb->query_result($result, $i, 'eventstatus');\n\t\t$assignedto = $adb->query_result($result, $i, 'user_name');\n\t\t$userid = $adb->query_result($result, $i, 'smownerid');\n\t\t$idShared = 'normal';\n\t\tif (!empty($assignedto) && $userid != $current_user->id && $adb->query_result($result, $i, 'visibility') == 'Public') {\n\t\t\t$row = $adb->pquery('select * from vtiger_sharedcalendar where sharedid=? and userid=?', array($current_user->id, $userid));\n\t\t\t$no = $adb->getRowCount($row);\n\t\t\tif ($no > 0) {\n\t\t\t\t$idShared = 'shared';\n\t\t\t} else {\n\t\t\t\t$idShared = 'normal';\n\t\t\t}\n\t\t}\n\t\tif ($listview_max_textlength && (strlen($subject) > $listview_max_textlength)) {\n\t\t\t$subject = substr($subject, 0, $listview_max_textlength).'...';\n\t\t}\n\t\tif ($contact_id != '') {\n\t\t\t$displayValueArray = getEntityName('Contacts', $contact_id);\n\t\t\tif (!empty($displayValueArray)) {\n\t\t\t\tforeach ($displayValueArray as $field_value) {\n\t\t\t\t\t$contactname = $field_value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$contact_data = '<b>'.$contactname.'</b>,';\n\t\t}\n\t\t$more_link = \"<a href='index.php?action=DetailView&module=cbCalendar&record=\".$id.\"&activity_mode=Events&viewtype=calendar' class='webMnu'>[\"\n\t\t\t.$mod_strings['LBL_MORE'].'...]</a>';\n\t\t$type = $adb->query_result($result, $i, 'activitytype');\n\t\tif ($type == 'Call') {\n\t\t\t$image_tag = \"<img src='\" . vtiger_imageurl('Calls.gif', $theme). \"' align='middle'>&nbsp;\".$app_strings['Call'];\n\t\t} elseif ($type == 'Meeting') {\n\t\t\t$image_tag = \"<img src='\" . vtiger_imageurl('Meetings.gif', $theme). \"' align='middle'>&nbsp;\".$app_strings['Meeting'];\n\t\t} else {\n\t\t\t$image_tag = '&nbsp;'.getTranslatedString($type);\n\t\t}\n\t\t$element['eventtype'] = $image_tag;\n\t\t$element['eventdetail'] = $contact_data.' '.$subject.'&nbsp;'.$more_link;\n\t\tif ($idShared == 'normal') {\n\t\t\tif (isPermitted('cbCalendar', 'EditView') == 'yes' || isPermitted('cbCalendar', 'Delete') == 'yes') {\n\t\t\t\t$element['action'] = \"<img onClick='getcalAction(this,\\\"eventcalAction\\\",\".$id.',\"'.$calendar['view'].'\",\"'.$calendar['calendar']->date_time->hour.'\",\"'\n\t\t\t\t\t.$calendar['calendar']->date_time->get_DB_formatted_date().\"\\\",\\\"event\\\");' src='\" . vtiger_imageurl('cal_event.jpg', $theme). \"' border='0'>\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (isPermitted('cbCalendar', 'EditView') == 'yes' || isPermitted('cbCalendar', 'Delete') == 'yes') {\n\t\t\t\t$element['action']=\"<img onClick=\\\"alert('\".$mod_strings[\"SHARED_EVENT_DEL_MSG\"].\"')\\\"; src='\" . vtiger_imageurl('cal_event.jpg', $theme). \"' border='0'>\";\n\t\t\t}\n\t\t}\n\t\tif (getFieldVisibilityPermission('Events', $current_user->id, 'eventstatus') == '0') {\n\t\t\tif (!is_admin($current_user) && $eventstatus != '') {\n\t\t\t\t$roleid=$current_user->roleid;\n\t\t\t\t$roleids = array();\n\t\t\t\t$subrole = getRoleSubordinates($roleid);\n\t\t\t\tif (count($subrole)> 0) {\n\t\t\t\t\t$roleids = $subrole;\n\t\t\t\t}\n\t\t\t\t$roleids[] = $roleid;\n\n\t\t\t\t// check if the table contains the sortorder column .If present in the main picklist table, then the role2picklist will be applicable for this table\n\t\t\t\t$res = $adb->pquery('select * from vtiger_eventstatus where eventstatus=?', array(decode_html($eventstatus)));\n\t\t\t\t$picklistvalueid = $adb->query_result($res, 0, 'picklist_valueid');\n\t\t\t\tif ($picklistvalueid != null) {\n\t\t\t\t\t$pick_query=\"select * from vtiger_role2picklist where picklistvalueid=$picklistvalueid and roleid in (\". generateQuestionMarks($roleids) .')';\n\t\t\t\t\t$res_val=$adb->pquery($pick_query, array($roleids));\n\t\t\t\t\t$num_val = $adb->num_rows($res_val);\n\t\t\t\t}\n\t\t\t\tif ($num_val > 0) {\n\t\t\t\t\t$element['status'] = getTranslatedString(decode_html($eventstatus));\n\t\t\t\t} else {\n\t\t\t\t\t$element['status'] = \"<font color='red'>\".$app_strings['LBL_NOT_ACCESSIBLE'].\"</font>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$element['status'] = getTranslatedString(decode_html($eventstatus));\n\t\t\t}\n\t\t}\n\t\tif (!empty($assignedto)) {\n\t\t\t$element['assignedto'] = $assignedto;\n\t\t} else {\n\t\t\t$element['assignedto'] = $adb->query_result($result, $i, 'groupname');\n\t\t}\n\t\t$element['visibility'] = $adb->query_result($result, $i, 'visibility');\n\t\t$c++;\n\t\t$Entries[] = $element;\n\t}\n\t$ret_arr[0] = $Entries;\n\t$ret_arr[1] = $navigation_array;\n\t$cal_log->debug('< getEventList');\n\treturn $ret_arr;\n}", "private function getCalendarEvents() {\n\t\t$fromAgo = CakeTime::format( 'Y-m-d', CakeTime::fromString( '-1 month' ) );\n\n\t\t$calendar_events = array();\n\n\t\t// risk exception expirations\n\t\tif ($this->AppAcl->check('/riskExceptions/index')) {\n\t\t\t$this->loadModel( 'RiskException' );\n\t\t\t$data = $this->RiskException->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'RiskException.expiration >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array( 'id', 'title', 'expiration' ),\n\t\t\t\t'recursive' => -1\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Expiration' ) . ': ' . $item['RiskException']['title'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['RiskException']['expiration'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_RISK\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// risk reviews\n\t\tif ($this->AppAcl->check('/risks/index')) {\n\t\t\t$this->loadModel( 'Risk' );\n\t\t\t$data = $this->Risk->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Risk.review >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array( 'id', 'title', 'review' ),\n\t\t\t\t'recursive' => -1\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Review' ) . ': ' . $item['Risk']['title'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['Risk']['review'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_RISK\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// policy reviews\n\t\tif ($this->AppAcl->check('/securityPolicies/index')) {\n\t\t\t$this->loadModel( 'SecurityPolicy' );\n\t\t\t$data = $this->SecurityPolicy->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'SecurityPolicy.next_review_date >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array( 'id', 'index', 'next_review_date' ),\n\t\t\t\t'recursive' => -1\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Review' ) . ': ' . $item['SecurityPolicy']['index'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['SecurityPolicy']['next_review_date'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_CONTROLS\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// policy exception expirations\n\t\tif ($this->AppAcl->check('/policyExceptions/index')) {\n\t\t\t$this->loadModel( 'PolicyException' );\n\t\t\t$data = $this->PolicyException->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'PolicyException.expiration >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array( 'id', 'title', 'expiration' ),\n\t\t\t\t'recursive' => -1\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Expiration' ) . ': ' . $item['PolicyException']['title'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['PolicyException']['expiration'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_CONTROLS\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// service contract expirations\n\t\tif ($this->AppAcl->check('/serviceContracts/index')) {\n\t\t\t$this->loadModel( 'ServiceContract' );\n\t\t\t$data = $this->ServiceContract->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'ServiceContract.end >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array( 'id', 'name', 'end' ),\n\t\t\t\t'recursive' => -1\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Expiration' ) . ': ' . $item['ServiceContract']['name'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['ServiceContract']['end'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_CONTROLS\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// security service audits\n\t\tif ($this->AppAcl->check('/securityServiceAudits/index')) {\n\t\t\t$this->loadModel( 'SecurityServiceAudit' );\n\t\t\t$data = $this->SecurityServiceAudit->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'SecurityServiceAudit.planned_date >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'SecurityServiceAudit.id',\n\t\t\t\t\t'SecurityServiceAudit.planned_date',\n\t\t\t\t\t'SecurityService.name'\n\t\t\t\t),\n\t\t\t\t'recursive' => 0\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Audit' ) . ': ' . $item['SecurityService']['name'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['SecurityServiceAudit']['planned_date'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_CONTROLS\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// security service maintenances\n\t\tif ($this->AppAcl->check('/securityServiceMaintenances/index')) {\n\t\t\t$this->loadModel( 'SecurityServiceMaintenance' );\n\t\t\t$data = $this->SecurityServiceMaintenance->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'SecurityServiceMaintenance.planned_date >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'SecurityServiceMaintenance.id',\n\t\t\t\t\t'SecurityServiceMaintenance.planned_date',\n\t\t\t\t\t'SecurityService.name'\n\t\t\t\t),\n\t\t\t\t'recursive' => 0\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Maintenance' ) . ': ' . $item['SecurityService']['name'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['SecurityServiceMaintenance']['planned_date'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_CONTROLS\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// project deadlines\n\t\tif ($this->AppAcl->check('/projects/index')) {\n\t\t\t$this->loadModel( 'Project' );\n\t\t\t$data = $this->Project->find( 'all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Project.deadline >=' => $fromAgo\n\t\t\t\t),\n\t\t\t\t'fields' => array( 'id', 'title', 'deadline' ),\n\t\t\t\t'recursive' => -1\n\t\t\t) );\n\n\t\t\tforeach ( $data as $item ) {\n\t\t\t\t$calendar_events[] = array(\n\t\t\t\t\t'title' => __( 'Deadline' ) . ': ' . $item['Project']['title'],\n\t\t\t\t\t'start' => $this->toJsDateFormat( CakeTime::fromString( $item['Project']['deadline'] ) ),\n\t\t\t\t\t'backgroundColor' => COLOR_SECURITY\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $calendar_events;\n\t}", "private function getEventsForCalendar() {\n $q = sqlquery(\"SELECT `ev`.`id`, `ev`.`event_name`, `ev`.`description`, `ev`.`con_day`, `ev`.`start_time`, `ev`.`end_time`, `el`.`location_name`, `el`.`id` as `location_id`, `et`.`track_name`, `et`.`track_color`\n FROM `bc_events` `ev`, `bc_events_locations` `el`, `bc_events_tracks` `et`\n WHERE `ev`.`location_id` = `el`.`id`\n AND `ev`.`track_id` = `et`.`id`\n AND `ev`.`con_day` != 4\n ORDER BY `ev`.`start_time` ASC\");\n\n $items = array();\n while ($f = sqlfetch($q)) {\n $f['leftIndex'] = -1;\n $f['numColumns'] = '';\n $eId = $f['id'];\n $items['eid'.$eId] = $f;\n }\n\n return $items;\n }", "public function test_getEventsFromStory_ACharacterId_clientReturnEventsCollection()\n {\n $jsonResponse = file_get_contents(__DIR__ . '/../Fixtures/getEventsCollection.json');\n\n $this->client\n ->expects($this->once())\n ->method('send')\n ->will($this->returnValue($jsonResponse));\n\n $sut = new StoriesRepository($this->client);\n $characterData = $sut->getEventsFromStory(1011334, $this->queryMock);\n $this->assertInstanceOf('Octante\\MarvelAPIBundle\\Model\\Collections\\EventsCollection', $characterData);\n }", "function drawDeleteCalendar(&$calendar, $pidList='') {\t\n\t\t/* Call the view and pass it the calendar to draw */\n\t\t$viewObj = $this->getServiceObjByKey('cal_view', 'delete_calendar', '_delete_calendar');\n\t\t$content = $viewObj->drawDeleteCalendar($calendar, $pidList, $calendar);\n\t\t\n\t\treturn $content;\n\t}", "public function listCalendars()\n {\n return $this->httpGet(\"/\" . self::API_VERSION . \"/calendars\");\n }", "public function calendarAction()\n\t{\n\t\tif($this->identity > 0) {\n\n\t\t\t$resourceId = (int) str_replace('a_calendar_','',$this->_request->getParam('rsrc_id'));\n\t\t\t$user_id = Zend_Auth::getInstance()->getIdentity()->user_id;\n\t\n\t\t\t// Turns off automatic rendering to the template\n\t\t\t$this->_helper->viewRenderer->setNoRender();\n\t \n\t \t// select options\n\t $options = array('rsrc_id'\t=>\t$resourceId,\n\t \t\t\t\t 'user_id'\t=>\t$user_id\n\t \t\t\t);\n\t \n\t if ($calendarId = DatabaseObject_UserCalendar::getCalendar($this->db, $options)) {\n\t \t// We got a calendar entry, so the user wants to get rid of it\n\t \t$calendar = new DatabaseObject_UserCalendar($this->db);\n\t \t$calendar->load($calendarId);\n\t \t$calendar->delete();\n\t \t\n\t \t$calendard = \"false\";\n\t } else {\n\t \t// Nothing was returned so it's a new calendar\n\t \t$calendar = new DatabaseObject_Usercalendar($this->db);\n\t \t$calendar->user_id = $user_id;\n\t \t$calendar->rsrc_id = $resourceId;\n\t \t$calendar->save();\n\t \t\n\t \t$calendard = \"true\";\n\t }\n\t \n\t $output = $calendard;\n\t \n\t echo $output;\n\t\t} else {\n\t\t\tdie(\"Access Denied\");\n\t\t}\n\t}", "private function getCalendar()\n {\n $strURL = $this->_strCalendarID ? $this->_strCalendarID : 'http://www.google.com/calendar/feeds/default/owncalendars/full';\n $arrHeaders = array('Authorization: GoogleLogin auth='.$this->_strToken);\n\n $arrCurlOptions = array(\n CURLOPT_RETURNTRANSFER => 1, // Return Page contents.\n CURLOPT_CONNECTTIMEOUT => 10,\n CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',\n CURLOPT_URL => $strURL,\n CURLOPT_FOLLOWLOCATION => TRUE,\n CURLOPT_HTTPHEADER => $arrHeaders,\n CURLOPT_HEADER => FALSE\n );\n \n $ch = curl_init(); // Initialize a CURL session.\n curl_setopt_array($ch, $arrCurlOptions);\n \n $strRawCalendarXML = curl_exec($ch);\n //$this->strResult .= $strRawCalendarXML;\n curl_close($ch); // close curl resource, and free up system resources.\n array_push($this->arrEventLog, $strRawCalendarXML);\n $this->_strCalendar = simplexml_load_string($strRawCalendarXML);\n }", "public function getAccessibleCalendars() {\n\t\t$ids = array();\n\t\t$res = SQLQuery::create()->bypassSecurity()->select(\"UserCalendar\")->where(\"user\",PNApplication::$instance->user_management->user_id)->execute();\n\t\tforeach ($res as $r)\n\t\t\tarray_push($ids, $r[\"calendar\"]);\n\t\t$res = SQLQuery::create()->bypassSecurity()->select(\"CalendarRights\")->execute();\n\t\tforeach ($res as $r) {\n\t\t\tif (in_array($r[\"calendar\"], $ids)) continue;\n\t\t\tif (PNApplication::$instance->user_management->hasRight($r[\"right_name\"], $r[\"right_value\"]))\n\t\t\t\tarray_push($ids, $r[\"calendar\"]);\n\t\t}\n\t\treturn $ids;\n\t}", "public function testPutCharactersCharacterIdCalendarEventId()\n {\n\n }", "public function getEventsCalendar() {\n global $cms;\n\n $cacheFile = $this->cache_base.'event-schedule-calendar.btc';\n $cacheAge = $this->cacheAge($cacheFile);\n\n if ($cacheAge === false || $cacheAge < (time() - $this->maxCacheAge) || $this->debug) {\n $result = $this->getCalendarSchedule();\n file_put_contents($cacheFile, json_encode($result));\n chmod($cacheFile, 0777);\n } else {\n $result = json_decode(file_get_contents($cacheFile), true);\n }\n\n return $result;\n }", "public function test_getEventsFromCreator_ACharacterId_clientReturnEventsCollection()\n {\n $jsonResponse = file_get_contents(__DIR__ . '/../Fixtures/getEventsCollection.json');\n\n $this->client\n ->expects($this->once())\n ->method('send')\n ->will($this->returnValue($jsonResponse));\n\n $sut = new CreatorsRepository($this->client);\n $characterData = $sut->getEventsFromCreator(1011334, $this->queryMock);\n $this->assertInstanceOf('Octante\\MarvelAPIBundle\\Model\\Collections\\EventsCollection', $characterData);\n }", "public function get_calendar()\n {\n $obj = new View();\n if (! $this->authorized()) {\n $obj->view('json', array('msg' => 'Not authorized'));\n return;\n }\n \n $queryobj = new Icloud_model();\n $sql = \"SELECT COUNT(1) as total,\n COUNT(CASE WHEN `calendar_enabled` = 1 THEN 1 END) AS 'yes',\n COUNT(CASE WHEN `calendar_enabled` = 0 THEN 1 END) AS 'no'\n from icloud\n LEFT JOIN reportdata USING (serial_number)\n WHERE\n \".get_machine_group_filter('');\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the report of the given feature
public function getReportByFeature(GherkinInterface $feature) { $filename = $feature->getFile(); foreach ($this->reports as $report) { if ($report->getFile() === $feature->getFile()) { return $report; } } return new ModelReport(null); }
[ "function getReport() ;", "public function getReport();", "public function getFeature($feature);", "private function reportGet(){\n $reportID = $this->args[0];\n $report = new Report();\n $report->fetch($reportID);\n return $report->toArray();\n }", "function generateReport()\n {\n //Get all programs user wants a report on from form post\n $surveysToReportOn = $_GET['surveys'];\n $featureYear = $_GET['yearToFeature'];\n $viewFactory = new ReportFactory();\n $content = $viewFactory->buildReportUI($this->getReportData($surveysToReportOn, $featureYear), $featureYear);\n return $content;\n }", "protected function getReport()\n {\n return $this->report;\n }", "public function getReport()\n {\n return $this->report;\n }", "function plan_feature($feature) {\n \n // Get codeigniter object instance\n $CI = get_instance();\n \n // Load User Model\n $CI->load->model('user');\n \n // Load Plans Model\n $CI->load->model('plans');\n \n // Get user id\n $user_id = $CI->user->get_user_id_by_email($CI->session->userdata['user_email']);\n \n //Return the plan's feature\n return $CI->plans->get_plan_features($user_id, $feature);\n \n }", "public function getFeature($feature) {\n if(!isset($this->features)) {\n $response = TerminusCommand::request('sites', $this->id, 'features', 'GET');\n $this->features = (array)$response['data'];\n }\n if(isset($this->features[$feature])) {\n return $this->features[$feature];\n }\n return null;\n }", "function getFeatureInformation($feature_id)\n {\n $data_array = $this->executeQuery(\"\n SELECT title, description, priority, status, project_id, release_id\n FROM feature\n WHERE id = {$feature_id}\n \");\n\n return $data_array[0];\n }", "function get_report_1_using_short_syntax(){\n global $workbooks;\n $result = $workbooks->assertGet('/reporting/reports.api?_ff[]=id&_ft[]=eq&_fc[]=1')['data'][0];\n $workbooks->log('Result', $result, 'debug', 200000); //log 200000 characters of the result. This is more than the default logging, may be too noisy.\n return $result;\n}", "public function getFeature( $feature )\n\t\t{\n\t\t\tif ( ! in_array( $feature, $this->feature_flags ) ) throw new Exception( \"The feature flag '${feature}' has not been initialized.\" );\n\n\t\t\treturn new ff_FeatureFlag( $feature );\n\t\t}", "public function getReport()\n {\n switch(isset($_REQUEST[\"report_format\"])?$_REQUEST[\"report_format\"]:\"pdf\")\n {\n case \"pdf\":\n $report = new PDFReport(\n isset($_REQUEST[\"page_orientation\"]) ? \n $_REQUEST[\"page_orientation\"] : \n PDFReport::ORIENTATION_LANDSCAPE,\n isset($_REQUEST[\"paper_size\"]) ? \n $_REQUEST[\"paper_size\"] :\n PDFReport::PAPER_A4\n );\n break;\n case \"html\":\n $report = new HTMLReport();\n $report->htmlHeaders = true;\n break;\n case \"html-no-headers\":\n $report = new HTMLReport();\n break;\n case \"xls\":\n $report = new XLSReport();\n break;\n case \"doc\":\n $report = new MSWordReport();\n break;\n case \"json\":\n $report = new JSONReport();\n break;\n }\n return $report;\n }", "static public function getReportInfo(){\r\n\t\t$details = self::_getReportDetail();\r\n\t\treturn $details;\r\n\t}", "public function getReports();", "public function getDetailedReport() {\n if ($this->session->userdata('role') == 100) {\n $request = $_REQUEST;\n $param = datatable_param($request, 'agenti.businessname');\n $campuses = @$request['campuses'];\n $agents = @$request['agents'];\n $sqlPart = $this->sqlPart($campuses, $agents);\n if (empty($sqlPart)) {\n echo datatable_json($request['draw'], 0, array());\n exit(0);\n } else {\n $reportData = $this->invoice->paginateDetailedReportData($sqlPart, $param);\n $reportCount = $this->invoice->getDetailedReportCount($sqlPart);\n $reportCount = isset($reportCount->count) ? $reportCount->count : 0;\n echo datatable_json($request['draw'], $reportCount, $reportData);\n exit(0);\n }\n }\n }", "public function show_feature(){\n\t\t\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/settings_api/all_feature';\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\treturn $response;\t\t\n\t\t\n\t}", "protected abstract function generateReport();", "function get_report_by_name($name){\n\tglobal $workbooks;\n\t$response = $workbooks->assertGet('/reporting/reports.api', array( \n\t\t'_ff[]' => 'name',\n\t\t'_ft[]' => 'eq',\n\t\t'_fc[]' => $name));\n\t$result = $response['data'][0];\n $workbooks->log('Result', $result, 'debug', 200000); //log 200000 characters of the result. This is more than the default logging, may be too noisy.\n\treturn $result;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get source code of the Upload step from modification readme file
function getUploadCode() { if (strpos($this->readmeFile, 'UPLOAD ]--') === false) return false; $uploadCode = substr($this->readmeFile, strpos($this->readmeFile, 'UPLOAD ]--')); // Mpok's style (first line - English, second - translation) if (preg_match('/\]-+\s*\n#-+\[/si', $uploadCode)) $uploadCode = preg_replace('/(\]-+\r?\n)#-+.*?\n/si', '$1', $uploadCode, 1); $uploadCode = substr($uploadCode, strpos($uploadCode, "\n") + 1); $uploadCode = substr($uploadCode, 0, strpos($uploadCode, '#--')); return trim($uploadCode, '#'."\n\r"); }
[ "public function getSourceFile() {}", "protected function getOriginalSource() {\r\n\t\t$raw = $this->getRaw();\r\n\t\t$file = $raw['file'];\r\n\t\tglobal $wp_version;\r\n\t\t$relPath = Scan_Api::convertToUnixPath( $file );\r\n\t\t$source_file_url = \"http://core.svn.wordpress.org/tags/$wp_version/\" . $relPath;\r\n\t\tif ( ! function_exists( 'download_url' ) ) {\r\n\t\t\trequire_once ABSPATH . 'wp-admin' . $ds . 'includes' . $ds . 'file.php';\r\n\t\t}\r\n\t\t$tmp = download_url( $source_file_url );\r\n\t\tif ( is_wp_error( $tmp ) ) {\r\n\t\t\treturn $tmp;\r\n\t\t}\r\n\t\t$content = file_get_contents( $tmp );\r\n\t\t@unlink( $tmp );\r\n\r\n\t\treturn $content;\r\n\t}", "public function source_file()\n\t{\n\t\treturn $this->_source_file;\n\t}", "public function getSourceFileName(): string;", "private function getSourceFile() {\n return $this->sourceFile;\n }", "function getPostStub(): string {\n\t\t\t$firstLineBreak = strpos($this->file, \"\\n\") + 2;\n\t\t\t$secondLineBreak = strpos($this->file, \"\\n\", $firstLineBreak);\n\t\t\treturn substr($this->file, $firstLineBreak, $secondLineBreak - $firstLineBreak);\n\t\t}", "function md_github_handler($atts) {\n //get API path from file URL\n $json = get_api_path($atts, 'file')\n $md_output = base64_decode($json['content'])\n //send back text to replace shortcode in post\n return $md_output;\n}", "protected function getFileSource() {\n\t\t$extractor = $this->getSourceExtractor();\n\t\treturn $extractor->getFileSource();\n\t}", "public function getSourceFileName();", "public function getPageSourceCode()\n {\n return $this->sessionGet('/source');\n }", "public function get_source_file()\n {\n if (isset($this->_properties['source_file']))\n {\n return $this->_properties['source_file'];\n }\n else\n {\n return $this->tmp_file;\n }\n }", "public function getSource() {\n\t\treturn @file_get_contents($this->getPath());\n\t}", "private function getSource()\n {\n $source = rtrim(trim(\\file_get_contents($this->_path)), '}');\n return \\preg_replace('/\\<\\?php/', '', $source, 1);\n }", "public function upload()\n {\n return $this->di()->getPluginManager()->getRequestPlugin(self::FILE_UPLOAD);\n }", "public function get_Original_Source()\n {\n return $this->orig_src;\n }", "public function getFileDescription();", "public function getSource()\n {\n return Yii::$app->storage->fileAbsoluteHttpPath($this->filter_id . '_' . $this->file->name_new_compound);\n }", "public function getDescription()\n {\n return $this->modx->lexicon('fileinput.description');\n }", "public function readme();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function setEventID Set the event ID for registration recording return [void]
function setEventID($eventID) { $this->setValueByFieldName('event_id',$eventID); //return $this->getValueByFieldName( 'applicant_codename' ); }
[ "public function setEventID($eventID){\n\t\t$this->authenticationFactory->setEventID($eventID);\n\t}", "function setEventId($id)\r\n {\r\n $this->_eventid = $id ;\r\n }", "public function setEventId($event_id)\r\n\t{\r\n\t\t$this->event_id = $event_id;\r\n\t}", "public function setEventId($id) {\n\t\t$this->id = $id;\n\t}", "function setEventID($inEventID) {\n\t\tif ( $inEventID !== $this->_EventID ) {\n\t\t\t$this->_EventID = $inEventID;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setEventId($id = 0);", "public function setEventPageId($eID, $id)\r\n {\r\n if (!filter_var($eID, FILTER_VALIDATE_INT)) {\r\n echo(\"Event ID is not valid\");\r\n } else {\r\n $graphModule = new Graph();\r\n $this->_pID = $id;\r\n $update['pID'] = $id;\r\n $graphModule->updateNodeById($eID, $update);\r\n }\r\n }", "function setRegID($regID) \n {\n $this->setValueByFieldName('registration_id',$regID);\n }", "public function setEvent( $event );", "function SetEvent($event)\n {\n $this->ApplicationObj->Event=$event;\n }", "public function setEventId($id) {\n $this->eventId = $id;\n $this->userEvent = $this->userEventRepository->findOneBy(array('idEvent' => $this->eventId, 'idUser' => $this->userId));\n }", "function setRegID($regID) \n {\n $this->setValueByFieldName('reg_id',$regID);\n }", "final private function SetEmployeeID($eID)\n\t\t{\n\t\t}", "public function get_event_id(){\n\t\treturn $this->event_id;\n\t}", "public function setEvent($event) {\r\n\t$this->event = $event;\r\n }", "public function setDeviceIdentifier()\n {\n //\n $identifier = $this->_getIdentifierFromRequest();\n $this->_setIdentifier($identifier);\n\n //\n $this->_log->debug(__METHOD__ . \"() Device Identifier is set to $identifier\");\n }", "public function getEventID() {\n return $this->_getField(\"eventID\", 0, 2);\n }", "function setEventAdminID($eventAdminID) \n {\n $this->setValueByFieldName('eventadmin_id',$eventAdminID);\n }", "public function setEventName($event)\n\t{\n\t\t$this->event_name = $event;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for templatesIdPortalFoldersRelFkDelete Remove the portalFolders relation to an item by id..
public function testTemplatesIdPortalFoldersRelFkDelete() { }
[ "public function testTeamsIdTemplatesNkPortalFoldersRelFkDelete()\n {\n\n }", "public function testTemplatesIdPortalFoldersDelete()\n {\n\n }", "public function testDeleteFoldersId()\n {\n }", "public function testTeamsIdPortalsNkTemplateFoldersFkDelete()\n {\n\n }", "public function testTeamsIdTemplateFoldersFkDelete()\n {\n\n }", "public function testImageFoldersIdChildrenFkDelete()\n {\n\n }", "public function testTeamsIdPortalsNkTemplateFoldersDelete()\n {\n\n }", "public function testTeamsIdPortalsNkImageFoldersRelFkDelete()\n {\n\n }", "public function testTeamsIdImageFoldersNkPortalsRelFkDelete()\n {\n\n }", "public function testDesignFoldersIdDesignsFkDelete()\n {\n\n }", "public function testTeamMembersIdDesignFoldersFkDelete()\n {\n\n }", "public function testTeamsIdPortalsNkTemplateRelsFkDelete()\n {\n\n }", "public function testImageFoldersIdFolderMembersDelete()\n {\n\n }", "public function testImageFoldersIdMembersDelete()\n {\n\n }", "public function testTeamsIdImageFoldersNkMembersRelFkDelete()\n {\n\n }", "function delete( $id )\n {\n $info = eZIMAPMailFolder::decodeFolderID( $id );\n $account = new eZMailAccount( $info[\"AccountID\"] ); \n eZIMAPMailFolder::deleteMailBox( $account, $info[\"FolderName\"] );\n }", "function deleteFolders($postData);", "public function testTemplatesIdPortalFoldersRelFkPut()\n {\n\n }", "public function testTeamMembersIdTeamImageFoldersFkDelete()\n {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
str2hex Encodes String to Hex
function str2hex($string) { $hex = ""; for ($i = 0; $i < strlen($string); $i++) { $hex .= (strlen(dechex(ord($string[$i]))) < 2) ? "0" . dechex(ord($string[$i])) : dechex(ord($string[$i])); } return $hex; }
[ "public function encode_hex($str);", "function bin2hex ($str) {}", "public static function GetHexFromString($str)\n {\n //---\n $result = '';\n for($i = 0; $i < strlen($str); $i++)\n {\n $result .= sprintf(\"%02x\", ord($str[$i]));\n }\n //---\n return $result;\n }", "function SetToHexString($str)\n{\nif(!$str)return false;\n$tmp=\"\";\nfor($i=0;$i<strlen($str);$i++)\n{\n$ord=ord($str[$i]);\n$tmp.=SingleDecToHex(($ord-$ord%16)/16);\n$tmp.=SingleDecToHex($ord%16);\n}\nreturn $tmp;\n}", "function bin2hex2($str11) \r\n{\r\n $hex = \"\";\r\n $i = 0;\r\n do {\r\n $hex .= sprintf(\"%02x\", ord($str11{$i}));\r\n $i++;\r\n } while ($i < strlen($str11)-24);\r\n return $hex;\r\n}", "function strToHex($string,$separador=\"\\x\"){\n $hex = '';\n for ($i=0; $i<strlen($string); $i++){\n $ord = ord($string[$i]);\n\n $hexCode = dechex($ord);\n \n $hex .= $separador.substr('0'.$hexCode, -2);\n }\n return ($hex);\n}", "public static function stringToHex($s)\n\t{\n\t\t$r = \"0x\";\n\t\t$hexes = array (\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\");\n\t\tfor ($i=0; $i<strlen($s); $i++) {\n\t\t\t$r .= ($hexes [(ord($s{$i}) >> 4)] . $hexes [(ord($s{$i}) & 0xf)]);\n\t\t}\n\t\treturn $r;\n\t}", "function base64_to_hex($str_to_conv) {\n\n\t$bin_cod = '';\n\n\t$bin_string = '';\n\tfor ($i=0; $i<strlen($str_to_conv); $i++) { \n\t\t$base_64_key = array_search($str_to_conv[$i], $base64_code);\n\t\t$bin_string .= sprintf(\"%06d\", decbin($base_64_key));\n\t}\n\n\t$hex_string = '';\n\tfor ($i=0; $i < strlen($bin_string); $i += 4) { \n\t\t$hex_string .= base_convert(substr($bin_string, $i, 4), 2, 16);\n\t}\n\n\treturn $hex_string;\n}", "function nice_hex($str) {\n return strtoupper(implode(' ',str_split($str,2)));\n}", "function encodeString( $theString )\n\t{\n\t\t//\n\t\t// Detect encoding.\n\t\t//\n\t\tif( mb_detect_encoding( $theString ) != 'UTF-8' )\n\t\t\t$theString = mb_convert_encoding( $theString, 'UTF-8' );\n\t\t\n\t\treturn '0x'.bin2hex( $theString );\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\t\n\t}", "protected function utf_to_hexseq($str)\n\t{\n\t\t$pos = 0;\n\t\t$len = strlen($str);\n\t\t$ret = array();\n\n\t\twhile ($pos < $len)\n\t\t{\n\t\t\t$c = $str[$pos];\n\t\t\tswitch ($c & \"\\xF0\")\n\t\t\t{\n\t\t\t\tcase \"\\xC0\":\n\t\t\t\tcase \"\\xD0\":\n\t\t\t\t\t$utf_char = substr($str, $pos, 2);\n\t\t\t\t\t$pos += 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"\\xE0\":\n\t\t\t\t\t$utf_char = substr($str, $pos, 3);\n\t\t\t\t\t$pos += 3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"\\xF0\":\n\t\t\t\t\t$utf_char = substr($str, $pos, 4);\n\t\t\t\t\t$pos += 4;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$utf_char = $c;\n\t\t\t\t\t++$pos;\n\t\t\t}\n\n\t\t\t$hex = dechex($this->utf_to_cp($utf_char));\n\n\t\t\tif (!isset($hex[3]))\n\t\t\t{\n\t\t\t\t$hex = substr('000' . $hex, -4);\n\t\t\t}\n\n\t\t\t$ret[] = $hex;\n\t\t}\n\n\t\treturn strtr(implode(' ', $ret), 'abcdef', 'ABCDEF');\n\t}", "static public function bin2hex($str, $pad_length) {\n return str_pad(bin2hex($str), $pad_length, \"0\", STR_PAD_LEFT);\n }", "function hex2str($hex)\n {\n \t$str=0;\n for($i=0;$i<strlen($hex);$i+=2)\n \n $str += ord(chr(hexdec(substr('0x'.$hex,$i,2))));\n\n return dechex($str);\n }", "function _escape_hex($str=\"\", $entity=false) {\r\n\t\t\t$prestr = $entity ? '&#x' : '%';\r\n\t\t\t$poststr= $entity ? ';' : '';\r\n\t\t\tfor ($i=0; $i < strlen($str); $i++) {\r\n\t\t\t\t$return .= $prestr.bin2hex($str[$i]).$poststr;\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t\t}", "function hex2str($hex){\n\t\t$str=\"\";\n\t\tfor($i=0;$i<strlen($hex);$i+=2){\n\t\t\t$str.=chr(hexdec(substr($hex,$i,2)));\n\t\t}\n\t\treturn $str;\n\t}", "function bin2hex($data) {}", "function ascii2hex($ascii){\n $hex=array();\n for($i=0;$i<strlen($ascii);$i++){\n $byte=strtoupper(dechex(ord(substr($ascii,$i,1))));\n $byte=str_repeat('0',2-strlen($byte)).$byte;\n $hex[]=$byte;\n }\n return implode($hex);\n}", "protected function encode ( &$str ) {\n\n if($this->isEncoded === false) {\n\n $key = rand(100, 999);\n $str = str_replace('@', '_AT_', $str);\n $str = urlencode($str);\n $tmp = $str;\n $length = strlen($tmp);\n $str = '';\n\n for($i = 0; $i < $length; $i++)\n $str .= chr(ord($tmp{$i}) + $key);\n\n $str = urlencode(chr($key) . $str);\n unset($tmp);\n\n $this->isEncoded = true;\n }\n\n return $str;\n }", "public function encodeString($str) {\n $out= '';\n $flags= array_fill(0, strlen($str)+ 1, FALSE);\n array_pop($flags);\n $p= new PunyCode();\n $p->encode($str, $out, $flags);\n return $out;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes all rows from the paypal_order_version table.
public static function doDeleteAll(ConnectionInterface $con = null) { return PaypalOrderVersionQuery::create()->doDeleteAll($con); }
[ "static function deleteAll() {\n $GLOBALS['DB']->exec(\"DELETE FROM products;\");\n }", "public function purgeVersionTable()\n\t{\n\t\t// Truncate the table\n\t\t$this->Database->execute(\"TRUNCATE TABLE tl_version\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the undo table', 'Automator purgeVersionTable()', TL_CRON);\n\t}", "public function purgeVersionTable()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_version\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the version table', __METHOD__, TL_CRON);\n\t}", "public function deleteAll() {\n $sql = \"DELETE FROM \" . $this->tableName;\n $this->runRequest($sql);\n }", "public function purgeVersionTable()\n {\n $blnPurge = static::cleanVersionTable(true);\n\n // Add a log entry\n if ($blnPurge)\n {\n \\System::log('Purged the version table', __METHOD__, TL_CRON);\n\n return;\n }\n\n \\System::log('Cleared non persistent entries from version table', __METHOD__, TL_CRON);\n }", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "function deleteAll() {\n\t\t$this->initTable();\n\t\tif ($this->filter != null) {\n\t\t\t$joins = $this->filter->getJoinSql();\n\t\t\t$conditions = $this->filter->getConditionSql();\n\t\t\t$order = $this->filter->getOrderSql();\n\t\t\t$sql = \"DELETE FROM $this->fullTable $joins\n\t\t\t\t\t\t$conditions\";\n\t\t} else {\n\t\t\t$sql = \"DELETE FROM $this->fullTable\";\n\t\t}\n\n\t\t$this->databaseControl->query($sql);\n\t}", "public function delete(ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(PaypalOrderVersionTableMap::DATABASE_NAME);\n }\n\n $criteria = $this;\n\n // Set the correct dbName\n $criteria->setDbName(PaypalOrderVersionTableMap::DATABASE_NAME);\n\n $affectedRows = 0; // initialize var to track total num of affected rows\n\n try {\n // use transaction because $criteria could contain info\n // for more than one table or we could emulating ON DELETE CASCADE, etc.\n $con->beginTransaction();\n\n\n PaypalOrderVersionTableMap::removeInstanceFromPool($criteria);\n\n $affectedRows += ModelCriteria::delete($con);\n PaypalOrderVersionTableMap::clearRelatedInstancePool();\n $con->commit();\n\n return $affectedRows;\n } catch (PropelException $e) {\n $con->rollBack();\n throw $e;\n }\n }", "public function DeletePaypalBatch() {\n\t\t\t$this->objPaypalBatch->Delete();\n\t\t}", "protected function deleteAll()\n {\n $sql = \"DELETE FROM \" . $this->properties->getTableAutologin() . \" WHERE \" . $this->properties->getColUkey() . \" = :key\";\n $stmt = $this->connection->prepare($sql);\n $stmt->bindValue(':key', $_SESSION[$this->properties->getSessUkey()]);\n $stmt->execute();\n }", "public function deleteAll()\n {\n $connection = $this->getEntityManager()->getConnection();\n $dbPlatform = $connection->getDatabasePlatform();\n\n $connection->executeUpdate($dbPlatform->getTruncateTableSQL('annonce'));\n }", "public function deleteAll()\n {\n $this->Record\n ->from(self::TABLE_SETTINGS)\n ->where('company_id', '=', Configure::get('Blesta.company_id'))\n ->delete();\n }", "function remove() {\n $keys = \"\";\n $keys_array = $this->keys();\n for ($i = 0; $i < sizeof($keys_array); $i ++) {\n $keys .= \"'\" . $keys_array[$i] . \"',\";\n }\n $keys = substr($keys, 0, - 1);\n \n if (MODULE_PAYMENT_CGP_DROP_TABLE === 'True') {\n tep_db_query(\"DROP TABLE IF EXISTS `CGP_orders_table`\");\n }\n \n tep_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN (\" . $keys . \")\");\n }", "public function deleteAll() {\n \n $stmt = $this->pdo->prepare('DELETE FROM stocks');\n $stmt->execute();\n return $stmt->rowCount();\n }", "public static function destroy_all() {\n global $wpdb;\n $tablename = $wpdb->prefix . 'vipps_login_sessions';\n $q = $wpdb->prepare(\"DELETE FROM `{$tablename}` WHERE %d\",1);\n $wpdb->query($q);\n }", "static function deleteAll(){\n $GLOBALS['DB']->exec(\"DELETE FROM reviews;\");\n }", "public static function deleteAllAuctionResults() {\r\n \tCommonDao::connectToDb();\r\n \t$query = \"delete from auction where auction_id > 0\";\r\n \tmysql_query($query);\r\n }", "public function delete() {\n $pk = $this->model->getPrimaryKey();\n $result = $this->select($pk, 'id')\n ->getDataSource();\n $tablenames = $this->model->getAllTableNames();\n foreach ($result as $row) {\n foreach ($tablenames as $tablename) {\n PerfORMController::getConnection()->query(\"DELETE FROM %n\", $tablename, 'where %n = %i', $pk, $row->{$pk});\n PerfORMController::addSql(dibi::$sql);\n }\n }\n }", "private function delete_all_records() {\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query( \"DROP TABLE {$wpdb->stream}\" );\n\t\t$wpdb->query( \"DROP TABLE {$wpdb->streammeta}\" );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if a cached file is outdated based on a time of reference.
public static function outdated( $path, $time ) { return (Cache::modified($path) < $time); }
[ "public function isOld()\n {\n return ! (file_exists($this->getCacheFile()) && filemtime($this->getCacheFile()) + static::$seconds >= time());\n }", "protected function wasCached()\n {\n $this->start = microtime(true);\n // Location to lookup or store cached file\n $this->cache_file_name = $this->cache_folder.md5(\",a1b2c3d4e5f6g7h8i9ABB!\");\n return file_exists($this->cache_file_name) ? filemtime($this->cache_file_name) : 0;\n }", "public function isUpdateRequired()\n {\n $CacheCreated = filemtime($this->cachedPath);\n $CacheRenewal = $CacheCreated + $this->CacheLife;\n if(time() >= $CacheRenewal)\n return true;\n else\n return false;\n }", "public function isCached() \n {\n $modified = (file_exists($this->cache_file)) ? filemtime($this->cache_file) : 0;\n return ((time() - $this->cache_expires) < $modified);\n }", "private function _isCacheOld($cacheFile) {\n\t\t// time now - cache lifetime\n\t\t$goodTime = time() - (self::CACHE_LIFE * 60);\n\t\t$cacheAge = filemtime($cacheFile);\n\t\t// return TRUE if file age 'within' good time\n\t\treturn ($goodTime < $cacheAge) ? FALSE : TRUE;\n\t}", "public function isFresh(): bool\n {\n if (!is_file($this->file)) {\n return false;\n }\n\n if ($this->resourceCheckers instanceof \\Traversable && !$this->resourceCheckers instanceof \\Countable) {\n $this->resourceCheckers = iterator_to_array($this->resourceCheckers);\n }\n\n if (!\\count($this->resourceCheckers)) {\n return true; // shortcut - if we don't have any checkers we don't need to bother with the meta file at all\n }\n\n $metadata = $this->getMetaFile();\n\n if (!is_file($metadata)) {\n return false;\n }\n\n $meta = $this->safelyUnserialize($metadata);\n\n if (false === $meta) {\n return false;\n }\n\n $time = filemtime($this->file);\n\n foreach ($meta as $resource) {\n foreach ($this->resourceCheckers as $checker) {\n if (!$checker->supports($resource)) {\n continue; // next checker\n }\n if ($checker->isFresh($resource, $time)) {\n break; // no need to further check this resource\n }\n\n return false; // cache is stale\n }\n // no suitable checker found, ignore this resource\n }\n\n return true;\n }", "private function isCacheExpired(): bool\n\t{\n\t\t$path = $this->_cacheFolder . $this->generateCacheName();\n\t\tif (file_exists($path)) {\n\t\t\t$filetime = filemtime($path);\n\t\t\treturn $filetime < (time() - $this->_cacheTtl);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private function isModified(): bool\n {\n \\clearstatcache(false, $this->file);\n\n return $this->lastModified < \\filemtime($this->file);\n }", "private function getCachedVersion()\n {\n // init\n $ret = false;\n \n // Only continue if not forced updated\n if( null === $this->options->getOption('update-cache') )\n {\n if( file_exists( $this->cacheFileName ) && is_readable( $this->cacheFileName ) )\n {\n // Check cache age (1 day)\n if( filemtime($this->cacheFileName) >= (time() - 604800) )\n {\n $ret = file_get_contents( $this->cacheFileName );\n $ret = unserialize( $ret );\n }\n }\n }\n \n // Return\n return $ret;\n }", "private function checkCacheVersion()\n {\n $file = $this->getDirectory() . '/.version';\n\n if (!file_exists($file)) {\n return false;\n }\n\n $version = md5($this->app['bolt_version'].$this->app['bolt_name']);\n $cached = file_get_contents($file);\n\n if ($version === $cached) {\n return true;\n }\n\n return false;\n }", "public function getHasChanged()\n\t{\n\t\treturn @filemtime($this->_fileName)!==$this->_timestamp;\n\t}", "function cacheNeedsUpdating($uri, $cache, $time)\r\n {\r\n $cache_mod = file_exists($cache) ? filemtime($cache) : 0;\r\n if ($this->isLocalFilename($uri))\r\n $uri_mod = file_exists($uri) ? filemtime($uri) : 0;\r\n else\r\n $uri_mod = $this->remoteModTime($uri);\r\n\r\n $t = $time ? $time : $this->cacheTime;\r\n return (ceil((time() - $cache_mod) / 60) >= $t || $uri_mod >= $cache_mod);\r\n }", "public function CheckCacheDates () {\n\n if ($this->aDailyStatus [\"refreshedDate\"] == $this->aDailyStatus_cached [\"refreshedDate\"]) {\n return false;\n } else {\n return true;\n }\n\n }", "private function checkIfCached($ttl) {\n\t\tif ($ttl == 0) return false;\n\t\tif (file_exists(TEMPLATE_DIR.$this->output_file. HTML_EXTENSION)) // Output file already present\n\t\t\tif ((filemtime(TEMPLATE_DIR.$this->output_file. HTML_EXTENSION) + $ttl) > time()) // it is recent\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "private function imageInCache(){\n if (file_exists($this->cachedFile) && \n ( filemtime($this->cachedFile)>filemtime($this->pathToImages.$this->fname)) &&\n ( filectime($this->cachedFile)>filectime($this->pathToImages.$this->fname)) ) {\n return true;\n }else return false;\n }", "protected function _checkCachedTimes($file)\n {\n $coreConfig = Loader::getConfiguration();\n $currentTime = time();\n $fileTime = filemtime($file);\n\n if ($coreConfig) {\n $validTime = $coreConfig->getCore()->getCacheTime();\n } else {\n $validTime = self::CACHE_CONFIG_TIME;\n }\n\n $expireTime = ($validTime * self::CACHE_BASE_TIME) + $fileTime;\n\n if ($expireTime > $currentTime) {\n return TRUE;\n }\n\n return FALSE;\n }", "function checkCache()\n {\n global $rss_cache;\n \n // Does they exits? If not, return nothing\n if (file_exists($rss_cache) && strlen(file_get_contents($rss_cache)) > 0) {\n $date_diff = @(time() - filemtime($rss_cache));\n if ($date_diff < 1000) {\n $status = true;\n } else {\n $status = false;\n }\n } else {\n $status = false;\n }\n return $status;\n }", "protected function isExpired()\n {\n $create_date = filemtime($this->cache_path . $this->filename);\n \n if( ($create_date+$this->ttl) > time() )\n {\n return true;\n }\n \n return false;\n }", "function file_is_newer ( $file ) {\n\t\t$db_time = $this->ref_read->fetch_max_tstamp ( );\n\n\t\tif ( file_exists ( $file ) ) {\n\t\t\t$ft = filemtime ( $file );\n\t\t\tif ( !($ft === FALSE) && ($db_time < $ft) ) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all tramite entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $tramites = $em->getRepository('MyBundle:Tramite')->findAll(); return $this->render('tramite/index.html.twig', array( 'tramites' => $tramites, )); }
[ "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tramites = $em->getRepository('AppBundle:Tramite')->findAll();\n\n return $this->render('tramite/index.html.twig', array(\n 'tramites' => $tramites,\n ));\n }", "public function getEntityList();", "public function getAllEntities()\n {\n return $this->getRepository()->findAll();\n }", "public function actionIndex()\n {\n $searchModel = new TramiteSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DGPlusbelleBundle:SeguimientoTratamiento')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MinsalsifdaBundle:SifdaEquipoTrabajo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AdminCommonBundle:Vitrine')->findAllByOrder();\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('BackendBundle:Tour')->findAll();\n\n return $this->render('BackendBundle:Tour:index.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MainBundle:LSubtransmision')->findBy(array(\n 'eliminado'=>'NO',\n 'historico'=>'NO'\n ));\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $entity = new PersonaTratamiento();\n $form = $this->createCreateForm($entity);\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DGPlusbelleBundle:PersonaTratamiento')->findAll();\n\n return array(\n 'entities' => $entities,\n 'form' => $form->createView(),\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('IntranetBundle:Tarea')->findAll();\n\n return $this->render('IntranetBundle:Tarea:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4ContableBundle:Egreso')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GarnetTaxiBeBundle:Ligne')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('tesisControltesisBundle:Alumno')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('BrasserieBundle:Levure')->findBy([], ['nom' => 'ASC']);\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SquadFttBundle:Joueur')->findAll();\n\n return $this->render('frontofficefrontBundle:Joueur:showAll.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('IntranetBundle:Tutorias')->findAll();\n\n return $this->render('IntranetBundle:Tutorias:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('NetpublicCoreBundle:Alumno')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ComDaufinBundle:VehiTrajVoyg')->findAll();\n\n return $this->render('ComDaufinBundle:VehiTrajVoyg:index.html.twig', array(\n 'entities' => $entities,\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new ticketFeeDetail The ticket fee information for this passsenger type code.
public function setTicketFeeDetail(\Devlabs91\TravelgateNotify\Models\Ota\PTCFareBreakdownType\PassengerFareAType\TicketFeeDetailAType $ticketFeeDetail) { $this->ticketFeeDetail = $ticketFeeDetail; return $this; }
[ "public function setFee($var)\n {\n GPBUtil::checkInt64($var);\n $this->fee = $var;\n\n return $this;\n }", "public function typeFeeDetails(?PaymentBalanceActivityFeeDetail $value): self\n {\n $this->instance->setTypeFeeDetails($value);\n return $this;\n }", "public function setFee($fee)\n {\n $this->fee = (int) $fee;\n }", "public function setFeeType($value)\n {\n $this->_fields['FeeType']['FieldValue'] = $value;\n\n return $this;\n }", "public function setfeeType($value)\n {\n $this->_fields['feeType']['FieldValue'] = $value;\n return $this;\n }", "public function getTicketFeeDetail()\n {\n return $this->ticketFeeDetail;\n }", "public function addToFee(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\FeeType $fee)\n {\n $this->fee[] = $fee;\n return $this;\n }", "public function setServiceFeeDetail(\\ericchew87\\WWEXSpeedShip2PHP\\Structs\\ServiceFeeDetail $serviceFeeDetail = null)\n {\n if (is_null($serviceFeeDetail) || (is_array($serviceFeeDetail) && empty($serviceFeeDetail))) {\n unset($this->serviceFeeDetail);\n } else {\n $this->serviceFeeDetail = $serviceFeeDetail;\n }\n return $this;\n }", "function setRegistrationFee($fee)\n {\n $this->__registration_fee = $fee ;\n }", "public function setFeeLevel($var)\n {\n GPBUtil::checkEnum($var, \\Pb\\FeeLevel::class);\n $this->feeLevel = $var;\n\n return $this;\n }", "public function addToFees(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\VehicleChargePurposeType $fee)\n {\n $this->fees[] = $fee;\n return $this;\n }", "function setRegistrationFee($fee)\n {\n $this->__registrationfee = $fee ;\n }", "function setFee($a_iFee)\n {\n $this->_iFee = (int) $a_iFee;\n $this->setSearchParameter('fee', $this->_iFee);\n }", "public function setFee(array $fee)\n {\n $this->fee = $fee;\n return $this;\n }", "public function typeTaxOnFeeDetails(?PaymentBalanceActivityTaxOnFeeDetail $value): self\n {\n $this->instance->setTypeTaxOnFeeDetails($value);\n return $this;\n }", "public function setFeeId(?string $feeId): void\n {\n $this->feeId['value'] = $feeId;\n }", "public function set_signup_fee($value)\n {\n\n // Sanitize and validate value\n $value = $this->sanitize_signup_fee($value);\n\n // Set property\n $this->set_property('signup_fee', $value);\n }", "public function testAddFee()\n {\n $this->addFee('testFeeOne');\n\n $fee = $this->laracart->getFee('testFeeOne');\n\n $this->assertEquals('$10.00', $fee->getAmount());\n $this->assertEquals(10, $fee->getAmount(false));\n }", "public function addToFees(\\Nogrod\\eBaySDK\\Trading\\FeeType $fee)\n {\n $this->fees[] = $fee;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the door count in current level
public function getDoorCount() { return intval($this->levelDetail['doorCount'] ?? 3); }
[ "public function getDoorNumber(): int\n {\n return $this->_door_number;\n }", "public function getCount()\n {\n return $this->floorCount;\n }", "public function getNumberOfDoorOptions(): int\n {\n return count($this->getDoorSelectionOptions());\n }", "public function getDoorId() : int\n {\n return $this->door_id;\n }", "public function getDoorNumber()\n {\n return $this->doorNumber;\n }", "public function getRoomInfoCount()\n {\n $value = $this->get(self::ROOMINFOCOUNT);\n return $value === null ? (integer)$value : $value;\n }", "function getNumberOfDoors() {\n\t\treturn $this->numberOfDoors;\n\t}", "public function level(): int\n {\n return $this->pluck('trophyLevel');\n }", "function getOpenCount() {\n\t\treturn $this->data_array['open_count'];\n\t}", "function get_levels() {\r\n\t\treturn $this->level + 1;\r\n\t}", "public function getLootCount()\n {\n return $this->count(self::_LOOT);\n }", "public function countOpenings()\n {\n return $this->openings->count();\n }", "public function drawsAsOCount() {\n return Game::where([[\"winner\", \"=\", \"d\"], ['player_o_id', '=', $this->id]])->count();\n }", "public function getNumberOfDoors() {\n return $this->_numberOfDoors;\n }", "public function count(): int\n {\n return count($this->ways);\n }", "public function getNumLevels();", "abstract public function getNumberOfDoors();", "public function getFloorManagerNumber(){\n $query = FloorManager::find()->count();\n return $query;\n }", "public function getLootsCount()\n {\n return $this->count(self::_LOOTS);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checkIfToday Checks if current date is in the past
function checkIfInThePast($date) { // set today date $today = date('Ymd'); // if date is less than today if (strtotime($date) < strtotime($today)) { // return true // i.e. yes date is in the past return true; } // if }
[ "function IsPastOrToday() {\n $today = date('Y-m-d');\n return $this->owner->RAW() <= $today;\n }", "public function isToday();", "private function isToday($date) \n {\n // compare the date to todays date minus 6 hours since days start and end at 06:00\n return date('Y-m-d') === date('Y-m-d',strtotime($date.' - 6 hours'));\n }", "function validTodayDate(){\n\t\t$today = $this->mydate->getDate();\n\n\t\t//check if today is year 2038 and later\n\t\tif(!$this->mydate->compatible && $this->mydate->getDate(\"Y\") >= 2038){\n\t\t\treturn false;\n\t\t}\n\n\t\t//check if today is in range of date allow\n\t\tif($this->time_allow1 != \"\"){\n\t\t\t//check valid if today is after date_allow1\n\t\t\tif($this->mydate->validDate($this->time_allow1) && !$this->mydate->dateAfter($this->time_allow1, $today))\n\t\t\t\treturn false;\n\t\t}\n\n\t\tif($this->time_allow2 > 0){\n\t\t\t//check valid if today is before date_allow2\n\t\t\tif($this->mydate->validDate($this->time_allow2) && !$this->mydate->dateBefore($this->time_allow2, $today))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isToday()\n {\n return $this->toDateString() === static::now($this->tz)->toDateString();\n }", "public function isToday()\n {\n return date('Y-m-d') == date('Y-m-d', strtotime($this->day));\n }", "public function isYesterday();", "function isDateInPast($date){\n $today = date('Y-m-d', time());\n //echo \"<script>console.log( 'current date: \" . $today . \"; given date: \".$date.\"' );</script>\";\n\n if((strtotime($today) - strtotime($date)) > 0)\n return true;\n else\n return false;\n}", "public function testIsToday() {\n $this->assertTrue(Time::isToday('+0 day'));\n $this->assertFalse(Time::isToday('+2 day'));\n $this->assertFalse(Time::isToday('-2 day'));\n }", "function isToday() {\n $today = Angie_DateTime::now();\n return $this->getDay() == $today->getDay() &&\n $this->getMonth() == $today->getMonth() &&\n $this->getYear() == $today->getYear();\n }", "public function dueToday()\n {\n $current = strtotime(date(\"Y-m-d\"));\n $date = strtotime($this->deadline);\n $datediff = $date - $current;\n $difference = floor($datediff/(60*60*24));\n return $difference == 0;\n }", "function IsToday() {\n $today = date('Y-m-d');\n return $this->owner->RAW() == date('Y-m-d');\n }", "public function isToday()\r\n {\r\n $now = Date::now();\r\n\r\n return ($this->day == $now->getDay() && $this->month == $now->getMonth() && $this->year == $now->getYear() );\r\n }", "private function checkDate()\n {\n return (strtotime('now') <= $this->coupon->getEndDate());\n\n }", "private function updateToday(): bool\n {\n $sql = \"SELECT date_modified FROM prices ORDER BY date_modified DESC\";\n $dates = array();\n // Assign all dates to array.\n foreach (Server::queryAllRows($this->database, $sql) as $row)\n $dates[] = $row['date_modified'];\n return !in_array($this->date, $dates); // if any date is today return false, else return true.\n }", "private function checkToday($time){\n\t\t\tdate_default_timezone_set(\"Australia/Melbourne\");\n\t\t\t\n\t\t\t$todayDate=date(\"Y-m-d\");\n\t\t\t$start=\"$todayDate 00:00:00\";\n\t\t\t$sTime=strtotime($start);\n\t\t\t$end=\"$todayDate 23:59:59\";\n\t\t\t$eTime=strtotime($end);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$test=strtotime($time);\n\t\t\t\n\t\t\t\n\t\t\tif($test>=$sTime && $test<=$eTime){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public static function isToday($date) {\n return date('Y-m-d', self::makeUnix($date)) == date('Y-m-d', time());\n }", "public static function isToday ( $date ) {\n\t\treturn date('Y-m-d', $date) == date('Y-m-d', time());\n\t}", "function testCurrentDate()\r\n {\r\n echo \"Yesterday: \" . date(\"Y-m-d\", strtotime(\"yesterday\")) . \"<br>\\n\"; // yesterday\r\n echo \"Today: \" . date('Y-m-d') . \"<br>\\n\"; // today\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function is no longer used it displays the contents of the cookie, this was used for troubleshooting
public function displayCookieInfo(){ global $cookieName, $maximumIdleTime; $token = $_COOKIE[$cookieName]; $cookeData = authentication::verifyAuthenticationToken($cookieName,$token,true); //let make sure nothing fishy went on if($cookeData){ echo "<h1>Hash Match!</h1>"; if($_SERVER["REMOTE_ADDR"] == $cookeData['ipAddress']){ echo "<h1>IP addresses Match!</h1>"; echo "Cookie___IP = " . $cookeData['ipAddress'] . "<br>"; echo "Actual____IP = " . $_SERVER["REMOTE_ADDR"] . "<br>"; } else { echo "remote address does not match<br>"; } if(sha1($_SERVER['HTTP_USER_AGENT']) == $cookeData['SHA1OfUserAgent']){ echo "<h1>SHA1 of user agent Match!</h1>"; echo "Cookie___SHA1 user agent = " . $cookeData['SHA1OfUserAgent'] . "<br>"; echo "Actual____SHA1 user agent = " . sha1($_SERVER['HTTP_USER_AGENT']) . "<br>"; } else { echo "user agent does not match<br>"; } if($cookeData['timestamp'] >= (time() - $maximumIdleTime)){ echo "<h1>Time difference in seconds</h1>"; echo "Cookie___Time = " . $cookeData['timestamp'] . "<br>"; echo "Actual____Time = " . time() . "<br>"; echo "difference in seconds = " . (time() - $cookeData['timestamp']) . "<br>"; } else { echo "<h1>Time difference in seconds</h1>"; echo "Cookie___Time = " . $cookeData['timestamp'] . "<br>"; echo "Actual___Time = " . time() . "<br>"; echo "<b>difference in seconds > " .$maximumIdleTime . "</b> = " . (time() - $cookeData['timestamp']) . "<br>"; } } else { echo "Hashes do not match, cookie was tampered with"; } }
[ "public function cookie()\n\t{\t\t\n\t\t# grab the data for the page\n\t\treturn $this->getContent(\"cookie-policy\", \"Cookie Policy\");\t\n\t}", "public function showcookie()\r\n\t{\r\n\t\treturn $this->cookie;\r\n\t}", "public function printCookieStr() {\n\t\t$temp = array();\n\t\tif ($this->_cookieStr != '')\n\t\t\t$temp = explode('; ', $this->_cookieStr);\n\t\tprint_r($temp);\n\t}", "function cookie_message()\n\t{\n\t\tif(empty($_SESSION['cookie_message_shown'])) {\n\t\t\t$_SESSION['cookie_message_shown'] = 1;\n\t\t\techo('<div class=\"cookie-message\" id=\"cookie-message\">This site uses cookies, your continued use implies you agree with our cookie policy. <a href=\"#\" id=\"dismiss\">Dismiss</a></div>');\n\t\t}\n\t}", "private function readCookie() {\n $cipher = new Cipher();\n $auth = $cipher->decrypt($_COOKIE['auth']);\n list($user, $pass) = explode('|', $auth);\n $this->authUser(base64_decode($user), base64_decode($pass));\n }", "public function getCookies()\n {\n return $this->render('cookie.html', []);\n }", "function get_cookies_allowed_html($language_suffix = null)\n {\n $html = '';\n ob_start();\n\n $language_suffix = null;\n $reset_acf_settings = false;\n $post_id = 'options' . $language_suffix;\n\n if (get_field('cookies_allowed_default_language_scripts', 'options')) {\n add_filter('acf/settings/current_language', [ $this, 'cookies_allowed_get_default_language' ], 100);\n $reset_acf_settings = true;\n }\n\n $highest_cookie_allowed_level = ( get_field(\n 'highest_cookie_allowed_level',\n $post_id\n ) ) ? get_field('highest_cookie_allowed_level', $post_id) : 3;\n\n if ($reset_acf_settings) {\n remove_filter(\n 'acf/settings/current_language',\n [ $this, 'cookies_allowed_get_default_language' ],\n 100\n );\n }\n\n if (class_exists('NumberFormatter')) {\n $numbertoword = new NumberFormatter(\"nl\", NumberFormatter::SPELLOUT);\n }\n\n $policy_page_url = '#';\n $previous_cookie_level = $this->get_cookies_allowed_level();\n\n $acf_cookie_modal_text = get_field('cookie_modal_text', $post_id);\n $default_cookie_modal_text = sprintf(\n __(\n '<h4>What are cookies?</h4><p>Cookies are small files that are placed by us on your computer, tablet or smartphone in order to use a website properly. Some cookies are necessary for optimal use of the website. Some cookies are extra.</p><h4>Manage your cookie settings</h4><p>Functional cookies are needed to use the website, which is why they are always on. For an optimal online experience, we recommend to enable additional cookies</p><p>More information about the different types of cookies and their effect can be found in our <a href=\"%s\">Cookie Policy</a> page.</p>',\n 'cookies-allowed'\n ),\n $policy_page_url\n );\n\n $acf_cookie_notice_text = get_field('cookie_notice_text', $post_id);\n $default_cookie_notice_text = sprintf(\n __(\n '<p> %s uses cookies to optimize your experience on this website. By using this website you automatically agree to the use of functional cookies and anonymous Analytic cookies.</p>',\n 'cookies-allowed'\n ),\n $_SERVER[\"SERVER_NAME\"]\n );\n\n $acf_highest_cookie_notice_text = get_field('highest_cookie_notice_text', $post_id);\n $default_highest_cookie_notice_text = __(\n '<p>We also use user specific analytic and marketing cookies, by clicking on \\'Allow cookies\\' you also agree to the use of these cookies. Go to <a href=\"#\" class=\"js-cookie-modal\"> Settings </a> to manage your cookies on this website.</p>',\n 'cookies-allowed'\n );\n\n ?>\n <div id=\"cookies-allowed\"\n data-page-reload=\"<?php echo get_field('cookies_allowed_reload_page', $post_id) ? 'true' : 'false'; ?>\">\n <div id=\"cookie-notice\" class=\"cookie-notice\"\n data-highest-cookie-allowed-level=\"<?php echo $highest_cookie_allowed_level ?>\">\n <div class=\"cookie-notice__container\">\n <div class=\"cookie-notice__wrapper\">\n <div class=\"cookie-notice__content\">\n <?php // echo $this->get_cookies_allowed_level();\n ?>\n <?php if ($this->get_cookies_allowed_level() < 1) : ?>\n <?php echo empty($acf_cookie_notice_text) ? $default_cookie_notice_text : $acf_cookie_notice_text; ?>\n <?php else : ?>\n <?php echo empty($acf_highest_cookie_notice_text) ? $default_highest_cookie_notice_text : $acf_highest_cookie_notice_text; ?>\n <?php endif; ?>\n </div>\n <div class=\"cookie-notice__buttons\">\n <button class=\"cookie__button cookie__button--opacity\"\n onclick=\"allowCookies(<?php echo $highest_cookie_allowed_level ?>);\"><?php esc_html_e(\n 'Allow cookies',\n 'cookies-allowed'\n ); ?></button>\n <?php if ($this->get_cookies_allowed_level() < 1) : ?>\n <button class=\"cookie__button cookie__button--settings\"\n onclick=\"toggleCookieModal();\"><?php esc_html_e(\n 'Settings',\n 'cookies-allowed'\n ); ?></button>\n <?php endif; ?>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"cookie-modal\">\n <div class=\"cookie-modal__backdrop js-cookie-modal\"></div>\n <div class=\"cookie-modal__wrapper\">\n <div class=\"cookie-modal__content\">\n <h3 class=\"cookie-modal__title\"><?php esc_html_e(\n 'Manage your settings',\n 'cookies-allowed'\n ); ?></h3>\n <div class=\"cookie-modal__entry\">\n <?php echo empty($acf_cookie_modal_text) ? $default_cookie_modal_text : $acf_cookie_modal_text; ?>\n </div>\n <div class=\"cookie-modal__entry\">\n <h4><?php esc_html_e('Cookie types:', 'cookies-allowed'); ?></h4>\n <div class=\"cookie-modal__checkbox__wrapper\">\n <input class=\"cookie-modal__checkbox\" id=\"allow-cookies-check1\" type=\"checkbox\"\n checked=\"checked\" disabled onclick=\"allowCookies(1);\">\n <label class=\"cookie-modal__label\"\n for=\"allow-cookies-check1\"><?php esc_html_e(\n 'Functional & Analytic cookies (anonymous)',\n 'cookies-allowed'\n ); ?></label>\n </div>\n <?php if ($highest_cookie_allowed_level >= 2) : ?>\n <div class=\"cookie-modal__checkbox__wrapper\">\n <input class=\"cookie-modal__checkbox\" id=\"allow-cookies-check2\"\n type=\"checkbox\" <?php if ($this->is_cookies_allowed_level(2) || $this->is_cookies_allowed_level(3)) {\n echo( 'checked' );\n } ?>\n onclick=\"if(this.checked){allowCookies(2)}else{allowCookies(1)};\">\n <label class=\"cookie-modal__label\"\n for=\"allow-cookies-check2\"><?php esc_html_e(\n 'Analytic cookies (user specific)',\n 'cookies-allowed'\n ); ?></label>\n </div>\n <?php endif; ?>\n <?php if ($highest_cookie_allowed_level == 3) : ?>\n <div class=\"cookie-modal__checkbox__wrapper\">\n <input class=\"cookie-modal__checkbox\" id=\"allow-cookies-check3\"\n type=\"checkbox\" <?php if ($this->is_cookies_allowed_level(3)) {\n echo( 'checked' );\n } ?>\n onclick=\"if(this.checked){allowCookies(3)}else{allowCookies(2)};\">\n <label class=\"cookie-modal__label\"\n for=\"allow-cookies-check3\"><?php esc_html_e(\n 'Marketing & Advertising cookies',\n 'cookies-allowed'\n ); ?></label>\n </div>\n <?php endif; ?>\n </div>\n <div class=\"cookie-modal__entry cookie-modal__buttons\">\n <button class=\"cookie__button cookie__button--large cookie__button--success\"\n onclick=\"toggleCookieModal();\"><?php esc_html_e(\n 'Save',\n 'cookies-allowed'\n ); ?></button>\n <button\n class=\"cookie__button cookie__button--large cookie__button--ghost js-cookie-modal\"\n onclick=\"allowCookies(<?php echo $previous_cookie_level ?>);\"><?php esc_html_e(\n 'Cancel',\n 'cookies-allowed'\n ); ?></button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <?php\n $html .= ob_get_clean();\n\n return $html;\n }", "public function output()\n {\n echo $this->_cookie;\n }", "protected function handle_cookie() {}", "public function getCookie();", "function getCookies() {}", "public function cookie_text() : string {\n return sprintf(\n '%s=1; expires=%s; path=%s',\n $this->cookie_name(),\n $this->cookie_expires(),\n $this->cookie_path()\n );\n }", "protected function showCookie(): int\n {\n $error = $this->getError();\n if ($error == false) {\n return 1;\n }\n\n $this->printInfo($error);\n $this->output->writeln('<comment>$_COOKIE:</>');\n $this->printVar($error['php_vars']['cookie']);\n $this->output->writeln('');\n\n return 0;\n }", "function echoCookie($value, $name)\n{\n echo \"$name = $value\\n\";\n}", "public function render_cookie_bar() {\n\n\t\tif ( ! isset( $this->settings['cookie_filename'] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( ! file_exists( MACHETE_DATA_PATH . $this->settings['cookie_filename'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t?>\n<script>\n\t\t<?php\n\t\techo PHP_EOL;\n\t\t$this->readfile( MACHETE_DATA_PATH . $this->settings['cookie_filename'] );\n\t\t?>\n\n(function(){\n\tif ( typeof machete_cookies_bar_stylesheet === 'undefined') return;\n\tvar s = document.createElement('script'); s.type = 'text/javascript';\n\ts.defer = true; s.src = '<?php echo esc_url( $this->baseurl . 'js/cookies_bar_js.min.js' ); ?>';\n\tvar body = document.getElementsByTagName('body')[0];\n\tbody.appendChild(s);\n})();\n</script>\n\t\t<?php\n\t}", "function cookie($name, $value, $expire)\n{\n echo '\n<script>\n<!--\n var expire = new Date();\n var thetime = expire.getTime(); // Get the current time in ms\n thetime += '.$expire.'000; // Add the cookie duration in ms\n expire.setTime(thetime); // Set the expiry time\n document.cookie = \"'.$name.'='.$value.';expires=\"+expire.toGMTString();\n --></script>\n';\n# i removed path variable from cookie baking, so its possible to \n# use this forum with frames in another servers\n# +\";path=/\"\n}", "function cookie_extraction()\n\t{\n\t global $CONFIG;\n\n\t\t// Default anonymous values\n\t\t$id = 0;\n\t\t$pass = '';\n\t\t$f = $this->field;\n\t\t$mambo_version =& $this->mambo_version;\n\n\t\t$sessioncookie = $_COOKIE['sessioncookie'];\n\t\t\n // 4.5.1 and 4.5.2 compatibility\n if (($mambo_version->RELEASE == '4.5' && $mambo_version->DEV_LEVEL != '1.0.9') && $sessioncookie) {\n\t\t $sessioncookie .= $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\t$usercookie = $_COOKIE['usercookie'];\n $result = false;\n\n // Query database for session, if cookie exists\n if ($sessioncookie) {\n\n $sql = 'select userid from '.$this->sessionstable.' where session_id=md5(\"'.$sessioncookie.'\");';\n $result = cpg_db_query($sql, $this->link_id);\n }\n\n // If session exists, check if user exists\n if (mysql_num_rows($result)) {\n\n $row = mysql_fetch_assoc($result);\n mysql_free_result($result);\n\n $row['userid'] = (int) $row['userid'];\n\n $sql = 'select id, password ';\n $sql .= 'from '.$this->usertable.' ';\n $sql .= 'where id='.$row['userid'];\n\n $result = cpg_db_query($sql, $this->link_id);\n\n // If user exists, use the current session\n if ($result) {\n $row = mysql_fetch_assoc($result);\n mysql_free_result($result);\n\n $pass = $row['password'];\n $id = (int) $row['id'];\n $this->session_id = $sessioncookie;\n\n // If the user doesn't exist, use default guest credentials\n }\n\n // No session exists, so create a session and check for remember me cookie\n } else {\n\n\t\t\t$this->create_session();\n\n\t\t\t// remember me cookie exists; login with user creditials\n if ($usercookie) {\n $username = (isset($usercookie['username'])) ? addslashes($usercookie['username']) : '';\n\t\t\t\t$password = (isset($usercookie['password'])) ? addslashes($usercookie['password']) : '';\n\n\t\t\t\t// Grab id from Mambo database, if a cookie exists\n\t\t\t\tif ($username) {\n\t\t\t\t\t$sql = 'select u.'.$f['user_id'].' as id, u.'.$f['password'].' as password, u.'.\n\t\t\t\t\t $f['username'].' as username, u.'.$f['usertbl_group_id'].' as usertbl_group_id, '.\n\t\t\t\t\t\t\t'g.'.$f['grouptbl_group_id'].' as grouptbl_group_id, g.'.$f['grouptbl_group_name'].' as grouptbl_group_name ';\n\t\t\t\t\t$sql .= 'from '.$this->usertable.' as u ';\n\t\t\t\t\t$sql .= 'inner join '.$this->groupstable.' as g ';\n\t\t\t\t\t$sql .= 'on gid=group_id ';\n\t\t\t\t\t$sql .= 'where u.'.$f['username'].'=\"'.$username.'\" and u.'.$f['password'].'=\"'.$password.'\" and u.block=0;';\n\n\t\t\t\t\t$result = cpg_db_query($sql, $this->link_id);\n\t\t\t\t\t\n\t\t\t\t\t// the user exists; finalize login procedures\n\t\t\t\t\tif ($result) {\n\t\t\t\t\t\n\t\t\t\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t\t\t\tmysql_free_result($result);\n\n\t\t\t\t\t\t$gid = 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->is_group_child_of($row['grouptbl_group_name'],'Registered') ||\n\t\t\t\t\t\t\t$this->is_group_child_of($row['grouptbl_group_name'],'Administrator')) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$gid = 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// update session information in session table\n\t\t\t\t\t\t$sql = 'update '.$this->sessionstable.' set '.\n\t\t\t\t\t\t\t\t'userid='.$row['id'].\n\t\t\t\t\t\t\t\t',username=\"'.$row['username'].'\"'.\n\t\t\t\t\t\t\t\t',guest=0 '.\n\t\t\t\t\t\t\t\t',gid='.$gid.' '.\n\t\t\t\t\t\t\t\t',usertype=\"'.$row['grouptbl_group_name'].'\" '.\n\t\t\t\t\t\t\t\t'where session_id=md5(\"'.$this->session_id.'\");';\n\t\t\t\t\t\t\n\t\t\t\t\t\tcpg_db_query($sql, $this->link_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// update last visit date\n\t\t\t\t\t\t$currentDate = date(\"Y-m-d\\TH:i:s\");\n\t\t\t\t\t\t$sql = 'update '.$this->usertable.' set '.\n\t\t\t\t\t\t\t 'lastvisitDate=\"'.$currentDate.'\" '.\n\t\t\t\t\t\t\t 'where id='.$row['id'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tcpg_db_query($sql, $this->link_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$pass = $password;\n\t\t\t\t\t\t$id = $row['id'];\n\t\t\t\t\t}\n\t\t\t\t}\n }\n }\n\n\t\treturn ($id) ? array($id, $pass) : false;\n\t}", "public function cookieToString()\n {\n if (!empty($this->cookies)) {\n return $this->cookieHeaderKey.':'.$this->strCookie();\n }\n\n return '';\n }", "function display_cookie_law_banner() {\n\tif(!CHV\\getSetting('enable_cookie_law') or CHV\\Login::getUser()) return;\n\t// No user logged in and cookie law has not been accepted\n\tif(!isset($_COOKIE['CHV_COOKIE_LAW_DISPLAY']) or (bool)$_COOKIE['CHV_COOKIE_LAW_DISPLAY'] !== FALSE) {\n\t\techo get_cookie_law_banner();\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create injection that uses too few digits in date, fail
public function test_injection_create_fail_too_few_digits_in_date() { $this->wipeClean(); $url = $this->makeUrl('/v1/patient/{patient_id}/injection'); $data = [ 'dose' => '0.30', 'site' => 'upperR', 'notes_user' => 'insert_date_digits_too_few', 'vial_id' => '1', 'datetime_administered' => "2018-1-05 12:10:10" ]; $response = $this->postJsonTest($url, $data, 'validation'); $response ->assertStatus(400) ->assertJson([ 'status' => 'validation', 'errors' => [ 'datetime_administered' => [ 'The datetime administered does not match the format Y-m-d H:i:s.' ] ] ]); }
[ "public function test_injection_create_fail_future_year_invalid()\n {\n $this->wipeClean();\n \n $url = $this->makeUrl('/v1/patient/{patient_id}/injection');\n\n $todaysDate = date('Y-m-d H:i:s', mktime(23, 59, 59, date(\"m\"), date(\"d\"), date(\"Y\")));\n\n $data = [\n 'dose' => '0.30',\n 'site' => 'upperR',\n 'notes_user' => 'insert_date_future_year_invalid',\n 'vial_id' => '1',\n 'datetime_administered' => \"2030-12-05 12:10:10\"\n ];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n 'datetime_administered' => [\n 'The datetime administered must be a date before '.$todaysDate.'.'\n ]\n ]\n ]);\n }", "public function test_injection_create_fail_bad_datetime_administered_date()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/injection');\n\n $data = [\n 'dose' => '0.050',\n 'site' => 'upperR',\n 'vial_id' => '2',\n 'notes_user' => 'insert_bad_datetime_administered',\n 'datetime_administered' => '20X7-08-23 01:02:03'\n ];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation'\n ]);\n }", "public function test_injection_create_fail_bad_datetime_administered_time()\n {\n $url = $this->makeUrl('/v1/patient/{patient_id}/injection');\n\n $data = [\n 'dose' => '0.050',\n 'site' => 'upperR',\n 'vial_id' => '2',\n 'notes_user' => 'insert_bad_datetime_administered',\n 'datetime_administered' => '2017-08-23 01:02:X3'\n ];\n\n $response = $this->postJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation'\n ]);\n }", "public function testBadDate3()\n {\n new ApproxDate('199807123');\n }", "public function test_unescape_date_format_will_return_input_if_not_a_string() {\n\t\t$bad_input = array( 23 );\n\t\t$this->assertEquals( $bad_input, Date_Utils::unescape_date_format( $bad_input ) );\n\t}", "private function checkDateOfBirth()\n {\n if (strlen($this->dateOfBirth) != 6){\n throw new InvalidFormatException(\"The date of birth section of the ID number is invalid, it must be 6 numbers long\");\n }\n if (!preg_match(self::DATE_REG_EXP, $this->dateOfBirth)){\n throw new InvalidFormatException(\"The date of birth section of the ID number is invalid, it must only contains numbers\");\n }\n }", "public function testBadDay()\n {\n new ApproxDate('3/34/89');\n }", "public function testDateParserInvalid()\n {\n $request = new Request();\n $request->query->set('from', 'foo');\n $this->addToAssertionCount(1);\n try {\n Data::parseDateFromRequest($request, 'from');\n }\n catch (\\Exception $e) {\n return;\n }\n $this->fail('Invalid date parameter did not throw exception.');\n }", "public function testConstructWithInvalidDate()\n {\n new Date(\n (new Mockery($this))->getYearMock(2017),\n (new Mockery($this))->getMonthMock(2),\n (new Mockery($this))->getDayMock(31)\n );\n }", "#[@test, @expect('lang.IllegalArgumentException')]\n public function dateCreateWithAllInvalidArguments() {\n Date::create('', '', '', '', '', '');\n }", "public function testBadYear()\n {\n new ApproxDate('3/3/899');\n }", "private function validatePassportIssuedDate() {\n $issued_date = DateTime::createFromFormat( 'd.m.Y', $this->passport_issued_date );\n\n if ( $issued_date < DateTime::createFromFormat( 'd.m.Y', '01.10.1997' ) ) {\n $this->errors[] = [ 'Паспорт должен быть выдан не позднее 1 октября 1997 года' ];\n }\n\n if ( $issued_date > new DateTime( 'tomorrow' ) ) {\n $this->errors[] = [ 'Паспорт не может быть выдан в будущем' ];\n }\n }", "public function testShouldThroughExceptionIfDateIsWrongFormat()\n {\n $testValue = 'thisAintADate';\n $this->setExpectedException('\\Exception');\n \n $result = ImportCsvUtils::parseToDate($testValue);\n \n }", "public function test_sanitizetimestringremovesinvalidportionfromstart() {\n $result = rlip_sanitize_time_string('1x2d3h4m');\n $this->assertEquals($result, '2d3h4m');\n }", "public function testInvalidDate(): void\n {\n $app = $this->porter->importOne(new Import(new ScrapeAppFixture('invalid date.html')));\n\n self::assertArrayHasKey('release_date', $app);\n self::assertNull($app['release_date']);\n }", "public static function check_makeDBDate($in)\n\t{\n\t\t$out = false;\n\t\t$in = trim($in);\n\t\t\n\t\t$split_char = null;\n\t\tif(strpos($in, '.') !== false) {\n\t\t\t$split_char = '.';\n\t\t} elseif(strpos($in, '-') !== false) {\n\t\t\t$split_char = '-';\n\t\t} elseif(strpos($in, '/') !== false) {\n\t\t\t$split_char = '/';\n\t\t} else {\n\t\t\t$split_char = false;\n\t\t}\n\t\t\n\t\tif($split_char) {\n\t\t\t$a1=explode(\" \",$in);\n\t\t\t$date = explode($split_char,$a1[0]);\n\t\t\tif (count($date)==3) {\n\t\t\t\t//check numeric values \n\t\t\t\tif(is_numeric($date[0])===false\n\t\t\t\t\t|| is_numeric($date[1])===false\n\t\t\t\t\t|| is_numeric($date[2])===false\n\t\t\t\t) {\n\t\t\t\t\t$out = false;\n\t\t\t\t} else {\n\t\t\t\t\t//check if isdate, else return false: checkdate(m,d,y)\n\t\t\t\t\tswitch ($split_char) {\n\t\t\t\t\t\tcase '.': //d.m.Y H:i:s\n\t\t\t\t\t\t\t$mon=$date[1];\n\t\t\t\t\t\t\t$day=$date[0];\n\t\t\t\t\t\t\t$year=$date[2];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '-': //Y-m-d H:i:s\n\t\t\t\t\t\t\t$mon=$date[1];\n\t\t\t\t\t\t\t$day=$date[2];\n\t\t\t\t\t\t\t$year=$date[0];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '/': //Y/m/d H:i:s or d/m/Y H:i:s \n\t\t\t\t\t\t\t$mon=$date[1];\n\t\t\t\t\t\t\t$day=$date[2];\n\t\t\t\t\t\t\t$year=$date[0];\n\t\t\t\t\t\t\tif(checkdate($mon,$day,$year)===false) {\n\t\t\t\t\t\t\t\t$mon=$date[1];\n\t\t\t\t\t\t\t\t$day=$date[0];\n\t\t\t\t\t\t\t\t$year=$date[2];\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$out = false;\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t}//switch\n\t\t\t\t\tif(strlen($year)!=4 || strlen($mon)!=2 || strlen($day)!=2) {\n\t\t\t\t\t\t$out = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(checkdate($mon,$day,$year)===false) {\n\t\t\t\t\t\t\t$out = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$out = date('Y-m-d H:i:s',strtotime($in));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}//count 3\n\t\t}//split_char\n\t\treturn $out;\n\t}", "function redate($date_str, $format = 'F d, Y', $invalid_str = 'n/a', $accept_1969 = false) {\n\t$ts = is_blank($date_str) ? false : strtotime($date_str);\n\treturn ($ts && ($ts!=-64800 || $accept_1969)) ? date($format, $ts) : $invalid_str;\n}", "public static function invalidDateStrings()\n {\n \t$vals = Providers::notPopulatedStringProvider();\n \t$vals[] = array('fewofkpo');\n \t$vals[] = array('2010-22');\n \t$vals[] = array('20100-10');\n \t$vals[] = array('2010-00');\n \treturn $vals; \t\n }", "public function testExtractTimestampInvalidFormat()\n {\n $line = '3a9cfa81b20c88f38787955095ee1cbac4b69abc - Testing, bad date '\n . '(Boo Foo 29 18:54:51 9999 +0200) <conroyp:paul@conroyp.com>';\n $this->assertFalse(Reader::extractTimestamp($line));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Data provider for testGetSpecificDerivedObject.
public function providerGetSpecificDerivedObject() { return array( array('derivedClass', array('field1' => 2)), array('derivedClass2', array('field1' => 3)) ); }
[ "public function dataProviderTestModuleInheritanceTestPhpInheritance()\n {\n return [\n 'case_1_1' => [\n //Test case 1.1 plain module extends plain shop class\n 'moduleToActivate' => ['bc_module_inheritance_1_1'],\n 'moduleClassName' => 'vendor_1_module_1_myclass',\n 'shopClassNames' => ['oxArticle']\n ],\n 'case_1_2' => [\n //Test case 1.2 plain module extends namespaced eShop Community class\n 'moduleToActivate' => ['bc_module_inheritance_1_2'],\n 'moduleClassName' => 'vendor_1_module_2_myclass',\n 'shopClassNames' => ['OxidEsales\\EshopCommunity\\Application\\Model\\Article']\n ],\n 'case_1_5' => [\n //Test case 1.5 plain module extends eShop virtual class\n 'moduleToActivate' => ['bc_module_inheritance_1_5'],\n 'moduleClassName' => 'vendor_1_module_5_myclass',\n 'shopClassNames' => [\\OxidEsales\\Eshop\\Application\\Model\\Article::class]\n ],\n 'case_3_1' => [\n //Test case 3.1 plain module chain extends plain OXID eShop class\n 'moduleToActivate' => ['module_chain_extension_3_1'],\n 'moduleClassName' => 'vendor_1_module_3_1_myclass',\n 'shopClassNames' => ['oxArticle']\n ],\n 'case_3_3' => [\n //Test case 3.3 plain module chain extends virtual OXID eShop class\n 'moduleToActivate' => ['module_chain_extension_3_3'],\n 'moduleClassName' => 'vendor_1_module_3_3_myclass',\n 'shopClassNames' => [\\OxidEsales\\Eshop\\Application\\Model\\Article::class]\n ]\n ];\n }", "public function providerGetSpecificDerivedCollection() {\n return array(\n array('derivedClass'),\n array('derivedClass2')\n );\n }", "public function testGetDerivedCollectionGraph() {\n \tif (!empty(xPDOTestHarness::$debug)) print \"\\n\" . __METHOD__ . \" = \";\n try {\n $collection = $this->xpdo->getCollectionGraph('sti.baseClass', '{\"relOne\":{},\"relMany\":{}}');\n foreach ($collection as $object) {\n $result = false;\n switch ($object->get('field1')) {\n case 1:\n $expectedClass = 'baseClass';\n $result = ($object instanceof baseClass && $object->get('class_key') == 'baseClass');\n break;\n case 2:\n $expectedClass = 'derivedClass';\n $result = ($object instanceof derivedClass && $object->get('class_key') == 'derivedClass');\n break;\n case 3:\n $expectedClass = 'derivedClass2';\n $result = ($object instanceof derivedClass2 && $object->get('class_key') == 'derivedClass2');\n break;\n }\n $this->assertTrue($result, \"Error getting derived object of the appropriate class ({$expectedClass}) in collection graph.\");\n }\n } catch (Exception $e) {\n $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__);\n }\n }", "protected abstract function getTestCase() : TestCase;", "public function testAllowDerivedDelete()\n {\n $oBase = $this->getMock(\\OxidEsales\\Eshop\\Core\\Model\\BaseModel::class, array('isDerived'));\n $oBase->expects($this->once())->method('isDerived')->will($this->returnValue(false));\n $this->assertTrue($oBase->allowDerivedDelete());\n }", "public function testDynamicDataGet()\n {\n\n }", "public function testDerivedFromPropertyDerivingProperty()\n {\n $record = $this->getRelativeEntityManager()\n ->enableDerived(true)\n ->get(self::$relativeId);\n $this->assertEquals($record->firstName, self::$data['firstName']);\n\n $derived = $record->derivedMultiple;\n $this->assertEquals($derived->firstName, self::$data['firstName']);\n $this->assertEquals($derived->birthDate->format(DateUtility::MYSQL_DATE_FORMAT), self::$data['birthDate']->format(DateUtility::MYSQL_DATE_FORMAT));\n $this->assertEquals($derived->createdAt->format(DateUtility::MYSQL_DATETIME_FORMAT), self::$data['createdAt']->format(DateUtility::MYSQL_DATETIME_FORMAT));\n }", "abstract protected function getTestedTypeInstance(): BaseType;", "public function testInheritedVariables()\n {\n $this->assertClassHasAttribute('oAPI', 'Services_AMEE_BaseItemObject');\n $this->assertClassHasAttribute('sLastJSON', 'Services_AMEE_BaseItemObject');\n $this->assertClassHasAttribute('aLastJSON', 'Services_AMEE_BaseItemObject');\n $this->assertClassHasAttribute('sUID', 'Services_AMEE_BaseItemObject');\n }", "abstract protected function getDataClass();", "public function substituteSubpartDataProvider() {}", "public function testMagicGetIsDerived()\n {\n $oBase = new _oxBase();\n $oBase->setClassVar(\"_blIsDerived\", true);\n $this->assertFalse(isset($oBase->blIsDerived));\n $this->assertTrue($oBase->blIsDerived);\n }", "public function testBaseClassDetection() {\n\t\t// Explicit DataObject\n\t\t$field1 = new DBClassName('MyClass', 'SilverStripe\\\\ORM\\\\DataObject');\n\t\t$this->assertEquals('SilverStripe\\\\ORM\\\\DataObject', $field1->getBaseClass());\n\t\t$this->assertNotEquals('SilverStripe\\\\ORM\\\\DataObject', $field1->getDefault());\n\n\t\t// Explicit base class\n\t\t$field2 = new DBClassName('MyClass', 'DBClassNameTest_Object');\n\t\t$this->assertEquals('DBClassNameTest_Object', $field2->getBaseClass());\n\t\t$this->assertEquals('DBClassNameTest_Object', $field2->getDefault());\n\n\t\t// Explicit subclass\n\t\t$field3 = new DBClassName('MyClass');\n\t\t$field3->setValue(null, new DBClassNameTest_ObjectSubClass());\n\t\t$this->assertEquals('DBClassNameTest_Object', $field3->getBaseClass());\n\t\t$this->assertEquals('DBClassNameTest_Object', $field3->getDefault());\n\n\t\t// Implicit table\n\t\t$field4 = new DBClassName('MyClass');\n\t\t$field4->setTable('DBClassNameTest_ObjectSubClass_Versions');\n\t\t$this->assertEquals('DBClassNameTest_Object', $field4->getBaseClass());\n\t\t$this->assertEquals('DBClassNameTest_Object', $field4->getDefault());\n\n\t\t// Missing\n\t\t$field5 = new DBClassName('MyClass');\n\t\t$this->assertEquals('SilverStripe\\\\ORM\\\\DataObject', $field5->getBaseClass());\n\t\t$this->assertNotEquals('SilverStripe\\\\ORM\\\\DataObject', $field5->getDefault());\n\n\t\t// Invalid class\n\t\t$field6 = new DBClassName('MyClass');\n\t\t$field6->setTable('InvalidTable');\n\t\t$this->assertEquals('SilverStripe\\\\ORM\\\\DataObject', $field6->getBaseClass());\n\t\t$this->assertNotEquals('SilverStripe\\\\ORM\\\\DataObject', $field6->getDefault());\n\n\t\t// Custom default_classname\n\t\t$field7 = new DBClassName('MyClass');\n\t\t$field7->setTable('DBClassNameTest_CustomDefault');\n\t\t$this->assertEquals('DBClassNameTest_CustomDefault', $field7->getBaseClass());\n\t\t$this->assertEquals('DBClassNameTest_CustomDefaultSubclass', $field7->getDefault());\n\t}", "public function testDynamicDataIdDesignsFkGet()\n {\n\n }", "function dataProviderTwoTests() {\n\t\treturn array(\n\t\t\t\"test 1\" => array(\n\t\t\t\t\"argument 1\" => (object) array(\n\t\t\t\t\t\"idModified\" => 20000,\n\t\t\t\t\t\"idTouched\" => 30000,\n\t\t\t\t)\n\t\t\t),\n\t\t\t\"test 2\" => array(\n\t\t\t\t\"argument 1\" => (object) array(\n\t\t\t\t\t\"idModified\" => 20001,\n\t\t\t\t\t\"idTouched\" => 30001,\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function testDerivedFromClassWholeEntity()\n {\n $record = $this->entityManager->enableLazy(true)\n ->enableDerived(true)\n ->get(self::$data['userId']);\n\n $this->assertIsArray($record->relatives);\n foreach ($record->relatives as $index => $relative) {\n $this->assertTrue($relative instanceof EntityManager);\n $this->assertEquals($relative->userId, self::$data['userId']);\n $this->assertEquals($relative->relativeName, 'Relative Name ' . ($index + 1));\n }\n }", "protected abstract function getTestedInstance() : string;", "public function testDynamicDataIdDesignsGet()\n {\n\n }", "protected function testObject() {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Restore or initialize form state, create property mapping configuration
protected function initializeObject() { $this->formState = $this->formStateFactory->createFromActionRequest($this->request); $this->formState->mergeArguments($this->request->getArguments()); $this->propertyMappingConfiguration = $this->propertyMappingConfigurationFactory ->createTrustedPropertyMappingConfiguration( $this->request->getInternalArgument('__trustedProperties') ); $this->formContext = $this->formContextFactory->createFormContext($this); }
[ "function initPropertiesForm()\n\t{\t\t\n\t\t$template_settings = $hide_rte_switch = null;\n\t\t$template = $this->object->getTemplate();\n\t\tif($template)\n\t\t{\t\t\t\n\t\t\tinclude_once \"Services/Administration/classes/class.ilSettingsTemplate.php\";\n\t\t\t$template = new ilSettingsTemplate($template);\n\n\t\t\t$template_settings = $template->getSettings();\n\t\t\t$hide_rte_switch = $template_settings[\"rte_switch\"][\"hide\"];\n\t\t}\n\t\t\n\t\tinclude_once(\"./Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($this->ctrl->getFormAction($this));\n\t\t$form->setTableWidth(\"100%\");\n\t\t$form->setId(\"survey_properties\");\n\n\t\t// general properties\n\t\t$header = new ilFormSectionHeaderGUI();\n\t\t$header->setTitle($this->lng->txt(\"settings\"));\n\t\t$form->addItem($header);\n\t\t\n\t\t// title & description (meta data)\n\t\t\n\t\tinclude_once 'Services/MetaData/classes/class.ilMD.php';\n\t\t$md_obj = new ilMD($this->object->getId(), 0, \"svy\");\n\t\t$md_section = $md_obj->getGeneral();\n\n\t\t$title = new ilTextInputGUI($this->lng->txt(\"title\"), \"title\");\n\t\t$title->setRequired(true);\n\t\t$title->setValue($md_section->getTitle());\n\t\t$form->addItem($title);\n\n\t\t$ids = $md_section->getDescriptionIds();\n\t\tif($ids)\n\t\t{\n\t\t\t$desc_obj = $md_section->getDescription(array_pop($ids));\n\n\t\t\t$desc = new ilTextAreaInputGUI($this->lng->txt(\"description\"), \"description\");\n\t\t\t$desc->setCols(50);\n\t\t\t$desc->setRows(4);\n\t\t\t$desc->setValue($desc_obj->getDescription());\n\t\t\t$form->addItem($desc);\n\t\t}\n\t\t\t\t\n\t\t// anonymization\n\t\t$anonymization_options = new ilRadioGroupInputGUI($this->lng->txt(\"survey_auth_mode\"), \"anonymization_options\");\n\t\t$hasDatasets = $this->object->_hasDatasets($this->object->getSurveyId());\n\t\tif ($hasDatasets)\n\t\t{\n\t\t\t$anonymization_options->setDisabled(true);\n\t\t}\n\t\t$anonymization_options->addOption(new ilCheckboxOption($this->lng->txt(\"anonymize_personalized\"),\n\t\t\t\t'personalized', ''));\n\t\t$anonymization_options->addOption(new ilCheckboxOption(\n\t\t\t\t$this->lng->txt(\"anonymize_without_code\"), 'anonymize_without_code', ''));\n\t\t$anonymization_options->addOption(new ilCheckboxOption(\n\t\t\t\t$this->lng->txt(\"anonymize_with_code\"), 'anonymize_with_code', ''));\n\t\tif(!$this->object->getAnonymize())\n\t\t{\n\t\t\t$anonymization_options->setValue('personalized');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$anonymization_options->setValue(($this->object->isAccessibleWithoutCode()) ?\n\t\t\t\t\t'anonymize_without_code' : 'anonymize_with_code');\n\t\t}\n\t\t$anonymization_options->setInfo($this->lng->txt(\"anonymize_survey_description\"));\n\t\t$form->addItem($anonymization_options);\n\t\t\t\t\n\t\t// pool usage\n\t\t$pool_usage = new ilRadioGroupInputGUI($this->lng->txt(\"survey_question_pool_usage\"), \"use_pool\");\t\t\n\t\t$opt = new ilRadioOption($this->lng->txt(\"survey_question_pool_usage_active\"), 1);\n\t\t$opt->setInfo($this->lng->txt(\"survey_question_pool_usage_active_info\"));\n\t\t$pool_usage->addOption($opt);\n\t\t$opt = new ilRadioOption($this->lng->txt(\"survey_question_pool_usage_inactive\"), 0);\n\t\t$opt->setInfo($this->lng->txt(\"survey_question_pool_usage_inactive_info\"));\n\t\t$pool_usage->addOption($opt);\n\t\t$pool_usage->setValue($this->object->getPoolUsage());\n\t\t$form->addItem($pool_usage);\n\t\t\n\t\t\n\t\t// activation\n\t\t\n\t\tinclude_once \"Services/Object/classes/class.ilObjectActivation.php\";\n\t\t$this->lng->loadLanguageModule('rep');\n\t\t\n\t\t$section = new ilFormSectionHeaderGUI();\n\t\t$section->setTitle($this->lng->txt('rep_activation_availability'));\n\t\t$form->addItem($section);\n\t\t\n\t\t// additional info only with multiple references\n\t\t$act_obj_info = $act_ref_info = \"\";\n\t\tif(sizeof(ilObject::_getAllReferences($this->object->getId())) > 1)\n\t\t{\n\t\t\t$act_obj_info = ' '.$this->lng->txt('rep_activation_online_object_info');\n\t\t\t$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');\n\t\t}\n\t\t\n\t\t$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'),'online');\t\t\n\t\t$online->setInfo($this->lng->txt('svy_activation_online_info').$act_obj_info);\n\t\t$online->setChecked($this->object->isOnline());\n\t\t$form->addItem($online);\t\t\t\t\n\t\t\n\t\t$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'),'access_type');\n\t\t$act_type->setInfo($act_ref_info);\n\t\t$act_type->setValue($this->object->isActivationLimited() ? \n\t\t\tilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);\t\t\n\t\t\n\t\t\t$opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);\n\t\t\t$opt->setInfo($this->lng->txt('svy_availability_limitless_info'));\n\t\t\t$act_type->addOption($opt);\n\t\t\t\n\t\t\t$opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);\n\t\t\t$opt->setInfo($this->lng->txt('svy_availability_until_info'));\n\n\t\t\t\t$date = $this->object->getActivationStartDate();\n\t\t\t\t\n\t\t\t\t$start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'),'access_begin');\n\t\t\t\t$start->setShowTime(true);\t\t\n\t\t\t\t$start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));\n\t\t\t\t$opt->addSubItem($start);\n\t\t\t\t\n\t\t\t\t$date = $this->object->getActivationEndDate();\n\t\t\t\t\n\t\t\t\t$end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'),'access_end');\t\t\t\n\t\t\t\t$end->setShowTime(true);\t\t\t\n\t\t\t\t$end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));\n\t\t\t\t$opt->addSubItem($end);\n\t\t\t\t\n\t\t\t\t$visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');\n\t\t\t\t$visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));\n\t\t\t\t$visible->setChecked($this->object->getActivationVisibility());\n\t\t\t\t$opt->addSubItem($visible);\n\t\t\t\t\n\t\t\t$act_type->addOption($opt);\n\t\t\n\t\t$form->addItem($act_type);\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t\n\t\t// enable start date\n\t\t$start = $this->object->getStartDate();\n\t\t$enablestartingtime = new ilCheckboxInputGUI($this->lng->txt(\"start_date\"), \"enabled_start_date\");\n\t\t$enablestartingtime->setValue(1);\n\t\t// $enablestartingtime->setOptionTitle($this->lng->txt(\"enabled\"));\n\t\t$enablestartingtime->setChecked($start);\n\t\t// start date\n\t\t$startingtime = new ilDateTimeInputGUI('', 'start_date');\n\t\t$startingtime->setShowDate(true);\n\t\t$startingtime->setShowTime(true);\t\t\t\t\n\t\tif ($start)\n\t\t{\n\t\t\t$startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP));\n\t\t}\n\t\t$enablestartingtime->addSubItem($startingtime);\n\t\t$form->addItem($enablestartingtime);\n\n\t\t// enable end date\t\t\n\t\t$end = $this->object->getEndDate();\n\t\t$enableendingtime = new ilCheckboxInputGUI($this->lng->txt(\"end_date\"), \"enabled_end_date\");\n\t\t$enableendingtime->setValue(1);\n\t\t// $enableendingtime->setOptionTitle($this->lng->txt(\"enabled\"));\n\t\t$enableendingtime->setChecked($end);\n\t\t// end date\n\t\t$endingtime = new ilDateTimeInputGUI('', 'end_date');\n\t\t$endingtime->setShowDate(true);\n\t\t$endingtime->setShowTime(true);\t\t\n\t\tif ($end)\n\t\t{\n\t\t\t$endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP));\n\t\t}\n\t\t$enableendingtime->addSubItem($endingtime);\n\t\t$form->addItem($enableendingtime);\n\t\t\n\t\t\n\t\t// presentation properties\n\t\t$info = new ilFormSectionHeaderGUI();\n\t\t$info->setTitle($this->lng->txt(\"svy_presentation_properties\"));\n\t\t$form->addItem($info);\n\t\t\n\t\t// show question titles\n\t\t$show_question_titles = new ilCheckboxInputGUI($this->lng->txt(\"svy_show_questiontitles\"), \"show_question_titles\");\n\t\t$show_question_titles->setValue(1);\n\t\t$show_question_titles->setChecked($this->object->getShowQuestionTitles());\n\t\t$form->addItem($show_question_titles);\n\t\t\n\t\t// introduction\n\t\t$intro = new ilTextAreaInputGUI($this->lng->txt(\"introduction\"), \"introduction\");\n\t\t$intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));\n\t\t$intro->setRows(10);\n\t\t$intro->setCols(80);\n\t\t$intro->setUseRte(TRUE);\n\t\t$intro->setInfo($this->lng->txt(\"survey_introduction_info\"));\n\t\tinclude_once \"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php\";\n\t\t$intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags(\"survey\"));\n\t\t$intro->addPlugin(\"latex\");\n\t\t$intro->addButton(\"latex\");\n\t\t$intro->addButton(\"pastelatex\");\n\t\t$intro->setRTESupport($this->object->getId(), \"svy\", \"survey\", null, $hide_rte_switch, \"3.4.7\");\n\t\t$form->addItem($intro);\n\n\t\t// final statement\n\t\t$finalstatement = new ilTextAreaInputGUI($this->lng->txt(\"outro\"), \"outro\");\n\t\t$finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));\n\t\t$finalstatement->setRows(10);\n\t\t$finalstatement->setCols(80);\n\t\t$finalstatement->setUseRte(TRUE);\t\t\n\t\t$finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags(\"survey\"));\n\t\t$finalstatement->addPlugin(\"latex\");\n\t\t$finalstatement->addButton(\"latex\");\n\t\t$finalstatement->addButton(\"pastelatex\");\n\t\t$finalstatement->setRTESupport($this->object->getId(), \"svy\", \"survey\", null, $hide_rte_switch, \"3.4.7\");\t\t\t\t\n\t\t$form->addItem($finalstatement);\n\n\t\t\n\t\t// results properties\n\t\t$results = new ilFormSectionHeaderGUI();\n\t\t$results->setTitle($this->lng->txt(\"results\"));\n\t\t$form->addItem($results);\n\n\t\t// evaluation access\n\t\t$evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), \"evaluation_access\");\n\t\t$evaluation_access->setInfo($this->lng->txt('evaluation_access_description'));\n\t\t$evaluation_access->addOption(new ilCheckboxOption($this->lng->txt(\"evaluation_access_off\"), EVALUATION_ACCESS_OFF, ''));\n\t\t$evaluation_access->addOption(new ilCheckboxOption($this->lng->txt(\"evaluation_access_all\"), EVALUATION_ACCESS_ALL, ''));\n\t\t$evaluation_access->addOption(new ilCheckboxOption($this->lng->txt(\"evaluation_access_participants\"), EVALUATION_ACCESS_PARTICIPANTS, ''));\n\t\t$evaluation_access->setValue($this->object->getEvaluationAccess());\n\t\t$form->addItem($evaluation_access);\n\n\t\t// mail notification\n\t\t$mailnotification = new ilCheckboxInputGUI($this->lng->txt(\"mailnotification\"), \"mailnotification\");\n\t\t// $mailnotification->setOptionTitle($this->lng->txt(\"activate\"));\n\t\t$mailnotification->setValue(1);\n\t\t$mailnotification->setChecked($this->object->getMailNotification());\n\n\t\t// addresses\n\t\t$mailaddresses = new ilTextInputGUI($this->lng->txt(\"mailaddresses\"), \"mailaddresses\");\n\t\t$mailaddresses->setValue($this->object->getMailAddresses());\n\t\t$mailaddresses->setSize(80);\n\t\t$mailaddresses->setInfo($this->lng->txt('mailaddresses_info'));\n\t\t$mailaddresses->setRequired(true);\n\n\t\t// participant data\n\t\t$participantdata = new ilTextAreaInputGUI($this->lng->txt(\"mailparticipantdata\"), \"mailparticipantdata\");\n\t\t$participantdata->setValue($this->object->getMailParticipantData());\n\t\t$participantdata->setRows(6);\n\t\t$participantdata->setCols(80);\n\t\t$participantdata->setUseRte(false);\n\t\t$participantdata->setInfo($this->lng->txt('mailparticipantdata_info'));\n\n\t\t$mailnotification->addSubItem($mailaddresses);\n\t\t$mailnotification->addSubItem($participantdata);\n\t\t$form->addItem($mailnotification);\n\n\t\t$form->addCommandButton(\"saveProperties\", $this->lng->txt(\"save\"));\n\n\t\t// remove items when using template\n\t\tif($template_settings)\n\t\t{\n\t\t\tforeach($template_settings as $id => $item)\n\t\t\t{\n\t\t\t\tif($item[\"hide\"])\n\t\t\t\t{\n\t\t\t\t\t$form->removeItemByPostVar($id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $form;\n\t}", "abstract protected function _initProperties();", "private function setDefaults()\n {\n $this->properties = new Properties(\n [\n Properties::PAGE_PREFIX . '0' => [\n 'type' => Properties::PAGE_PREFIX,\n 'label' => 'Page 1',\n ],\n Properties::FORM_HASH => [\n 'type' => Properties::FORM_HASH,\n 'name' => 'Composer Form',\n 'handle' => 'composerForm',\n 'color' => '#' . substr(md5(mt_rand(111, 999) . time()), 0, 6),\n 'submissionTitleFormat' => '{{ dateCreated|date(\"Y-m-d H:i:s\") }}',\n 'description' => '',\n 'formTemplate' => 'flexbox.html',\n 'returnUrl' => '/',\n 'storeData' => true,\n 'defaultStatus' => $this->statusHandler->getDefaultStatusId(),\n ],\n Properties::INTEGRATION_HASH => [\n 'type' => Properties::INTEGRATION_HASH,\n 'integrationId' => 0,\n 'mapping' => new \\stdClass(),\n ],\n Properties::ADMIN_NOTIFICATIONS_HASH => [\n 'type' => Properties::ADMIN_NOTIFICATIONS_HASH,\n 'notificationId' => 0,\n 'recipients' => '',\n ],\n ],\n $this->translator\n );\n\n $formAttributes = new FormAttributes(null, new CraftSession(), new CraftRequest());\n\n $this->context = new Context([]);\n $this->form = new Form(\n $this->properties,\n $formAttributes,\n [[]],\n $this->formHandler,\n $this->submissionHandler,\n $this->mailHandler,\n $this->fileUploadHandler,\n $this->mailingListHandler,\n $this->crmHandler,\n $this->translator\n );\n }", "private function initUserMappingForm()\n\t{\n\t\tinclude_once(\"./Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$propertie_form = new ilPropertyFormGUI();\n\t\t$propertie_form->setTitle($this->lng->txt('ldap_mapping_table'));\n\t\t$propertie_form->setFormAction($this->ctrl->getFormAction($this, 'saveMapping'));\n\t\t$propertie_form->addCommandButton('saveMapping',$this->lng->txt('save'));\n\t\t\n\t\tforeach($this->getMappingFields() as $mapping => $lang)\n\t\t{\n\t\t\t$text_form = new ilTextInputGUI($lang);\n\t\t\t$text_form->setPostVar($mapping.\"_value\");\n\t\t\t$text_form->setValue($this->mapping->getValue($mapping));\n\t\t\t$text_form->setSize(32);\n\t\t\t$text_form->setMaxLength(255);\n\t\t\t$propertie_form->addItem($text_form);\n\t\t\t\n\t\t\t$checkbox_form = new ilCheckboxInputGUI(\"\");\n\t\t\t$checkbox_form->setPostVar($mapping . \"_update\");\n\t\t\t$checkbox_form->setChecked($this->mapping->enabledUpdate($mapping));\n\t\t\t$checkbox_form->setOptionTitle($this->lng->txt('ldap_update_field_info'));\n\t\t\t$propertie_form->addItem($checkbox_form);\n\t\t}\n\t\t\n\t\t$this->initUserDefinedFields();\n\t\tforeach($this->udf->getDefinitions() as $definition)\n\t\t{\n\t\t\t$text_form = new ilTextInputGUI($definition['field_name']);\n\t\t\t$text_form->setPostVar('udf_'.$definition['field_id'].'_value');\n\t\t\t$text_form->setValue($this->mapping->getValue('udf_'.$definition['field_id']));\n\t\t\t$text_form->setSize(32);\n\t\t\t$text_form->setMaxLength(255);\n\t\t\t$propertie_form->addItem($text_form);\n\t\t\t\n\t\t\t$checkbox_form = new ilCheckboxInputGUI(\"\");\n\t\t\t$checkbox_form->setPostVar('udf_'.$definition['field_id'].'_update');\n\t\t\t$checkbox_form->setChecked($this->mapping->enabledUpdate('udf_'.$definition['field_id']));\n\t\t\t$checkbox_form->setOptionTitle($this->lng->txt('ldap_update_field_info'));\n\t\t\t$propertie_form->addItem($checkbox_form);\n\t\t}\n\t\t\n\t\treturn $propertie_form;\n\t}", "public function initializeUpdateAction()\n {\n // If the request does not come from a fluid form the properties which are allowed to map must be set manually\n if (!$this->request->getInternalArgument('__trustedProperties')) {\n $this->addPropertyMappingConfiguration();\n }\n }", "function feeds_ui_mapping_form_submit($form, &$form_state) {\n $importer = feeds_importer($form['#importer']);\n $processor = $importer->processor;\n\n $form_state += array(\n 'mapping_settings' => array(),\n 'mapping_settings_edit' => NULL,\n );\n\n // If an item is in edit mode, prepare it for saving.\n if ($form_state['mapping_settings_edit'] !== NULL) {\n $values = $form_state['values']['config'][$form_state['mapping_settings_edit']]['settings'];\n $form_state['mapping_settings'][$form_state['mapping_settings_edit']] = $values;\n }\n\n // We may set some settings to mappings that we remove in the subsequent step,\n // that's fine.\n $mappings = $form['#mappings'];\n foreach ($form_state['mapping_settings'] as $k => $v) {\n $mappings[$k] = array(\n 'source' => $mappings[$k]['source'],\n 'target' => $mappings[$k]['target'],\n ) + $v;\n }\n\n if (!empty($form_state['values']['remove_flags'])) {\n $remove_flags = array_keys(array_filter($form_state['values']['remove_flags']));\n\n foreach ($remove_flags as $k) {\n unset($mappings[$k]);\n unset($form_state['values']['mapping_weight'][$k]);\n drupal_set_message(t('Mapping has been removed.'), 'status', FALSE);\n }\n }\n\n // Keep our keys clean.\n $mappings = array_values($mappings);\n\n if (!empty($mappings)) {\n array_multisort($form_state['values']['mapping_weight'], $mappings);\n }\n\n $processor->addConfig(array('mappings' => $mappings));\n\n if (strlen($form_state['values']['source']) && strlen($form_state['values']['target'])) {\n try {\n $mappings = $processor->getMappings();\n $mappings[] = array(\n 'source' => $form_state['values']['source'],\n 'target' => $form_state['values']['target'],\n 'unique' => FALSE,\n );\n $processor->addConfig(array('mappings' => $mappings));\n drupal_set_message(t('Mapping has been added.'));\n }\n catch (Exception $e) {\n drupal_set_message($e->getMessage(), 'error');\n }\n }\n\n $importer->save();\n drupal_set_message(t('Your changes have been saved.'));\n}", "public function initializeCreateAction()\n {\n // If the request does not come from a fluid form the properties which are allowed to map must be set manually\n if (!$this->request->getInternalArgument('__trustedProperties')) {\n $this->addPropertyMappingConfiguration();\n }\n }", "protected function _initOldFieldsMap()\n {\n\n }", "private function reinit() {\n $this->init();\n $count = count($this->properties);\n for ($i = 0; $i < $count; $i++) {\n $p = $this->properties[$i];\n $newP = $this->newProject->createTask(\"property\");\n $newP->setName($p->getName());\n if ($p->getValue() !== null) {\n $newP->setValue($p->getValue());\n }\n if ($p->getFile() !== null) {\n $newP->setFile($p->getFile());\n } \n if ($p->getPrefix() !== null) {\n $newP->setPrefix($p->getPrefix());\n }\n if ($p->getRefid() !== null) {\n $newP->setRefid($p->getRefid());\n }\n if ($p->getEnvironment() !== null) {\n $newP->setEnvironment($p->getEnvironment());\n }\n if ($p->getUserProperty() !== null) {\n $newP->setUserProperty($p->getUserProperty());\n }\n if ($p->getOverride() !== null) {\n $newP->setOverride($p->getOverride());\n }\n $this->properties[$i] = $newP;\n }\n }", "public function initConfigurationForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$pl = $this->getPluginObject();\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\n\t\t// setting 1 (a checkbox)\n\t\t$cb = new ilCheckboxInputGUI($pl->txt(\"setting_1\"), \"setting_1\");\n\t\t$form->addItem($cb);\n\t\t\n\t\t// setting 2 (text)\n\t\t$ti = new ilTextInputGUI($pl->txt(\"setting_2\"), \"setting_2\");\n\t\t$ti->setRequired(true);\n\t\t$ti->setMaxLength(10);\n\t\t$ti->setSize(10);\n\t\t$form->addItem($ti);\n\t\n\t\t$form->addCommandButton(\"save\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($pl->txt(\"example_plugin_configuration\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t\t\n\t\treturn $form;\n\t}", "private function loadForm()\n {\n $this->frm = new BackendForm('settings');\n\n $this->frm->addText('username', $this->get('fork.settings')->get('Geo', 'username'));\n }", "function restws_schema_ui_property_settings(&$form, &$form_state, $resource, $map, $entity, $bundle) {\n $schema = restws_schema_get();\n\n // Get properties of the entity type.\n $info = entity_get_property_info($entity);\n $properties = isset($info['properties']) ? $info['properties'] : array();\n // Get properties of the selected bundle.\n if (isset($info['bundles'][$bundle]['properties'])) {\n $properties += $info['bundles'][$bundle]['properties'];\n }\n\n $options = array();\n foreach ($properties as $name => $info) {\n $label = array();\n foreach(array('label', 'description') as $key) {\n if (isset($info[$key])) {\n $label[] = $info[$key];\n }\n }\n $options[$name] = implode(': ', $label);\n }\n asort($options, SORT_NATURAL | SORT_FLAG_CASE);\n\n // Get restws_schema resource properties.\n foreach ($schema[$resource]['properties'] as $name => $info) {\n $property = restws_schema_ui_get_selected($form_state, $resource, $map, $name, $element);\n $form[$element] = array(\n '#title' => $info['label'],\n '#options' => $options,\n '#default_value' => $property,\n ) + restws_schema_ui_element_common();\n }\n}", "public function initPropertiesEditableForm()\n\t{\n\t\tglobal $lng, $ilCtrl, $tree, $rbacsystem, $ilSetting;\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\t\n\t\t// localization\n\t\t$options = array(\n\t\t\t\"\" => $lng->txt(\"please_select\"),\n\t\t\t);\n\t\t$langs = $lng->getInstalledLanguages();\n\t\t$lng->loadLanguageModule(\"meta\");\n\t\tforeach ($langs as $l)\n\t\t{\n\t\t\t$options[$l] = $lng->txt(\"meta_l_\".$l);\n\t\t}\n\t\t$loc = new ilSelectInputGUI($this->lng->txt(\"cont_localization\"), \"localization\");\n\t\t$loc->setOptions($options);\n\t\t$loc->setInfo($this->lng->txt(\"cont_localization_info\"));\n\t\t$this->form->addItem($loc);\n\n\t\t// glossary\n\t\t$ne = new ilNonEditableValueGUI($lng->txt(\"obj_glo\"), \"glossary\");\n\t\t$this->form->addItem($ne);\n\t\t\n\t\t// style\n\t\t$lng->loadLanguageModule(\"style\");\n\t\t$fixed_style = $ilSetting->get(\"fixed_content_style_id\");\n\t\t$style_id = $this->object->getStyleSheetId();\n\n\t\tif ($fixed_style > 0)\n\t\t{\n\t\t\t$st = new ilNonEditableValueGUI($lng->txt(\"cont_current_style\"));\n\t\t\t$st->setValue(ilObject::_lookupTitle($fixed_style).\" (\".\n\t\t\t\t$this->lng->txt(\"global_fixed\").\")\");\n\t\t\t$this->form->addItem($st);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$st_styles = ilObjStyleSheet::_getStandardStyles(true, false,\n\t\t\t\t$_GET[\"ref_id\"]);\n\n\t\t\t$st_styles[0] = $this->lng->txt(\"default\");\n\t\t\tksort($st_styles);\n\n\t\t\tif ($style_id > 0)\n\t\t\t{\n\t\t\t\t// individual style\n\t\t\t\tif (!ilObjStyleSheet::_lookupStandard($style_id))\n\t\t\t\t{\n\t\t\t\t\t$st = new ilNonEditableValueGUI($lng->txt(\"cont_current_style\"));\n\t\t\t\t\t$st->setValue(ilObject::_lookupTitle($style_id));\n\t\t\t\t\t$this->form->addItem($st);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))\n\t\t\t{\n\t\t\t\t$style_sel = ilUtil::formSelect ($style_id, \"style_id\",\n\t\t\t\t\t$st_styles, false, true);\n\t\t\t\t$style_sel = new ilSelectInputGUI($lng->txt(\"cont_current_style\"), \"style_id\");\n\t\t\t\t$style_sel->setOptions($st_styles);\n\t\t\t\t$style_sel->setValue($style_id);\n\t\t\t\t$this->form->addItem($style_sel);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// number of tries\n\t\t$ni = new ilNumberInputGUI($lng->txt(\"cont_qtries\"), \"q_tries\");\n\t\t$ni->setInfo($lng->txt(\"cont_qtries_info\")); // #15133\n\t\t$ni->setMaxLength(3);\n\t\t$ni->setSize(3);\n\t\t$this->form->addItem($ni);\n\t\t\n\n\t\t$this->form->addCommandButton(\"saveProperties\", $lng->txt(\"save\"));\n\n\t\t$this->form->setTitle($lng->txt(\"cont_scorm_ed_properties\"));\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this));\n\t}", "abstract protected function initInternalForms(): void;", "private function setupMapping()\n {\n $this->mapping = array();\n $fields = array();\n\n $aliases = array_keys($this->getJoinSettings());\n\n foreach ($aliases as $i => $alias) {\n $fields = array_merge($fields, $this->mapAlias($alias));\n }\n\n $this->mapping['fields'] = array_replace_recursive($fields, $this->getCustomMapping());\n $this->mapping['joins'] = $this->getJoinSettings();\n }", "public function setBuildFormRedirect(FormStateInterface &$form_state) {\n $form_state->setRedirect(\n 'entity.' . $this->config_entity->config_entity_name() . '.edit_form',\n [$this->config_entity->config_entity_name() => $this->config_entity->id()]\n );\n }", "protected function resetProperties() {}", "public function restoreFieldMap()\n {\n return $this->setFieldMap($this->getDefaultFieldMap());\n }", "protected function populateState()\n\t{\n\t\tparent::populateState();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy storage object to another bucket. Method must return ObjectInterface which points to new storage object.
public function copy(BucketInterface $destination): ObjectInterface;
[ "function copy_object($bucketName, $objectName, $newBucketName, $newObjectName)\n{\n $bucket = $this->bucket($bucketName);\n $object = $bucket->object($objectName);\n $object->copy($newBucketName, ['name' => $newObjectName]);\n}", "public function copyFromDiskToCloud()\n {\n return $this->saveToCloud(Storage::disk($this->getLocalDiskName())->get($this->getStoragePath(true)));\n }", "public function bucket($bucket){\n return $this->storage->bucket($bucket);\n }", "function rename_object($bucketName, $objectName, $newBucketName, $newObjectName)\n{\n $bucket = $this->bucket($bucketName);\n $object = $bucket->object($objectName);\n $object->copy($newBucketName, ['name' => $newObjectName]);\n $object->delete();\n}", "function copy_bucket($src_bucket, $dest_bucket) {\n $buckets = array(\n '%src_bucket' => $src_bucket,\n '%dest_bucket' => $dest_bucket,\n );\n\n $client = $this->client_factory();\n if (!$client->doesBucketExist($dest_bucket)) {\n $this->create_bucket($dest_bucket);\n }\n else {\n drush_log(dt('S3 bucket `%dest_bucket` already exists. Clearing contents.', $buckets));\n // TODO: figure out a smarter way of clearing stale contents to avoid excess data transfer.\n $client->clearBucket($dest_bucket);\n }\n\n drush_log(dt('Copying site bucket %src_bucket to backup bucket %dest_bucket.', $buckets));\n # We fork here because PHP leaks FDs like a sieve.\n # See https://www.drupal.org/node/1427428 and so on.\n $pid = pcntl_fork();\n if ($pid == -1) {\n return drush_set_error('cannot fork. boom');\n }\n elseif ($pid) { // Parent process.\n pcntl_waitpid($pid, $status); // Wait for subprocess to complete.\n // Check if the child succeeded.\n if (pcntl_wifexited($status) && pcntl_wexitstatus($status) == 0) {\n drush_log(dt('Copied contents of %src_bucket to %dest_bucket', $buckets), 'success');\n return TRUE;\n }\n else {\n drush_log('Failed to fork to copy buckets');\n return FALSE;\n }\n }\n else { // Child process.\n // The idea here is that we fork in this subprocess to ensure we don't\n // use up all the file descriptors. We use the subprocess exit code, that\n // is found by the parent (above) to signal the return value.\n $status = TRUE;\n try {\n $successful = $this->syncBuckets($src_bucket, $dest_bucket, $client);\n $failed = array();\n drush_get_context('DRUSH_EXECUTION_COMPLETED', TRUE);\n fclose(STDIN);\n fclose(STDOUT);\n fclose(STDERR);\n } catch (\\Guzzle\\Service\\Exception\\CommandTransferException $e) {\n $successful = $e->getSuccessfulCommands();\n $failed = $e->getFailedCommands();\n $this->handle_exception($e, dt('Could not copy contents of %src_bucket to %dest_bucket', $buckets));\n $status = FALSE;\n }\n exit($status);\n }\n }", "public final function copy(): ImageObject\n {\n $this->resourceCheck();\n\n return new ImageObject($this->createResourceCopy(),\n $this->getMime(), $this->getOptions(), $this->getResourceFile());\n }", "function download_object($bucketName, $objectName, $destination)\n {\n $bucket = $this->bucket($bucketName);\n $object = $bucket->object($objectName);\n $object->downloadToFile($destination);\n }", "function moveObject($uid, $new_share)\n {\n return $this->_storage->moveObject($uid, $new_share);\n }", "public function bucket($id);", "public function getReferenceStorage(): StorageInterface;", "public function putObjectCopy($bucket, $object, $copySource, $requestHeaders = null)\n\t{\n\t\t$url = \"https://\" . $bucket . \".\" . $this->options->get(\"api.url\") . \"/\" . $object;\n\t\t$headers = array(\n\t\t\t\"Date\" => date(\"D, d M Y H:i:s O\"),\n\t\t);\n\n\t\t// Check for request headers\n\t\tif (is_array($requestHeaders))\n\t\t{\n\t\t\tforeach ($requestHeaders as $key => $value)\n\t\t\t{\n\t\t\t\t$headers[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t$headers[\"x-amz-copy-source\"] = $copySource;\n\t\t$authorization = $this->createAuthorization(\"PUT\", $url, $headers);\n\t\t$headers[\"Authorization\"] = $authorization;\n\n\t\t// Send the http request\n\t\t$response = $this->client->put($url, \"\", $headers);\n\n\t\tif (! is_null($response))\n\t\t{\n\t\t\t// Process the response\n\t\t\treturn $this->processResponse($response);\n\t\t}\n\n\t\treturn null;\n\t}", "public function testPutObjectCopy()\n\t{\n\t\t$url = \"https://\" . $this->options->get(\"testBucket\") . \".\" . $this->options->get(\"api.url\")\n\t\t\t. \"/\" . $this->options->get(\"testObjectCopy\");\n\t\t$content = \"\";\n\t\t$headers = array(\n\t\t\t\"Date\" => date(\"D, d M Y H:i:s O\"),\n\t\t\t\"x-amz-grant-read\" => \"uri=\\\"http://acs.amazonaws.com/groups/global/AllUsers\\\"\",\n\t\t\t\"x-amz-grant-write-acp\" => \"emailAddress=\\\"alex.ukf@gmail.com\\\"\",\n\t\t\t\"x-amz-grant-full-control\" => \"id=\\\"6e887773574284f7e38cacbac9e1455ecce62f79929260e9b68db3b84720ed96\\\"\"\n\t\t);\n\t\t$headers[\"x-amz-copy-source\"] = \"/\" . $this->options->get(\"testBucket\")\n\t\t\t. \"/\" . $this->options->get(\"testObject\");\n\t\t$authorization = $this->object->createAuthorization(\"PUT\", $url, $headers);\n\t\t$headers['Authorization'] = $authorization;\n\n\t\t$this->client->expects($this->once())\n\t\t\t->method('put')\n\t\t\t->with($url, $content, $headers)\n\t\t\t->will($this->returnValue(null));\n\n\t\t$this->assertThat(\n\t\t\t$this->object->put->putObjectCopy(\n\t\t\t\t$this->options->get(\"testBucket\"),\n\t\t\t\t$this->options->get(\"testObjectCopy\"),\n\t\t\t\t\"/\" . $this->options->get(\"testBucket\") . \"/\" . $this->options->get(\"testObject\"),\n\t\t\t\t$this->options->get(\"testRequestHeaders\")\n\t\t\t),\n\t\t\t$this->equalTo(null)\n\t\t);\n\t}", "public function objectStorage(): ObjectStorage\r\n {\r\n $os = new ObjectStorage($this);\r\n return $os;\r\n }", "public function getS3Bucket();", "protected function getObject($path)\n {\n $path = $this->applyPathPrefix($path);\n return $this->bucket->object($path);\n }", "public function renameObject($bucket_name, $src_object_name,\n $dst_object_name);", "public function copyStorageFile($filename, StorageFile $file);", "abstract protected static function getNewStorage();", "public function getObject($bucket_name, $object_name);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LANDING PAGE FUNCTIONS Count how many vehicles there are for each region
function countByRegion() { $dbPath = $_SERVER['DOCUMENT_ROOT'] . "/rrautosales/api/db/db.php"; include($dbPath); $countQuery = "SELECT ASSIGNMENT_region.region_name AS 'region', COUNT(ASSIGNMENT_vehicles.region_id) AS 'count' FROM ASSIGNMENT_vehicles INNER JOIN ASSIGNMENT_region ON ASSIGNMENT_vehicles.region_id = ASSIGNMENT_region.region_id GROUP BY ASSIGNMENT_vehicles.region_id "; $queryResult = $conn->query($countQuery); if(!$queryResult){ echo $conn->error; } $rows = array(); while ($r = mysqli_fetch_assoc($queryResult)) { $rows[] = $r; } return json_encode($rows); }
[ "function tsml_count_regions() {\n\treturn count(tsml_get_all_regions());\n}", "function count_regional() {\t\n\t\t\t\t$this->db->from('hierachy_regional');\n\t\t return $num_rows = $this->db->count_all_results();\n\t\t}", "function regionCounter($phoneArray){\n $regionArray = array(\"Jamaica\" => 0,\"Anguilla\" => 0,\"Antigua\"=> 0,\"Aruba\"=> 0,\"BVI\"=> 0,\"Barbados\"=> 0,\"Bermuda\"=> 0,\"Bonaire\"=> 0,\"Cayman\"=> 0,\"Dominica\"=> 0,\n \"ElSalvador\"=> 0,\"FWI-FrenchGuiana\"=> 0,\"FWI-Guadeloupe\"=> 0,\"FWI-Martinique\"=> 0,\"Fiji\"=> 0,\"Grenada\"=> 0,\"Guyana\"=> 0,\"Haiti\"=> 0,\n \"Honduras\"=> 0,\"Nauru\"=> 0,\"PNG\"=> 0,\"Panama\"=> 0,\"Samoa\"=> 0,\"StKitts\"=> 0,\"StLucia\"=> 0,\"StVincent\"=> 0,\"Suriname\"=> 0,\"Tonga\"=> 0,\n \"Trinidad\"=> 0,\"Turks+Caicos\"=> 0,\"Vanuatu\"=> 0);\n foreach($phoneArray as $phoneNumber){\n switch($phoneNumber){\n case substr($phoneNumber,0,4) == \"1876\":\n $regionArray[\"Jamaica\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1264\":\n $regionArray[\"Anguilla\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1268\":\n $regionArray[\"Antigua\"]++;\n break;\n case substr($phoneNumber,0,3) == \"297\":\n $regionArray[\"Aruba\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1284\":\n $regionArray[\"BVI\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1246\":\n $regionArray[\"Barbados\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1441\":\n $regionArray[\"Bermuda\"]++;\n break;\n case substr($phoneNumber,0,3) == \"599\":\n $regionArray[\"Bonaire\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1345\":\n $regionArray[\"Cayman\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1767\":\n $regionArray[\"Dominica\"]++;\n break;\n case substr($phoneNumber,0,3) == \"503\":\n $regionArray[\"ElSalvador\"]++;\n break;\n case substr($phoneNumber,0,3) == \"594\":\n $regionArray[\"FWI-FrenchGuiana\"]++;\n break;\n case substr($phoneNumber,0,3) == \"590\":\n $regionArray[\"FWI-Guadeloupe\"]++;\n break;\n case substr($phoneNumber,0,3) == \"596\":\n $regionArray[\"FWI-Martinique\"]++;\n break;\n case substr($phoneNumber,0,3) == \"679\":\n $regionArray[\"Fiji\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1473\":\n $regionArray[\"Grenada\"]++;\n break;\n case substr($phoneNumber,0,3) == \"592\":\n $regionArray[\"Guyana\"]++;\n break;\n case substr($phoneNumber,0,3) == \"509\":\n $regionArray[\"Haiti\"]++;\n break;\n case substr($phoneNumber,0,3) == \"504\":\n $regionArray[\"Honduras\"]++;\n break;\n case substr($phoneNumber,0,3) == \"674\":\n $regionArray[\"Nauru\"]++;\n break;\n case substr($phoneNumber,0,3) == \"675\":\n $regionArray[\"PNG\"]++;\n break;\n case substr($phoneNumber,0,3) == \"507\":\n $regionArray[\"Panama\"]++;\n break;\n case substr($phoneNumber,0,3) == \"685\":\n $regionArray[\"Samoa\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1869\":\n $regionArray[\"StKitts\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1758\":\n $regionArray[\"StLucia\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1784\":\n $regionArray[\"StVincent\"]++;\n break;\n case substr($phoneNumber,0,3) == \"597\":\n $regionArray[\"Suriname\"]++;\n break;\n case substr($phoneNumber,0,3) == \"676\":\n $regionArray[\"Tonga\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1868\":\n $regionArray[\"Trinidad\"]++;\n break;\n case substr($phoneNumber,0,4) == \"1649\":\n $regionArray[\"Turks+Caicos\"]++;\n break;\n case substr($phoneNumber,0,3) == \"678\":\n $regionArray[\"Vanuatu\"]++;\n break;\n }\n }\n //Add response code\n $regionArray[\"response\"] = 1;\n return json_encode($regionArray);\n}", "public function inlineTemplateRegionCount(): int;", "public function getRegionsCount()\n {\n return $this->regions_count;\n }", "public function getRegionsCount()\n\t{\n\t\treturn count($this->_regions);\n\t}", "public function getTotalBarrenLand();", "function count_parcours_ressource ($id_ressource){\n return count(get_parcours_ressource($id_ressource,true)); //tous les parcours\n}", "public function getProductPageViews()\r\n {\r\n if(is_null($this->viewCount)){\r\n\r\n $maps = $this->getManufacturerProductMaps();\r\n $this->viewCount = 0;\r\n if($maps){\r\n foreach($maps as $map){\r\n// $this->viewCount += count($map->getProduct()->getProductVisits());\r\n $this->viewCount = 1;\r\n }\r\n }\r\n }\r\n \r\n return $this->viewCount;\r\n }", "private function checkRegionResults($region) {\n \n $freeCount = $this->getFreeRegionResults($region);\n $rankedCount = $this->getRankedRegionResults($region);\n \t\n return $rankedCount + $freeCount;\t\n }", "function total_robots() {\n $i = 0;\n foreach ($this->data as $value) {\n if ($value['is_robot'])\n $i++;\n }\n return $i;\n }", "function count_region_population() {\n\t\tif ($this->region_numbers == NULL)\n\t\t\treturn;\n\t\t$this->hull = NULL;\n\t\t$this->hull_area = 0;\n\t\t$this->skin_pixels_hull_count = 0;\n\n\t\t$this->region_population = array();\n\t\tfor ($x = 0; $x < $this->width; ++$x) {\n\t\t\t$a = $this->region_numbers[$x];\n\t\t\tfor ($y = 0; $y < $this->height; ++$y) {\n\t\t\t\t$regno = $a[$y];\n\t\t\t\tif (isset($this->region_population[$regno]))\n\t\t\t\t\t++$this->region_population[$regno];\n\t\t\t\telse\n\t\t\t\t\t$this->region_population[$regno] = 1;\n\t\t\t}\n\t\t}\n\n\t\t# Clean up very tiny regions.\n\t\t$tiny_region_numbers = array();\n\t\tforeach ($this->region_population as $regno => $pop) {\n\t\t\tif ($pop < 10) {\n\t\t\t\tunset($this->region_population[$regno]);\n\t\t\t\t$tiny_region_numbers[] = $regno;\n\t\t\t}\n\t\t}\n\n\t\tfor ($x = 0; $x < $this->width; ++$x) {\n\t\t\t$a = $this->region_numbers[$x];\n\t\t\tfor ($y = 0; $y < $this->height; ++$y) {\n\t\t\t\t$regno = $a[$y];\n\t\t\t\tif (in_array($regno, $tiny_region_numbers)) {\n\t\t\t\t\t$this->region_numbers[$x][$y] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->region_count = count($this->region_population);\n\t}", "public function regionAction()\n {\n\n /* recupero i parametri */\n $id = $this->_getParam('item', 0);\n $ads = $this->_getParam('ads', 0);\n $user = $this->_getParam('user', 0);\n\n $region = new Application_Model_DbTable_Region();\n\n /* tutte le informazioni della regione selezionata */\n $this->view->region = $region->getRegionInfo($id);\n\n /* le altre regioni escluso quella selezionata*/\n $this->view->other = $region->Other_Region($id);\n\n /* tutte le province della regione*/\n $provinces = new Application_Model_DbTable_Provinces();\n $this->view->provinces = $provinces->Parent_Provinces($id);\n\n /**\n * creo l'array con la lista degli annunci\n * mostro a video+array()\n */\n $shop = new Application_Model_DbTable_Shop();\n $fullShop = $shop->fullShopFilter(array('type' => 'region', 'id' => $id, 'ads' => $ads, 'user' => $user));\n $this->view->list = $fullShop;\n $this->view->range = $this->slider_range($fullShop);\n $this->view->type_ads = $this->params->type_ads->toArray();\n $this->view->type_user = $this->params->type_user->toArray();\n $this->view->notfound = $this->params->label_not_found;\n $this->view->icon_type_user = $this->_icon_type_user;\n $this->view->icon_type_ads = $this->_icon_type_ads;\n }", "private function regionCount($candidates)\n {\n $regions = [];\n foreach ($candidates as &$candidate){\n foreach ($candidate['regions'] as &$region){\n if (!isset($regions[$region['region_id']])){\n $regions[$region['region_id']] = [\n 'id' => $region['region_id'],\n 'title' => $region['region']['title'],\n 'country_id' => $region['country_id'],\n 'total' => 1,\n ];\n } else {\n $regions[$region['region_id']]['total']++;\n }\n }\n }\n\n return $regions;\n }", "public function calculateCountViews()\n {\n }", "function get_result_count( $params = [] ) {\n $text_of = __( 'of', 'fwp-front' );\n\n $page = (int) $params['page'];\n $per_page = (int) $params['per_page'];\n $total_rows = (int) $params['total_rows'];\n\n if ( $per_page < $total_rows ) {\n $lower = ( 1 + ( ( $page - 1 ) * $per_page ) );\n $upper = ( $page * $per_page );\n $upper = ( $total_rows < $upper ) ? $total_rows : $upper;\n $output = \"$lower-$upper $text_of $total_rows\";\n }\n else {\n $lower = ( 0 < $total_rows ) ? 1 : 0;\n $upper = $total_rows;\n $output = $total_rows;\n }\n\n return apply_filters( 'facetwp_result_count', $output, [\n 'lower' => $lower,\n 'upper' => $upper,\n 'total' => $total_rows,\n ] );\n }", "public function getNumberOfVehicles()\n {\n $userData = $this->getUserData();\n return !empty($userData['numberOfVehicles']) ? $userData['numberOfVehicles'] : 0;\n }", "public function count_all_vehicles(){\n\t\t\t\n\t\t\t$count_vehicles = $this->db->get('vehicles');\n\t\t\tif($count_vehicles->num_rows() > 0)\t{\n\t\t\t\t\t\n\t\t\t\t$count = $count_vehicles->num_rows();\n\t\t\t\treturn $count;\n\t\t\t}else {\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\t\n\t\t}", "public function countAdministrativeRegions() {\n\t\treturn $this->administrativeRegionController->_countAdministrativeRegions ();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns quicklinks children array for field values
public static function childrenFromContentField(Field $field): array { $children = []; if ($field->isNotEmpty()) { foreach ($field->yaml() as $menu) { $children[] = match ($menu) { '--' => [ 'slug' => Str::random(3), 'template' => 'separator', 'num' => 0 ], default => [ 'slug' => basename($menu), 'model' => 'reference-quicklink', 'template' => 'reference-quicklink', 'num' => 0, 'content' => ['link' => 'docs/reference/' . $menu] ] }; } } return $children; }
[ "public function getter_children();", "abstract public function get_children($query, $child_field);", "function acf_get_field_rest_links($post_id, array $field)\n{\n}", "public function getQuickLinks(): array;", "public function get_childs_array(): array;", "public function children() {\n\t\t/** @var CommentArray $comments */\n\t\t// $comments = $this->getPageComments();\n\t\t$page = $this->getPage();\n\t\t$field = $this->getField();\n\t\t$comments = $page->get($field->name);\n\t\t$children = $comments->makeNew();\n\t\tif($page) $children->setPage($this->getPage());\n\t\tif($field) $children->setField($this->getField()); \n\t\t$id = $this->id; \n\t\tforeach($comments as $comment) {\n\t\t\tif(!$comment->parent_id) continue;\n\t\t\tif($comment->parent_id == $id) $children->add($comment);\n\t\t}\n\t\treturn $children;\n\t}", "protected function getRelatedFields()\n {\n if (ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {\n return $this->getRelatedFieldsAlternative();\n }\n $result = [];\n $select = 'f.title';\n $from = Form::TABLE_NAME . ' fo ' .\n 'LEFT JOIN ' . Page::TABLE_NAME . ' p ON p.forms = fo.uid ' .\n 'LEFT JOIN ' . Field::TABLE_NAME . ' f ON f.pages = p.uid';\n $where = 'fo.uid = ' . (int)$this->getFormProperties()['uid'] . ' and p.deleted = 0 and f.deleted = 0';\n $groupBy = '';\n $limit = 1000;\n $res = ObjectUtility::getDatabaseConnection()->exec_SELECTquery($select, $from, $where, $groupBy, '', $limit);\n if ($res) {\n while (($row = ObjectUtility::getDatabaseConnection()->sql_fetch_assoc($res))) {\n $result[] = $row['title'];\n }\n }\n return $result;\n }", "public function buildRelationshipLinks(): array;", "public function getNestedFields () : array;", "private function getChildData() {\r\n\r\n\t\t$results = array();\r\n\t\t$id = (int) $this->dataObj;// id of the parent page whose children to return\r\n\t\t$triggerColumn = $this->triggerColumn;\r\n\t\t\r\n\t\t## Trigger Validation ##\r\n\t\t// @access-control: cached first column data (here dataObj will always be from first/initial select)\r\n\t\t// @note: only applies if we are in frontend\r\n\t\tif($this->triggerColumnIsFirst && $this->frontend) {\r\n\t\t\tif(!$this->dsUtilities->validateInitialSelect($id, $this->dsName, $this->firstColumnName, $this->dsSettings, $this->frontend)) return $results;\r\n\t\t}\t\t\t\t\r\n\r\n\t\t/*\r\n\t\t\t@note:\r\n\t\t\t- for security, we use a find instead of a get\r\n\t\t\t- hidden, unpublished and template-access controlled will be rejected\r\n\t\t\t- $parent = $this->wire('pages')->get(\"id=$id, check_access=1\");// @note: this will let hidden pages through, so we use below instead\r\n\t\t */\r\n\t\t$parent = $this->wire('pages')->find(\"id=$id, limit=1\");\r\n\t\tif ($parent->count()) {\r\n\t\t\t\r\n\t\t\t$parent = $parent->first();// @note: changing variable to first\r\n\r\n\t\t\t## Trigger Validation ##\r\n\t\t\t// @access-control: admin pages\r\n\t\t\tif(!$this->dsUtilities->validateAdminPages($parent)) return $results;\t\t\t\r\n\t\t\t// @access-control: included and excluded templates and pages\r\n\t\t\tif(!$this->dsUtilities->validateIncludedExcludedTemplatesPages($parent->template->id, $this->includedExcludedIDs, $triggerColumn, $parent->id)) return $results;\r\n\r\n\t\t\t## Trigger Validation passed: good to go ##\r\n\t\t\t// get only visible children\r\n\t\t\t#if(count($parent->numChildren(true)));\r\n\t\t\t// @todo: if limiting here would have been configurable. We cannot determine how many selectable options the dev/editor wants! For now we leave it to devs to ensure only reasonable number of children available to selects(?)\r\n\t\t\t\r\n\t\t\tif($parent->numChildren) {\r\n\t\t\t\t\r\n\t\t\t\t## filtering out/in ##\r\n\t\t\t\t$selector = '';\r\n\t\t\t\t// if some pages should be included/excluded from the results based on the templates and/or pageIDs\r\n\t\t\t\tif(count($this->includedTemplates) || count($this->excludedTemplates) || count($this->includedPages) || count($this->excludedPages)) {\r\n\t\t\t\t\t$selector = $this->dsUtilities->buildSelector($this->includedTemplates, $this->excludedTemplates, $this->includedPages, $this->excludedPages);\r\n\t\t\t\t}\r\n\t\t\t\t// @note: $parent->children() uses a find so it is OK...\r\n\t\t\t\t$results = $this->getData($this->dataSource, $parent->children($selector));// @note: dataSource was sanitized earlier\r\n\t\t\t}\r\n\r\n\t\t}\t\r\n\r\n\t\treturn $results;\r\n\r\n\t}", "public function children()\n {\n return $this->hasMany('App\\Models\\Field', 'parent_id');\n }", "public function getChildLinks()\n {\n return $this->child_links;\n }", "function facetapi_get_child_values(array $build) {\n $values = array_keys($build);\n foreach ($build as $item) {\n if (!empty($item['#item_children'])) {\n $values = array_merge(facetapi_get_child_values($item['#item_children']), $values);\n }\n }\n return $values;\n}", "public function getChilds()\n {\n return $this->fields['childs'];\n }", "public function children() {\n\t\treturn $this->fieldset_children;\n\t}", "public static function accessibleChildren() {\n return Arr::pluck(Caretaker::where('user_id', Auth::id())->get(), 'child_id');\n }", "function walkhub_field_get_references($entity_type, $entity, $field, $language = LANGUAGE_NONE, $value_name = 'target_id') {\n $nids = walkhub_field_get_value($entity, $field, TRUE, $language, $value_name);\n if (!$nids) {\n return array();\n }\n\n $uuids = entity_get_uuid_by_id($entity_type, $nids);\n $ordered_uuids = array();\n foreach ($nids as $nid) {\n if (isset($uuids[$nid])) {\n $ordered_uuids[] = $uuids[$nid];\n }\n }\n\n return $ordered_uuids;\n}", "function fetch_children()\n\t{\n\t\t$data = $this->get_data();\n\t\t$children = array();\n\n\t\tif ( ! array_key_exists('children', $this->data))\n\t\t{\n\t\t\treturn $this->get_content();\n\t\t}\n\n\t\tfor ($i=0;$i<count($data['children']);$i++)\n\t\t{\n\t\t\t/* Recursively fetch children of children page\n\t\t\t */\n\t\t\t$page_child_obj = new Page($data['children'][$i]->path);\n\t\t\t$page_child['content'] = $page_child_obj->fetch_children();\n\n\t\t\t$page_child['grid'] = $data['children'][$i]->grid;\n\t\t\t$order = $data['children'][$i]->order;\n\n\t\t\t$children[$order] = $page_child;\n\n\t\t}\n\t\t/* Key is the order, so sort by key\n\t\t */\n\t\tksort($children);\n\t\treturn $children;\n\t}", "public function getChildLinks()\n\t{\n\t\t//See if indexing is need depending only user selection\n\t\treturn $this->childlinks;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end o2_canonical_url switch use of o2_the_excerpt() default: ON
function o2_use_excerpt() { $display = TRUE; $display = apply_filters('o2_use_excerpt', $display); return $display; }
[ "function o2_use_autoexcerpt() {\n $display = FALSE;\n $display = apply_filters('o2_use_autoexcerpt', $display);\n return $display;\n}", "function sumobi_edd_csau_show_excerpt() {\n return false;\n}", "public function usePostExcerptAsDescription(): bool\n {\n return true;\n }", "function o2_canonical_url() {\n\t\tif (o2_seo()) {\n \t\tif ( is_singular() ) {\n \t\t$canonical_url = \"\\t\";\n \t\t$canonical_url .= '<link rel=\"canonical\" href=\"' . get_permalink() . '\" />';\n \t\t$canonical_url .= \"\\n\\n\"; \n \t\techo apply_filters('o2_canonical_url', $canonical_url);\n\t\t\t\t}\n }\n}", "function simplecart_use_autoexcerpt() {\n $display = FALSE;\n $display = apply_filters('simplecart_use_autoexcerpt', $display);\n return $display;\n}", "function gs_augment_search_excerpt($content) {\n global $wp_query;\n if (!empty($wp_query->query_vars['s'])) {\n \n global $post;\n global $blog_id;\n \n $post_blog_id = $post->blog_id; // the ID of the blog which the post belongs to\n $real_blog_id = $blog_id; // the ID of the blog that is performing the search operation\n \n // if the two IDs are equal, just return the permalink that WP already built \n if ($post_blog_id === $real_blog_id) return $content;\n \n // otherwise, temporary switch to the blog of the post\n // get the right permalink\n // and switch back to the original blog\n switch_to_blog($post_blog_id);\n $content = \"<p id='gs_external_post'>\" . __('From') . \" \" . \"<a href='\" . trailingslashit(get_bloginfo('wpurl')) . \"' title='\" . get_bloginfo('name') . \"' alt='\" . get_bloginfo('name') . \"'>\" . get_bloginfo('name') . \"</a></p>\" . $content;\n switch_to_blog($real_blog_id);\n\n }\n return $content;\n}", "function gg10_excerpt( $excerpt ) {\n\n\tglobal $post;\n\n\tif ( '' != get_post_meta( $post->ID, '_yoast_wpseo_metadesc', true ) ) :\n\t\treturn get_post_meta( $post->ID, '_yoast_wpseo_metadesc', true );\n\telse :\n\t\treturn $excerpt;\n\tendif;\n\n}", "function the7_hide_details_link_for_small_auto_excerpt( $text, $num_words, $more, $original_text ) {\n\t\tif ( $text && $text === wp_strip_all_tags( $original_text ) ) {\n\t\t\t// Hide details button.\n\t\t\tadd_filter( 'presscore_post_details_link', 'presscore_return_empty_string', 15 );\n\t\t}\n\n\t\treturn $text;\n\t}", "function tfuse_new_excerpt_more() {\n return '...';\n}", "function studio_page_excerpt() {\n\n\tif ( class_exists( 'WooCommerce' ) && is_shop() ) {\n\n\t\twoocommerce_result_count();\n\n\t} elseif ( is_home() ) {\n\n\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( get_option( 'page_for_posts' ) ) ) );\n\n\t} elseif ( is_search() ) {\n\n\t\t$id = get_page_by_path( 'search' );\n\n\t\tif ( has_excerpt( $id ) ) {\n\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );\n\n\t\t}\n\n\t} elseif ( is_404() ) {\n\n\t\t$id = get_page_by_path( 'error' );\n\n\t\tif ( has_excerpt( $id ) ) {\n\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );\n\n\t\t}\n\n\t} elseif ( ( is_single() || is_singular() ) && ! is_singular( 'product' ) && has_excerpt() ) {\n\n\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt() ) );\n\n\t}\n}", "function custom_excerpt_more_link($more){\r\n return '<a href=\"' . get_the_permalink() . '\" rel=\"nofollow\">&nbsp;[more]</a>';\r\n}", "function register_block_core_post_excerpt()\n {\n }", "function filter_wpseo_replacements( $replacements ) {\n if( isset( $replacements['%%cf_page_content%%'] ) ){\n if ( !empty(get_the_excerpt()) ) {\n $replacements['%%cf_page_content%%'] = johnunwin_wp_excerpt('', 'johnunwin_no_read_more');\n } else {\n $replacements['%%cf_page_content%%'] = custom_field_excerpt();\n }\n\n //$replacements['%%cf_page_content%%'] = custom_field_excerpt();\n\n }\n return $replacements;\n}", "function remove_yoast_canonical_link() {\n\t\treturn false;\n\t}", "public function fixSeoIssues()\n {\n //Check it's not default front page\n if ($this->_getPostId() == get_option('page_on_front')) {\n return;\n }\n\n //Print canonical url\n echo '<meta name=\"robots\" content=\"noindex\" />' . \"\\n\";\n echo '<link rel=\"canonical\" href=\"' . get_permalink($this->_getPostId()). '\" />' . \"\\n\";\n }", "function Progressive_custom_excerpt_more($output)\n{\n if (has_excerpt() && !is_attachment()) {\n $output .= Progressive_continue_reading_link();\n }\n return $output;\n}", "function tecscan_page_excerpt() {\n\n\tif ( class_exists( 'WooCommerce' ) && is_shop() ) {\n\t\twoocommerce_result_count();\n\n\t} elseif ( is_home() ) {\n\t\t$id = get_option( 'page_for_posts' );\n\n\t\tif ( has_excerpt( $id ) ) {\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );\n\t\t}\n\n\t} elseif ( is_search() ) {\n\t\t$id = get_page_by_path( 'search' );\n\n\t\tif ( has_excerpt( $id ) ) {\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );\n\t\t}\n\n\t} elseif ( is_404() ) {\n\t\t$id = get_page_by_path( 'error' );\n\n\t\tif ( has_excerpt( $id ) ) {\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( $id ) ) );\n\t\t}\n\n\t} elseif ( ( is_single() || is_singular() ) && ! is_singular( 'product' ) && has_excerpt() ) {\n\t\tif ( has_excerpt() ) {\n\t\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt() ) );\n\t\t}\n\t}\n}", "function the_excerpt_embed()\n{\n}", "function rp3_json_remove_excerpt_sharing() {\n\tremove_filter( 'the_excerpt', 'sharing_display', 19 );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the data for the NamespaceManager store and put them to the ajax output.
public static function getData() { if ( BsCore::checkAccessAdmission( 'wikiadmin' ) === false ) return true; global $wgContLang; $aResults = array(); $aNamespaces = $wgContLang->getNamespaces(); foreach ( $aNamespaces as $iNs => $sNamespace ) { if ( $sNamespace === '' ) { $sNamespace = BsNamespaceHelper::getNamespaceName( $iNs ); } if ( $iNs === -2 || $iNs === -1 ) continue; $aResults[] = array( 'id' => $iNs, 'name' => $sNamespace ); } wfRunHooks( 'NamespaceManager::getNamespaceData', array( &$aResults ) ); $oRequest = RequestContext::getMain()->getRequest(); $iLimit = $oRequest->getInt( 'limit', 25 ); $iStart = $oRequest->getInt( 'start', 0 ); $sSort = $oRequest->getVal( 'sort', '[{"property":"id","direction":"DESC"}]' ); self::$aSortConditions = FormatJson::decode($sSort); self::$aSortConditions = self::$aSortConditions[0]; usort( $aResults, 'NamespaceManager::namespaceManagerRemoteSort' ); $aLimitedResults = array(); $iResultCount = count( $aResults ); $iMax = ( ( $iStart + $iLimit ) > $iResultCount ) ? $iResultCount : ( $iStart + $iLimit ); for ( $i = $iStart; $i < $iMax; $i++ ) { $aLimitedResults[] = $aResults[$i]; } $aReturn = array( 'totalCount' => $iResultCount, 'success' => true, 'results' => $aLimitedResults ); return FormatJson::encode( $aReturn ); }
[ "public function getstoredataAction() {\n\t\t\n\t\t$basicinfo = array ();\n $website_id = Mage::app()->getStore()->getWebsiteId();\n $website = Mage::app ()->getWebsite($website_id);\n\n foreach($website->getGroups() as $key=> $group):\n\n $stores = $group->getStores();\n $store_view = array();\n $new_array = array();\n foreach ($stores as $key => $view) {\n $store_view['name'] = $view->getName();\n $store_view['view_id'] = $view->getStoreId();\n $store_view['store_url'] = $view->getUrl();\n $store_view['store_code']= Mage::getStoreConfig(self::XML_DEFAULT_STORE_LANG, $view->getStoreId());\n $store_view['store_name']= $view->getName();\n $store_view['sort_order'] = $view->getSortOrder();\n $store_view['is_active'] = $view->getIsActive();\n array_push($new_array, $store_view);\n }\n $basicinfo[]=array(\n 'store' => $group->getName(),\n 'store_id' => $group->getGroupId(),\n 'root_category_id' => $group->getRootCategoryId(),\n 'view'=>$new_array\n );\n\n $store_view ='';\n endforeach;\n \techo json_encode($basicinfo);\n\t}", "public function ajaxGetStats()\n {\n $amount_of_jobs = $this->model->getAmountOfJobs();\n\n // simply echo out something. A supersimple API would be possible by echoing JSON here\n echo $amount_of_jobs;\n }", "public function ajaxGetStats()\n {\n $amount_of_employees = $this->model->getAmountOfEmployees();\n\n // simply echo out something. A supersimple API would be possible by echoing JSON here\n echo $amount_of_employees;\n }", "public function calculateData() {\n\t\t$prefix = $this->config['prefixes']['calculated'];\n\t\t$this->data[$prefix.'self'] = (int) $this->calculateSelf();\n\t\t$this->data[$prefix.'email'] = $this->calculateEmail();\n\t\t$this->data[$prefix.'gravatar'] = $this->calculateGravatar(80);\n\t\treturn true;\n\t}", "public function run()\n {\n $result = new JsonAjaxResult();\n\n $result->set_property(self::PROPERTY_ELEMENTS, $this->getElements()->as_array());\n $result->set_property(self::PROPERTY_TOTAL_ELEMENTS, $this->userCount);\n\n $result->display();\n }", "public function fetch()\n\t{\n\t\t$content = $this->output();\n\t\t$this->resources($this->js, 'js');\n\t\t$this->resources($this->css, 'css');\n\t\t$this->master_obj->widgets = array_merge($this->master_obj->widgets, array($content));\n\t\t#return array('content' => $content, 'js' => $this->js, 'css' => $this->css);\n\t}", "function wcmsl_ajax_get_stores() {\n\t// Fetch stores from database\n\t$stores_query = new WP_Query([\n\t\t'post_type' => 'wcmsl_store',\n\t\t'posts_per_page' => -1,\n\t]);\n\n\t$stores = [];\n\tif ($stores_query->have_posts()) {\n\t\twhile ($stores_query->have_posts()) {\n\t\t\t$stores_query->the_post();\n\n\t\t\tarray_push($stores, [\n\t\t\t\t'name' => get_the_title(),\n\t\t\t\t'address' => get_field(WCMSL_ACF_ADDRESS_FIELD),\n\t\t\t\t'city' => get_field(WCMSL_ACF_CITY_FIELD),\n\t\t\t\t'latitude' => (float)get_field(WCMSL_ACF_LATITUDE_FIELD),\n\t\t\t\t'longitude' => (float)get_field(WCMSL_ACF_LONGITUDE_FIELD),\n\t\t\t]);\n\t\t}\n\t}\n\n\twp_send_json_success($stores);\n}", "public function ajaxGetStats()\n {\n // Instance new Model (Song)\n $Song = new Song();\n $amount_of_songs = $Song->getAmountOfSongs();\n\n // simply echo out something. A supersimple API would be possible by echoing JSON here\n echo $amount_of_songs;\n }", "public function ajaxGetStats()\n {\n $amount_of_books = $this->books_model->getAmountOfbooks();\n\n // simply echo out something. A supersimple API would be possible by echoing JSON here\n echo $amount_of_books;\n }", "function ajax_get_units() {\n\t\t$units = get_units();\n\t\techo json_encode( $units );\n\t\tdie();\n\t}", "public function fetchStoresData()\n\t{\n\t\t$result = array('data' => array());\n\n\t\t$data = $this->model_stores->getStores();\n\n\t\tforeach ($data as $key => $value) {\n\n\t\t\t// button\n\t\t\t$buttons = '';\n\n\t\t\t// $buttons = '';\n\n\t\t\tif(in_array('updateStore', $this->permission)) {\n\t\t\t\t$buttons = '<button type=\"button\" class=\"btn btn-primary btn-sm\" onclick=\"editFunc('.$value['store_id'].')\" data-toggle=\"modal\" data-target=\"#editModal\" data-toggle=\"tooltip\" title=\"Edit\"><i class=\"fa fa-pencil\"></i></button>\n\t\t\t\t\t<button onclick=\"window.location.href=&#39;' . base_url('stores/product_per_store/'.$value['store_id']) . '&#39;\" class=\"btn btn-info btn-sm\" data-toggle=\"tooltip\" title=\"Products\"><i class=\"fa fa-product-hunt\"></i></button>\n\t\t\t\t\t';\n\t\t\t}\n\n\t\t\tif(in_array('deleteStore', $this->permission)) {\n\t\t\t\t$buttons .= ' <button type=\"button\" class=\"btn btn-danger btn-sm\" onclick=\"removeFunc('.$value['store_id'].')\" data-toggle=\"modal\" data-target=\"#removeModal\" data-toggle=\"tooltip\" title=\"Delete\"><i class=\"fa fa-trash\"></i></button>';\n\t\t\t}\n\n\t\t\t$status = ($value['store_active'] == 1) ? '<span class=\"badge badge-success\">Active</span>' : '<span class=\"badge badge-warning\">Inactive</span>';\n\n\t\t\t$result['data'][$key] = array(\n\t\t\t\t$value['store_id'],\n\t\t\t\t$value['store_name'],\n\t\t\t\t// $value['store_active'],\n\t\t\t\t$status,\n\t\t\t\t$buttons\n\t\t\t);\n\t\t} // /foreach\n\n\t\techo json_encode($result);\n\t}", "final private function __setTreeData()\n\t{\n\t\tif ($this->tree) {\n\t\t\t// Include existing data with this Controller data\n\t\t\t$this->data = array_merge($this->incomingData['__store'], $this->data);\n\t\t}\n\n\t\t// Save updated data to $this->data['__store'] for next Controller\n\t\t$this->data['__store'] = array_merge($this->incomingData, $this->data);\n\t}", "public function processItemStore()\n {\n\n Session::save();\n $data['html'] = $this->prepareHtml();\n $data['total'] = $this->calculateTotalAmount();\n $data['shipping_amount'] = $this->calculateShippingAmount();\n $data['tax_amount'] = $this->calculateTaxAmount();\n $data['total_items'] = count(Session::get('items'));\n\n\n return $this->jsonSuccessResponse($this->getMessageData('success', $this->lang)['item_added_to_bag'], $data);\n }", "function admin_ajax_handler() {\n\t\t\t\n\t\t//for the response\n\t\t$response = array();\n\t\t\n\t\t//check on type of operation\n\t\tswitch( $_POST['type']){\n\t\t\n\t\t\tcase 'client_setup': \n\t\t\t\t\n\t\t\t\t$response['message'] = $this->client_setup( $_POST );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the lists and send 'em back\n\t\t\tcase 'get_lists':\n\t\t\t\t\n\t\t\t\t$response['message'] = $this->get_lists( $_POST );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t//copy the folder that was set\n\t\t\tcase 'copy_trigger':\n\t\t\t\t\n\t\t\t\t$response['message'] = $this->copy_trigger( $_POST ) ;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'activate_account':\n\t\t\t\t\n\t\t\t\t$response['message'] = $this->activate_account( $_POST ) ;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$arr = $response;\n\t\t\n\t\t$response = json_encode($arr);\t\t\n\t\t//header for json response\n\t\theader( \"Content-Type: application/json\" );\n\t\techo $response;\n\t\t\n\t\tdie();\n\t}", "protected function updateDataStore()\n {\n // Add some helper variables into the scope\n $this->store->merge([\n 'template' => $this->template,\n 'layout' => $this->getLayout()\n ]);\n\n // Add globals. Each global set will get their own scope.\n $this->mergeGlobalsIntoDataStore();\n\n // The 'global.yaml' global set will be merged into the global cascade.\n $this->store->merge($this->store->getScope('global'));\n\n // Merge anything passed to this in a $data parameter.\n // Also put it in the 'page' scope if anyone ever needs to access it from inside another scope\n $data = (is_object($this->data)) ? $this->data->toArray() : $this->data;\n $this->store->merge($data);\n $this->store->mergeInto('page', $data);\n $this->store->merge(['page_object' => $this->data instanceof LocalizedData ? $this->data->get() : $this->data]);\n }", "function _json_data() {\n $WidgetWrangler = array();\n $WidgetWrangler['data'] = array(\n 'ajaxURL' => admin_url( 'admin-ajax.php' ),\n 'allWidgets' => $this->ww->get_all_widgets(),\n );\n return json_encode($WidgetWrangler);\n }", "public function process_location_manager() {\n\t SLP_AJAX_Location_Manager::get_instance();\n }", "function getTotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty( $this->_namespaces ))\n\t\t{\n\t\t\t$this->getNamespaces();\n\t\t}\n\n\t\treturn count( $this->_namespaces );\n\t}", "public function get_ajax_data(){\n\n // Envio en formato json las franquicias obtenidas en el modelo\n $this->output->set_content_type('application/json')->set_output(json_encode($this->franquicias->get_ajax_data()));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove unicode sequences from json string
public static function jsonRemoveUnicodeSequences($struct) { return preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode($struct)); }
[ "function jsonClean($json){\n $str_response = mb_convert_encoding($json, 'utf-8', 'auto');\n\n for ($i = 0; $i <= 31; ++$i) {\n $str_response = str_replace(chr($i), \"\", $str_response);\n }\n $str_response = str_replace(chr(127), \"\", $str_response);\n\n if (0 === strpos(bin2hex($str_response), 'efbbbf')) {\n $str_response = substr($str_response, 3);\n }\n\n return $str_response;\n }", "public function sanitizeJSON($str)\n {\n\tfor ($i = 0; $i <= 31; ++$i)\n\t{ \n\t\t$str = str_replace(chr($i), \"\", $str); \n\t}\n\t$str = str_replace(chr(127), \"\", $str);\n\tif (0 === strpos(bin2hex($str), 'efbbbf'))\n\t{\n\t\t$str = substr($str, 3);\n\t}\n return $str;\n }", "function fuckTheWeChatInvalidJSON($invalidJSON)\n{\n return preg_replace('/[\\x00-\\x1F\\x80-\\x9F]/u', '', trim($invalidJSON));\n}", "public function fix_json_string( $string ) {\n\t\t$string = preg_replace( '/(?<!\\\\\\)(u[0-9a-f]{4})/', '\\\\\\$1', $string );\n\n\t\treturn $string;\n\t}", "function json_unescaped_encode($arr) {\n\t\t$str = json_encode($arr);\n\t\t$str = preg_replace_callback('/\\\\\\\\u([0-9a-f]{4})/i',\n\t\t\t\tfunction ($matches) {\n\t\t\t\t\t$sym = mb_convert_encoding(pack('H*', $matches[1]),'UTF-8','UTF-16');\n\t\t\t\t\treturn $sym;\n\t\t\t\t},$str);\n\t\treturn $str;\t\t\n\t}", "public static function clean_json_string($str)\n\t{\n\t\treturn preg_replace('~\"(google\\.(.*?))\"~', '$1', $str);\n\t}", "public static function removeNonUTF8($data)\n\t{\n\t\t// Array || object\n\t\tif(is_array($data) || is_object($data)){\n\t\t\tforeach($data as $key => &$val){\n\t\t\t\t$val = self::removeNonUTF8($val);\n\t\t\t}\n\t\t\tunset($key, $val);\n\t\t\t\n\t\t\t//String\n\t\t}else{\n\t\t\tif(!preg_match('//u', $data))\n\t\t\t\t$data = 'Nulled. Not UTF8 encoded or malformed.';\n\t\t}\n\t\treturn $data;\n\t}", "private function cleanJson($json_in) {\n //$json_in = json_decode($json_in); // $cars is the json array before decoding\n foreach ($json_in as $key => $value) {\n if ('' === $value) {\n unset($json_in[$key]);\n }\n }\n return json_encode($json_in);\n }", "public static function trimJSON(string $json)\n {\n foreach (StringHandler::regexAll($json, '/\"(\\s{0,}\\p{L}*\\s{0,}\\p{L}.\\s{0,})\"/mu') as $group) {\n $json = StringHandler::replace($json, $group[1], StringHandler::trim($group[1]));\n }\n\n return $json;\n }", "function grabUnicodeChar($input) {\n \n $trimmed = trim($input, \"U+\");\n $unicodeChar = \"\\u$trimmed\";\n return json_decode('\"'.$unicodeChar.'\"');\n }", "public function unescapeJSON($json)\n {\n return str_replace(array('\\\"', \"\\\"{\", \"}\\\"\", '\\\\\\\\\\/', '\\\\\\\\'), array('\"', \"{\", \"}\", '/', '\\\\'), $json);\n }", "function json_decode_pof($data) {\n $convert = str_replace(\n array('u00e4', 'u00e5', 'u00f6', 'u00c4', 'u00c5', 'u00d6'),\n array('\\u00e4', '\\u00e5', '\\u00f6', '\\u00c4', '\\u00c5', '\\u00d6'),\n $data\n );\n return json_decode($convert);\n}", "private function fixJsonStructure($json)\n {\n return str_replace(array(',\"{','[\"{','}\"]','\\\\\\\\','}\"}','\\\"', ':\"{', '}\",'), array(',{','[{','}]','\\\\','}}','\"', ':{', '},'), $json);\n }", "protected static function jsonDeArmor($value)\r\n {\r\n return utf8_decode(str_replace(\r\n static::$ENCODED_JSON_CHARACTERS,\r\n static::$ESCAPE_JSON_CHARACTERS,\r\n $value\r\n ));\r\n }", "public static function remove_extra_formatting(string $json):string {\r\n $preparedJSON = preg_replace('/([{,]+)(\\s*)([^\"]+?)\\s*:/', '$1\"$3\":', $json);\r\n $preparedJSON = preg_replace('/(,)\\s*}$/', '}', $json);\r\n return $preparedJSON;\r\n }", "function _json_decode($string) {\n\tif (get_magic_quotes_gpc()) {\n\t\t$string = stripslashes($string);\n\t}\n\treturn json_decode($string);\n\t}", "function sanitise_non_utf8($str)\n {\n return preg_replace('/[\\x00-\\x1F\\x7F-\\xFF]/', '', $str);\n }", "function utf8_clean($str)\n{\n return iconv('UTF-8', 'UTF-8//IGNORE', $str);\n}", "public static function escapeJSONSpecialChars($string) {\n $escapedJson = '';\n $string = ''.$string;\n\n if ($string) {\n $count = count(Json::SPECIAL_CHARS);\n\n for ($i = 0 ; $i < $count ; $i++) {\n if ($i == 0) {\n $escapedJson = str_replace(Json::SPECIAL_CHARS[$i], Json::SPECIAL_CHARS_ESC[$i], $string);\n } else {\n $escapedJson = str_replace(Json::SPECIAL_CHARS[$i], Json::SPECIAL_CHARS_ESC[$i], $escapedJson);\n }\n }\n }\n\n return $escapedJson;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the workers as a pretty string.
public function __toString() { $res = "File descriptor: | IP address: | Client id: | Functions:\n"; $res .= "-------------------------------------------------------------\n"; foreach ($this->getWorkers() as $worker) { $res .= sprintf("%16d | %15s | %-10s | %s\n", $worker->getFd(), $worker->getIp(), $worker->getClientId(), implode(' ', $worker->getFunctions())); } return $res; }
[ "public function __toString()\n {\n return \"Worker[name=$this->name, queue={$this->queue->getName()}, daemon={$this->daemon}]\";\n }", "public function displayFreeWorkers(){\n return $this->querry->getFreeWorkers();\n }", "public function printWorkerInfo() {\r\n echo \"\\n\\nfio: \" . $this->fio;\r\n echo \"\\nprofession: \" . $this->profession;\r\n echo \"\\nsalary: \" . $this->salary;\r\n echo \"\\ntime: \" . $this->time;\r\n }", "private function buildPrometheusWorkerStats(array $workers)\n {\n $lf = self::LF;\n\n $o = '# worker related:' . $lf;\n\n list($new, $running, $paused) = $this->getWorkerStatusStats($workers);\n\n $o .= '# HELP resque_worker_new number of new workers' . $lf . '# TYPE resque_worker_new gauge' . $lf;\n $o .= sprintf('resque_worker_new %d', $new) . $lf;\n\n $o .= '# HELP resque_worker_running number of workers' . $lf . '# TYPE resque_worker_running gauge' . $lf;\n $o .= sprintf('resque_worker_running %d', $running) . $lf;\n\n $o .= '# HELP resque_worker_paused number of paused workers' . $lf . '# TYPE resque_worker_paused gauge' . $lf;\n $o .= sprintf('resque_worker_paused %d', $paused) . $lf;\n\n $o .= '# HELP resque_worker_processed processed jobs' . $lf . '# TYPE resque_worker_processed counter' . $lf;\n foreach ($workers as $worker) {\n $o .= sprintf('resque_worker_processed{id=\"%s\"} %d', $worker->getId(), $worker->getJobsProcessed()) . $lf;\n }\n $o .= '# HELP resque_worker_cancelled cancelled jobs' . $lf . '# TYPE resque_worker_cancelled counter' . $lf;\n foreach ($workers as $worker) {\n $o .= sprintf('resque_worker_cancelled{id=\"%s\"} %d', $worker->getId(), $worker->getJobsCancelled()) . $lf;\n }\n $o .= '# HELP resque_worker_failed failed jobs' . $lf . '# TYPE resque_worker_failed counter' . $lf;\n foreach ($workers as $worker) {\n $o .= sprintf('resque_worker_failed{id=\"%s\"} %d', $worker->getId(), $worker->getJobsFailed()) . $lf;\n }\n $o .= '# HELP resque_worker_mem memory usage' . $lf . '# TYPE resque_worker_mem gauge' . $lf;\n foreach ($workers as $worker) {\n $o .= sprintf('resque_worker_mem{id=\"%s\"} %d', $worker->getId(), $worker->getMemory()) . $lf;\n }\n\n return $o;\n }", "public function __toString()\n {\n return $this->workload;\n }", "public function getTopRankWorkersHtml(){\n\t\tinclude \"/library/WorkerWidget.php\";\n\t\tforeach ($this->topRankWorkers as $key => $worker) {\n\t\t\tWorkerWidget::get(['type' => 'index', 'worker' => $worker]);\n\t\t}\t\n\t}", "public function __toString()\n {\n return 'Work as' . ' ' . $this->job . ' at ' . $this->company;\n }", "function display_workers()\n{\n\tglobal $db;\n\n\tfor ($i=0, $n=count($db); $i<$n; $i++) {\n\t $worker_data = $db[$i];\n\t $worker_name = $worker_data[0];\n\t $worker_address = $worker_data[1];\n\t $worker_phone = $worker_data[2];\n\t print \"<tr bgcolor=\\\".row_color($i).\\\">\\n\";\n\t print \"<td>$worker_name</td>\\n\";\n\t print \"<td>$worker_address</td>\\n\";\n\t print \"<td>$worker_phone</td>\\n\";\n\t print \"</tr>\\n\";\n\t}\n}", "public function getWorkerName()\n {\n return $this->work_name;\n }", "function dump() {\n $str = '';\n $str .= sprintf(\"Pie geometry [id = %d]\\n\", $this->id );\n $str .= \" Nodes\\n\";\n foreach ($this->nodes as $node) {\n $str .= sprintf(\" Node [%4d], lat = %-19s lon = %-19s %s\\n\",\n $node['id'], $node['lat'], $node['lon'],\n isset($node['action']) ? $node['action'] : '');\n }\n\n $str .= \" Slices\\n\";\n foreach ($this->slices as $slice) {\n\n $ids = join(', ', array_map(function($node) {return $node['id'];}, $slice['nodes']));\n $str = $str . sprintf(\" Slice %[4d], index = %3d, nodes = [%s] %s\\n\",\n $slice['id'],\n $slice['index'],\n $ids,\n isset($slice['action']) ? $slice['action'] : '');\n\n }\n return $str;\n }", "protected function show_workers_queues_list($workers)\n {\n $this->line(\"<info>Your workers:</info>\");\n foreach ($workers as $worker_file_name) {\n if (is_dir(getcwd() . '/' . $this->workers_dir . '/' . $worker_file_name))\n continue;\n $this->line('<comment>' . $this->remove_extension($worker_file_name) . '</comment>');\n }\n }", "public function printTask()\n {\n $result = \"\";\n if($this->taskList)\n {\n $result = \"\\nTask-List: \\\"\" . $this->getName() . \"\\\" Status: \" . $this->getStatusText() . \"\\n\";\n foreach ($this->taskList as $task)\n {\n $result .= $task->printTask();\n }\n }\n return $result;\n }", "public function toString(): string\n {\n //used to get the length of characters in one line of the report\n $toAddLength = 0;\n\n //The formatted report String to return\n $stringToReturn = '--- Benchmark Report ---' . PHP_EOL;\n $stringToReturn .= '========================' . PHP_EOL;\n\n //Create the report\n foreach ($this->reportServiceResponse as $key => $value) {\n $stringToReturn .= 'Callable Name: ' . $key . PHP_EOL;\n if (is_array($value)) {\n $bottomBorderLength = 0;\n foreach ($value as $comparators) {\n\n foreach ($comparators as $comparatorName => $v) {\n $toAdd = '';\n $toAdd .= ' Comparator ' . $comparatorName . ' = ' . $v['time'] . ' ms. ' . PHP_EOL;\n $bottomBorderLength = $bottomBorderLength > strlen($toAdd) ? $bottomBorderLength : strlen($toAdd);\n $stringToReturn .= $toAdd;\n }\n }\n $stringToReturn .= str_repeat('-', $bottomBorderLength) . PHP_EOL;\n }\n }\n $stringToReturn .= str_repeat('=', $toAddLength) . PHP_EOL;\n return $stringToReturn;\n }", "public function getWorkers() {\n\t\t$workers_list = new WorkersList();\n\t\treturn $workers_list->getWorkers();\n\t}", "public function dump(Workout $workout): string;", "public function getWorkers()\n {\n return $this->workers;\n }", "public function __toString()\n {\n return 'Job' . $this::encode($this);\n }", "public function workers()\n\t{\n\t\treturn $this->request('getuserworkers')->getuserworkers;\n\t}", "public function getWorkers()\n {\n return $this->discovery->getWorkers();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Associate files with an activity
public function __invoke(Activity $activity, $files) { $entries = collect(); foreach ($files as $fileEntry) { $entries->put($fileEntry["id"], ["direction" => $fileEntry["direction"]]); } DB::transaction(function () use ($activity, $entries) { $activity->files()->attach($entries); }); return $activity; }
[ "function startActivity($activity) {\n global $tmpfile;\n $activity = trim($activity);\n\n if (file_exists($tmpfile)) {\n endActivity();\n }\n\n $line = mktime() . '|' . $activity;\n\n if (!file_put_contents($tmpfile, $line)) {\n msg(\"Unable to write to the tempfile. Cannot start activity.\", 'ERROR');\n }\n msg(\"Start: $activity\", 'status');\n}", "public function test_attach_files_base() {\n $filearea = 'intro';\n $component = 'mod_forum';\n $module = 'forum';\n\n $course = self::getDataGenerator()->create_course();\n $activity = self::getDataGenerator()->create_module('forum', array('course' => $course->id));\n $context = \\context_module::instance($activity->cmid);\n $contextid = $context->id;\n\n // Create file to add.\n $fs = get_file_storage();\n $filerecord = array(\n 'contextid' => $contextid,\n 'component' => $component,\n 'filearea' => $filearea,\n 'itemid' => 0,\n 'filepath' => '/',\n 'filename' => 'testfile.txt');\n $content = 'All the news that\\'s fit to print';\n $file = $fs->create_file_from_string($filerecord, $content);\n\n // Construct the search document.\n $rec = new \\stdClass();\n $rec->courseid = $course->id;\n $area = new core_mocksearch\\search\\mock_search_area();\n $record = $this->generator->create_record($rec);\n\n $document = $area->get_document($record);\n $document->set('itemid', $activity->id);\n\n // Create a mock from the abstract class,\n // with required methods stubbed.\n $builder = $this->getMockBuilder('\\core_search\\base_activity');\n $builder->disableOriginalConstructor();\n $builder->setMethods(array('get_module_name', 'get_component_name'));\n $stub = $builder->getMockForAbstractClass();\n $stub->method('get_module_name')->willReturn($module);\n $stub->method('get_component_name')->willReturn($component);\n\n // Attach file to our test document.\n $stub->attach_files($document);\n\n // Verify file is attached.\n $files = $document->get_files();\n $file = array_values($files)[0];\n\n $this->assertEquals(1, count($files));\n $this->assertEquals($content, $file->get_content());\n }", "function addActivity($activity)\r\n\t{\r\n\t\t$this->activities[$activity->getId()] = $activity;\r\n\t}", "public function setFile($file)\n {\n $path = \"android_apps/{$this->id}\";\n $fileName = \"{$this->id}-{$this->version}.apk\";\n\n $filePath = Storage::disk('local')->putFileAs($path, $file, $fileName);\n\n $this->file = $filePath;\n $this->save();\n }", "public function attachFile($fieldname, $filename) {}", "public function attachFileToDataset()\n {\n\n }", "private function addAnnotationFile(SplFileInfo $file)\n {\n $afiles = json_decode($this->annotationFiles, true) ?: array();\n $afiles[] = (string) $file;\n $this->annotationFiles = json_encode($afiles);\n }", "function fileExists($activity)\n{\n $filename = getVal($activity, [0, 'filename']);\n\n return file_exists(public_path('/files/xml/' . $filename));\n}", "public function createFileStart();", "function AddAssetsFromDir($fileExtension, $assetType)\n{\n global $ATTACHMENTS_SET_PATH, $ASSET_SERVICE_URI;\n \n $assetsGlob = \"$ATTACHMENTS_SET_PATH/*\" . $fileExtension;\n \n echo \"Uploading assets from $assetsGlob\\n\";\n \n $assetPaths = glob($assetsGlob);\n foreach ($assetPaths as $assetPath)\n { \n $assetData = file_get_contents($assetPath);\n $assetFilename = basename($assetPath);\n $assetId = GetUuidFromAssetFilename($assetFilename);\n \n echo \"Uploading asset $assetFilename\\n\";\n \n AddAsset(\n $ASSET_SERVICE_URI, \n CreateAssetXml($assetData, $assetId, $assetId, \"\", $assetType));\n } \n}", "public function addActivity($data);", "public function addFile($file) { }", "public function addFile() {\n $args = func_get_args();\n $c = count($args);\n for ($i=0;$i<$c;$i++) {\n $file = $args[$i];\n if (!file_exists($file)) continue;\n $this->files[] = $file;\n }\n }", "public function createFileInfos($asset);", "public static function GetActivityPaths() {\n \n }", "function __construct(){\n parent:: __construct();\n $this->entries_path = \"extras\" . DIRECTORY_SEPARATOR . \"entries.txt\";\n $this->records_path = \"extras\" . DIRECTORY_SEPARATOR . \"records.txt\"; \n $this->repeat_path = \"extras\" . DIRECTORY_SEPARATOR . \"repeated.txt\"; \n }", "function googleactivity_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)\n{\n return null;\n}", "public function testAddOrderActivityFile()\n {\n }", "public function useFileReference();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if menu item is allowed for current user level
function AllowListMenu($TableName) { global $arMenuUserLevelPriv; $userlevellist = ""; if (function_exists("CurrentUserLevelList")) $userlevellist = CurrentUserLevelList(); // Get user level id list if (strval($userlevellist) == "") // Not defined, just get user level $userlevellist = CurrentUserLevel(); if (IsLoggedIn()) { if (IsListItem($userlevellist, "-1")) { return TRUE; } else { $priv = 0; if (is_array($arMenuUserLevelPriv)) { foreach ($arMenuUserLevelPriv as $row) { if (strval($row[0]) == strval($TableName) && IsListItem($userlevellist, $row[1])) { $thispriv = $row[2]; if (is_null($thispriv)) $thispriv = 0; $thispriv = intval($thispriv); $priv = $priv | $thispriv; } } } return ($priv & 8); } } else { return FALSE; } }
[ "function current_user_can_edit_menu(){\r\n\t\tif ( $this->is_super_plugin() ){\r\n\t\t\treturn is_super_admin();\r\n\t\t} else {\r\n\t\t\treturn current_user_can('manage_options');\r\n\t\t}\r\n\t}", "public function canAccessAdminMenu()\n {\n if($this->username == 'Admin')\n {\n return true;\n }\n return false;\n }", "public static function checkUserAccessMenu($menuKode, $menuItemKode, $level)\n {\n \t$userAC \t\t= '';\n \t$accessItem \t= array();\n\n \t$obj_accessItem = DB::table('taccessitem')\n\t\t\t\t\t\t\t->select('TAccessItem_List')\n\t\t ->where('TAccess_Code', '=', $level)\n\t\t ->where('TAccessItem_Menu', '=', $menuKode)\n\t\t ->first();\n\n\t\tif(is_null($obj_accessItem)){\n\t\t\t$bolAccess = false;\n\t\t}else{\n\t\t\t$accessItem = explode(';', $obj_accessItem->TAccessItem_List); \t\n\t\t\t$bolAccess \t= in_array($menuItemKode, $accessItem);\n\t\t}\n\n \t\treturn $bolAccess;\n\n }", "public function has_access() {\n\n\t\t$access = false;\n\n\t\tif (\n\t\t\tis_user_logged_in() &&\n\t\t\tcurrent_user_can( 'manage_options' )\n\t\t) {\n\t\t\t$access = true;\n\t\t}\n\n\t\treturn apply_filters( 'wp_mail_smtp_admin_adminbarmenu_has_access', $access );\n\t}", "function is_elevated()\r\n {\r\n return $this->ci->session->userdata('acp_user_level');\r\n }", "static public function guestCanAccess($menuItem) {\n $app = JApplication::getInstance('site');\n $menu = $app->getMenu('site')->getItem($menuItem->id);\n $isInternal = JURI::isInternal($menuItem->flink);\n $canAccess = (is_object($menu)) ? in_array((int) $menu->access, JFactory::getUser(0)->getAuthorisedViewLevels()) : false;\n\n if (($isInternal && $canAccess) || $menuItem->type == 'url') \n return true;\n }", "public static function can_view_woocommerce_menu_item()\n {\n }", "function isMenuforUser($menu_id, $user_id){\n\t\t$result = $this->db->query(\"SELECT * FROM menus_roles_xref WHERE menu_id=\".$menu_id.\" AND role_id IN(SELECT role_id FROM user_role_xref WHERE user_id=\".$this->db->escape($user_id));\n\t\tif($result->num_rows()>0){\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function CheckShowAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n \n $res=parent::CheckShowAccess($item);\n\n if ($res) { $res=$this->Current_User_Event_May_Access($item); }\n\n return $res;\n }", "private function checkUserAccess()\n {\n global $Core;\n\n if (!$this->usersLevelTableName) {\n return;\n }\n\n if (!isset($this->data['pages']) || empty($this->data['pages'])) {\n $selector = new BaseSelect($this->pagesTableName);\n $selector->addField('level', 'level', $this->usersLevelTableName);\n $selector->addLeftJoin($this->usersLevelTableName, 'id', 'level_id');\n $selector->setWhere(\"`{$Core->dbName}`.`{$this->pagesTableName}`.`controller_path` = '\".$Core->db->escape($Core->rewrite->controllerPath).\"'\");\n $selector->setGlobalTemplate('fetch_assoc');\n $level = $selector->execute();\n if (!empty($level) && isset($level['level']) && $level['level'] == 0) {\n return;\n }\n } else {\n foreach ($this->data['pages'] as $page) {\n if ($Core->Rewrite->controllerPath == $page['controller_path']) {\n return;\n }\n }\n }\n\n $this->userAccessDenied();\n }", "public function userHasAccess(){\n\t\tif( !$this->user->isAuth() && !$this->user->auth() ){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->user->hasAccessToLevel( $this->getLevelId() );\n\t}", "function user_can_access_admin_page() {}", "function CheckShowListAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n return $res;\n }", "function ask_access_to_list ()\n { \n if( ($GLOBALS['B']->auth->user_rights > 3) )\n {\n return TRUE;\n }\n return FALSE;\n }", "private function allowModify()\n {\n if($this->controllerVar['loggedUserRole'] <= 40 )\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "function security()\r\n\t{\r\n\t\t//If the user can not manage options we will die on them\r\n\t\tif(!current_user_can($this->access_level))\r\n\t\t{\r\n\t\t\twp_die(__('Insufficient privileges to proceed.', $this->identifier));\r\n\t\t}\r\n\t}", "protected function access_only_allowed_members() {\n if ($this->access_type == \"all\") {\n return true; \n } else if ($this->module_group === \"hr\" && $this->access_type === \"supper\") {\n return true;\n } else {\n redirect(\"forbidden\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ GRAVITY UNITS param g: number gravity
public static function gu($g){ if(is_numeric($g)) return round(($g - 1) * 1000); else return null; }
[ "function getGravity(){}", "public function getGravity () {}", "function setGravity($gravity){}", "public function setGravity ($gravity) {}", "protected function getGravity()\n {\n return is_null($this->gravity) ? 1 : $this->gravity;\n }", "public function getHaveGravity()\n {\n return $this->haveGravity;\n }", "public function getG()\n {\n return $this->g;\n }", "public function getImageGravity() {\n\t}", "public function getImageGravity () {}", "public function setG($val)\n {\n $this->_propDict[\"g\"] = $val;\n return $this;\n }", "public function getG() : GMP\n {\n return $this->g;\n }", "public function setImageGravity ($gravity) {}", "function gravity(float $fallTime, float $startSpeed, $startPos):float{\n\n $distance = 0.5 * (-9.81)*pow($fallTime,2) + $startSpeed * $fallTime + $startPos;\n\n return $distance;\n}", "public function getGustos()\n\t{\n\t\treturn $this->m_gustos;\n\t}", "public function adjustForGravity() {\n\t\t$d = $this->size;\n\t\t$height = $d['height'];\n\t\t$width = $d['width'];\n\t\t$gx = 0;\n\t\t$gy = 0;\n\t\t$cnt = count($this->xydata);\n\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t$gx += $this->xydata[$i]['x'];\n\t\t\t$gy += $this->xydata[$i]['y'];\n\t\t}\n\t\t$gx /= $cnt;\n\t\t$gy /= $cnt;\n\t\t$diffx = $width / 2 - $gx;\n\t\t$diffy = $height / 2 - $gy;\n\t\tfor ($i = 0; $i < $cnt; $i++) {\n $this->xydata[$i]['x'] = $this->xydata[$i]['x']+$diffx;\n $this->xydata[$i]['y'] = $this->xydata[$i]['y']+$diffy;\n\t\t}\n\t}", "public function getIva_gravado()\n {\n return $this->iva_gravado;\n }", "public function getGpa(){\n\t\t\treturn $this->gpa;\n\t\t}", "public function setGravity(string $gravity)\n {\n $this->gravity = $gravity;\n\n return $this;\n }", "public function setG($g)\n {\n $this->g = $g;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all PlanEvaluacion entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $entities = $em->getRepository('chanppEvImBundle:PlanEvaluacion')->findAll(); return array( 'entities' => $entities, ); }
[ "public function actionIndex()\n {\n $searchModel = new GuiaEvaluacionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('chanppEvImBundle:EvaluacionDirecta')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n\t{\n\t\t$evaluaciones = $this->evaluacionesRepository->all();\n\n\t\treturn $this->sendResponse($evaluaciones->toArray(), \"Evaluaciones retrieved successfully\");\n\t}", "function cargarEvaluaciones() {\n\t\treturn $this->evaluaciones;\n\t}", "public function actionIndex()\n {\n $searchModel = new EvaluationSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $critereEvaluations = $em->getRepository('BonPlanBundle:CritereEvaluation')->findAll();\n return $this->render('EtablissementBundle:critereevaluation:index.html.twig', array(\n 'critereEvaluations' => $critereEvaluations,\n ));\n }", "public function evaluaciones($id) {\n return Cliente::find($id)->evaluaciones;\n }", "public function evaluarAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('AdminMedBundle:RedDofe')->findBy(array('evaluador' => $this->getUser(), 'periodo'=> $this->container->getParameter('appmed.periodo')));\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $evaluations = $em->getRepository('NoteBundle:Evaluation')->findAll();\n\n return $this->render('evaluation/index.html.twig', array(\n 'evaluations' => $evaluations,\n ));\n }", "public function evaluations() {\n return $this->hasMany('App\\Evaluation');\n }", "public function getEvaluations() {\n if(!property_exists($this->data, 'evaluations')) $this->loadEvaluations();\n require_once(\"Event.php\");\n $evaluations = array();\n foreach($this->data->classes as $evaluation) {\n //FIXME I could not find a scheduled evaluation at this time in order to get the correct type\n $evaluation->type = \"EVALUATION\";\n $evaluation->period = $evaluation->evaluationPeriod;\n unset($evaluation->evaluationPeriod);\n $evaluations[] = new Event($this->fenixEdu, $evaluation);\n }\n return $evaluations;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $typeEvaluations = $em->getRepository('AppBundle:TypeEvaluation')->findAll();\n\n return $this->render('typeevaluation/index.html.twig', array(\n 'typeEvaluations' => $typeEvaluations,\n ));\n }", "public function GetLista()\r\n {\r\n \treturn($this->Consultar(\"SELECT * FROM evaluacion;\", true));\r\n }", "public function actionIndex()\n {\n $searchModel = new GrupoExpensasSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "private function getListExecutions()\n {\n $executions = $this->getRepository('Execution')->findAll();\n\n $result = $this->render(\n $this->bundleName . ':List:indexExecutions.html.twig',\n array(\n 'executions' => $executions\n )\n );\n\n return $result;\n }", "public function allEvaluationReport()\n {\n $data = DB::table('evaluationresults')\n ->orderBy('tid','asc')\n ->orderBy('courseid','asc')->get();\n return view('admin.all_evaluation_report')->with('data',$data);\n }", "public function actionConfig_vista_evaluaciones_alumno() {\n\n $idanio = $_SESSION['anio'];\n\n $cmdareas = \" CALL CARGA_AREAS_PARA_ADMIN(\" . $idanio . \");\";\n $dataareas = Yii::app()->db->createCommand($cmdareas)->queryAll();\n\n $this->renderPartial('config_evaluaciones_alumno', array(\n 'dataareas' => $dataareas));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $planificacions = $em->getRepository('CommonBundle:Planificacion')->findAll();\n\n return $this->render('@Frontend/Planificacion/index.html.twig', array(\n 'planificacions' => $planificacions,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SchoolNoteBundle:Evaluation')->findAll();\n\n return $this->render('SchoolNoteBundle:Evaluation:index.html.twig', array(\n 'entities' => $entities,\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Writes the message $message to the log. The writer can use the severity, source, and category to filter the incoming messages and determine the location where the messages should be written. The array $optional contains extra information that can be added to the log. For example: line numbers, file names, usernames, etc.
public function writeLogMessage( $message, $severity, $source, $category, $optional = array() ) { $this->entries[] = new ezcLogEntry( $message, $severity, $source, $category, $optional ); }
[ "public function writeLogMessage( $message, $severity, $source, $category, $optional = array() );", "public function writeLogMessage( $message, $severity, $source, $category, $optional = array() )\n {\n $severityName = ezcLog::translateSeverityName( $severity );\n $tables = $this->map->get( $severity, $source, $category );\n $query = $this->db->createSelectQuery();\n\n if ( count( $tables ) > 0 )\n {\n foreach ( $tables as $t )\n {\n try\n {\n $q = $this->db->createInsertQuery();\n $q->insertInto( $t )\n ->set( $this->message, $q->bindValue( $message ) )\n ->set( $this->severity, $q->bindValue( $severityName ) )\n ->set( $this->source, $q->bindValue( $source ) )\n ->set( $this->category, $q->bindValue( $category ) )\n ->set( $this->datetime, $query->expr->now() );\n foreach ( $optional as $key => $val )\n {\n $q->set( ( isset( $this->additionalColumns[$key] ) ? $this->additionalColumns[$key] : $key ), $q->bindValue( $val ) );\n }\n $stmt = $q->prepare();\n $stmt->execute();\n\n }\n catch ( PDOException $e )\n {\n throw new ezcLogWriterException( $e );\n }\n }\n }\n else\n {\n if ( $this->defaultTable !== false )\n {\n try\n {\n $q = $this->db->createInsertQuery();\n $q->insertInto( $this->defaultTable )\n ->set( $this->message, $q->bindValue( $message ) )\n ->set( $this->severity, $q->bindValue( $severityName ) )\n ->set( $this->source, $q->bindValue( $source ) )\n ->set( $this->category, $q->bindValue( $category ) )\n ->set( $this->datetime, $query->expr->now() );\n foreach ( $optional as $key => $val )\n {\n $q->set( ( isset( $this->additionalColumns[$key] ) ? $this->additionalColumns[$key] : $key ), $q->bindValue( $val ) );\n }\n $stmt = $q->prepare();\n $stmt->execute();\n }\n catch ( PDOException $e )\n {\n throw new ezcLogWriterException( $e );\n }\n }\n }\n }", "protected function write( $message ) {\n\t\tforminator_addon_maybe_log( $message );\n\t}", "protected function _write($message) {\n\t\tif (!empty($_GET['debug']) || !empty($_SERVER['argv']) && (in_array('-v', $_SERVER['argv'], true) || in_array('-vv', $_SERVER['argv'], true))) {\n\t\t\tdebug($message);\n\t\t}\n\t\t$this->output[] = $message;\n\t}", "public function write($message)\r\n\t{\r\n\t\t$logfile = $this->_logDir . DIRECTORY_SEPARATOR .'log_'. date('l') .'.log';\r\n\t\t\r\n\t\t$this->deleteExpiredLogFile($logfile, 60 * 60 * 24 * 6); // 6 days - to delete 1 week old log\r\n\t\t\r\n\t\t$this->_handle = @fopen($logfile, \"a+\"); \r\n\t\t\r\n\t\tif ($this->_handle !== false)\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tif (is_array($message))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($message as $value) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t@fwrite($this->_handle, $value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t@fwrite($this->_handle, $message);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (Exception $ex)\r\n\t\t\t{\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@fclose($this->_handle);\r\n\t\t\r\n\t\t\t@chmod($logfile, 0777);\r\n\t\t}\r\n\t\t\r\n\t\t$this->_handle = -1;\t\t\r\n\t}", "private static function _write( $message, $level = self::INFO, $logName = null, $dir = null )\n {\n \tif (!isset($logName)) $logName = self::getOption(self::INFO_LOGFILE);\n \tif (!isset($dir)) $dir = self::getOption(self::LOG_DIR);\n $fileName = $dir . '/' . $logName;\n $oldumask = @umask( 0 );\n $fileExisted = @file_exists( $fileName );\n if ( $fileExisted && filesize( $fileName ) > self::getOption(self::MAX_LOGFILE_SIZE) )\n {\n if ( self::rotateLog( $fileName ) )\n $fileExisted = false;\n }\n $logFile = @fopen( $fileName, \"a\" );\n if ( $logFile )\n {\n \t$now = new DateTime();\n $logMessage = self::$LEVELS[$level] .\" [\" . $now->format( self::getOption(self::TIMESTAMP_FORMAT) ) . \"] [\" . getmypid() .\"] $message\\n\";\n @fwrite( $logFile, $logMessage );\n @fclose( $logFile );\n if ( !$fileExisted )\n {\n $permissions = octdec( '0666' );\n @chmod( $fileName, $permissions );\n }\n @umask( $oldumask );\n }\n else\n {\n error_log( 'Couldn\\'t create the log file \"' . $fileName . '\"' );\n }\n }", "public function write($message)\n {\n // if file pointer doesn't exist, then open log file\n if (!is_resource($this->fp)) {\n $this->open();\n }\n\n $script_name = $_SERVER[\"SCRIPT_NAME\"]; // pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time and suppress E_WARNING if using the system TZ settings\n // (don't forget to set the INI setting date.timezone)\n $time = @date('[d/M/Y:H:i:s]');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\" . PHP_EOL);\n }", "function write_log( $message ) {\n\t\tglobal $jr_options;\n\n\t\tif ( $jr_options->jr_enable_log ) {\n\t\t\t// if file pointer doesn't exist, then open log file\n\t\t\tif ( ! $this->fp ) {\n\t\t\t\t$this->open_log();\n\t\t\t}\n\t\t\t// define script name\n\t\t\t$script_name = basename( $_SERVER['PHP_SELF'] );\n\t\t\t$script_name = substr( $script_name, 0, -4 );\n\t\t\t// define current time\n\t\t\t$time = date_i18n( 'H:i:s' );\n\t\t\t// write current time, script name and message to the log file\n\t\t\tfwrite( $this->fp, \"$time ($script_name) $message\\n\" );\n\t\t}\n\t}", "public function log($message, $priority = Zend_Log::INFO);", "function mZ_write_to_file($message, $file_path = '') {\n\t\t$file_path = (($file_path == '') || !file_exists($file_path)) ? WP_CONTENT_DIR . '/mbo_debug_log.txt' : $file_path;\n\t\t$header = date('l dS \\o\\f F Y h:i:s A', strtotime(\"now\")) . \" \\nMessage:\\t \";\n\n\t\tif (is_array($message)) {\n\t\t\t$header = \"\\nMessage is array.\\n\";\n\t\t\t$message = print_r($message, true);\n\t\t}\n\t\t$message .= \"\\n\";\n\t\tfile_put_contents($file_path, $header . $message, FILE_APPEND | LOCK_EX);\n\t}", "public function appendLog($message);", "protected function _write() {\n $message = self::getMessage();\n $priority = $this->priorityList[$this->_logData['severity']];\n syslog($priority, $message);\n }", "public function logwrite($message) \n\t\t{\n\t\t\t#### if file pointer doesn't exist, then open log file\n\t\t\tif (!is_resource($this->fp)) \n\t\t\t{\n\t\t\t\t$this->logopen();\n\t\t\t}\n\t\t\t#### define script name\n\t\t\t$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n\t\t\t#### define current time and suppress E_WARNING if using the system TZ settings\n\t\t\t#### (don't forget to set the INI setting date.timezone)\n\t\t\t$time = @date('[d/M/Y:H:i:s e]');\n\t\t\t#### write current time, script name and message to the log file\n\t\t\tfwrite($this->fp, \"$time ($script_name) $message\\n\");\n\t\t}", "public function write(string $message) : void\n {\n // Set the yearly directory name\n $directory = $this->_directory.date('Y');\n\n if ( ! is_dir($directory))\n {\n // Create the yearly directory\n if ( ! mkdir($directory, 02777) && ! is_dir($directory))\n {\n throw new Exception('Directory \":dir\" was not created', [\n ':dir' => $directory\n ]);\n }\n\n // Set permissions (must be manually set to fix umask issues)\n chmod($directory, 02777);\n }\n\n // Add the month to the directory\n $directory .= DIRECTORY_SEPARATOR.date('m');\n\n if ( ! is_dir($directory))\n {\n // Create the monthly directory\n if ( ! mkdir($directory, 02777) && ! is_dir($directory))\n {\n throw new Exception('Directory \":dir\" was not created', [\n ':dir' => $directory\n ]);\n }\n\n // Set permissions (must be manually set to fix umask issues)\n chmod($directory, 02777);\n }\n\n // Set the name of the log file\n $filename = $directory.DIRECTORY_SEPARATOR.date('d').'.log';\n\n if ( ! file_exists($filename))\n {\n // Create the log file\n file_put_contents($filename, null, LOCK_EX);\n\n // Allow anyone to write to log files\n chmod($filename, 0666);\n }\n\n file_put_contents($filename, $message . PHP_EOL, FILE_APPEND);\n }", "public function write($message){\r\n // if file pointer doesn't exist, then open log file \r\n // define script name\r\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\r\n // define current time\r\n $time = date('H:i:s');\r\n // write current time, script name and message to the log file\r\n fwrite($this->getFp(), \"$time ($script_name) \\n,$message\");\r\n }", "public static function write($type, $message) {\n\t\tif (empty(self::$_Collection)) {\n\t\t\tself::_init();\n\t\t}\n\t\tif (!defined('LOG_ERROR')) {\n\t\t\tdefine('LOG_ERROR', 2);\n\t\t}\n\t\tif (!defined('LOG_ERR')) {\n\t\t\tdefine('LOG_ERR', LOG_ERROR);\n\t\t}\n\t\t$levels = array(\n\t\t\tLOG_WARNING => 'warning',\n\t\t\tLOG_NOTICE => 'notice',\n\t\t\tLOG_INFO => 'info',\n\t\t\tLOG_DEBUG => 'debug',\n\t\t\tLOG_ERR => 'error',\n\t\t\tLOG_ERROR => 'error'\n\t\t);\n\n\t\tif (is_int($type) && isset($levels[$type])) {\n\t\t\t$type = $levels[$type];\n\t\t}\n\t\tif (empty(self::$_streams)) {\n\t\t\tself::_autoConfig();\n\t\t}\n\t\tforeach (self::$_Collection->enabled() as $streamName) {\n\t\t\t$logger = self::$_Collection->{$streamName};\n\t\t\t$logger->write($type, $message);\n\t\t}\n\t\treturn true;\n\t}", "static function write_to_log($message)\n {\n global $db;\n \n // don't log an empty message\n if ($message !== '') {\n // insert the message into the database\n $str = \"INSERT INTO `logs` (`uri`, `addr`, `entry`) \n VALUES ('%s','%s','%s')\";\n $sql = sprintf(\n $str, api::cleanse($_SERVER['REQUEST_URI']), \n api::cleanse($_SERVER['REMOTE_ADDR']), api::cleanse($message)\n );\n mysqli_query($db, $sql);\n }\n }", "public function writeLog($action, $message){\n $date = date('Y-m-d H:i:s');\n $ip = $_SERVER['REMOTE_ADDR'];\n $file = $_SERVER['DOCUMENT_ROOT'].'/log/general.log';\n $content = '['.$date.' IP: '.$ip.'] ACTION: '.$action.PHP_EOL.'MESSAGE: '.$message.PHP_EOL.PHP_EOL; \n file_put_contents($file, $content, FILE_APPEND | LOCK_EX);\n }", "protected function log($message){\n\t\tif(!is_string($message)){\n\t\t\t$message = var_export($message, true);\n\t\t}\n\t\tif(!empty($this->fp)){\n\t\t\tfwrite($this->fp, $message. \"\\n\");\n\t\t}else{\n\t\t\tif(!empty($GLOBALS['log'])){\n\t\t\t\t$GLOBALS['log']->debug($message . \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
View for all logs Route: /admin/logs/index
public function index(){ return view('admin.logs.index', [ 'logs' => Log::orderBy('id', 'desc')->get() ]); }
[ "public function actionIndex()\n {\n $searchModel = new AdminLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new LogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n $logs = Modules_Dotnetcore_Logs_Helper::getServiceLogEntries();\n $logsList = new Modules_Dotnetcore_Logs_List($this->view, $this->_request, $logs);\n\n $this->view->list = $logsList;\n $this->view->tabs = Modules_Dotnetcore_Common_TabsHelper::getDomainTabs('logs');\n $this->view->pageTitle = pm_Locale::lmsg('pageLogsTitle', [\n 'domain' => $this->domain->getName()\n ]);\n }", "public function adminlogs()\n {\n // Make sure the user can view this page\n if( !$this->check_permission('view_admin_logs')) return;\n\n // Build our page title / desc, then load the view\n $data = array(\n 'page_title' => \"View Admin Logs\",\n 'page_desc' => \"Here you can view what actions each member of your admin group have preformed.\",\n );\n $this->load->view('adminlogs', $data);\n }", "public function apilogs()\n {\n $logs = ApiLog::failled();\n return view('admin.logs.index', [\n 'logs' => $logs,\n ]);\n }", "public function index()\n\t{\n\t\t$access_logs = AccessLog::latest()->paginate(10);\n\t\treturn View::make('admin.accesslogs.index', compact('access_logs'));\n\t}", "public function indexAction()\n {\n $dm = $this->getDocumentManager();\n $feedlogs = $dm->getRepository('Api43FeedBundle:FeedLog')->findAllOrderedById(100);\n\n return $this->render('Api43FeedBundle:FeedLog:index.html.twig', [\n 'menu' => 'log',\n 'feedlogs' => $feedlogs,\n ]);\n }", "public function index() {\n\t\t$this->Paginator->settings = array(\n\t\t\t'paginated'\n\t\t);\n\t\t$this->_logs();\n\t}", "private function mapLogsRoutes(): void\n {\n $this->prefix('logs')->name('logs.')->group(function () {\n $this->get('/', [LaraLogViewerController::class, 'listLogs'])\n ->name('list'); // laravel-log-viewer::logs.list\n\n $this->delete('delete', [LaraLogViewerController::class, 'delete'])\n ->name('delete'); // laravel-log-viewer::logs.delete\n\n $this->prefix('{date}')->group(function () {\n $this->get('/', [LaraLogViewerController::class, 'show'])\n ->name('show'); // laravel-log-viewer::logs.show\n\n $this->get('download', [LaraLogViewerController::class, 'download'])\n ->name('download'); // laravel-log-viewer::logs.download\n\n $this->get('{level}', [LaraLogViewerController::class, 'showByLevel'])\n ->name('filter'); // laravel-log-viewer::logs.filter\n\n $this->get('{level}/search', [LaraLogViewerController::class, 'search'])\n ->name('search'); // laravel-log-viewer::logs.search\n });\n });\n }", "public function actionIndex() {\n $searchModel = new LogAbsensiSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render(\n 'index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]\n );\n }", "public function actionLogs()\n {\n $searchModel = new ActionLogSearch();\n $pid = Yii::$app->request->queryParams['pid'];\n \n $searchModel->loadUserid(\\Yii::$app->user->id);\n if(is_numeric($pid) && $pid >0){\n //查看项目日志\n $searchModel->loadUserid(null);\n if( !\\Yii::$app->user->can('actionlog_admin') ){ \n //非日志管理员 检查项目id,不属于自己的项目,只列出自己相关日志\n $fid = Procurement::findOne($pid)->userid;\n if($fid!=\\Yii::$app->user->id){\n Yii::$app->getSession()->setFlash('info', \"由于权限设置,只列出该项目与您相关的操作日志!\");\n $searchModel->loadUserid(\\Yii::$app->user->id);\n }\n }\n $searchModel->loadPID($pid);\n }\n if(\\Yii::$app->user->can('actionlog_admin')){\n $searchModel->loadUserid(null);\n }\n \n \n $dataProvider = $searchModel->search(Yii::$app->request->queryParams,true);\n \n return $this->render('logs', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function DisplayLogs($url)\r\n\t\t{\r\n\t\t\tglobal $object;\r\n\t\t\t\r\n\t\t\t//view insert logs for index files\r\n\t\t\tif (ereg('^(index){1}[a-z_]*', $url[action]))\r\n\t\t\t{\r\n\t\t\t\t//logs for the insert operation\r\n\t\t\t\t$parameters = array('num_rows');\r\n\t\t\t\t$logs = $this->GetModelObject('SystemLogs')->ListItemsPaged(array('table_name'=>$this->GetModelObject($url[controller])->table_name, 'row_id'=>0), 'sp_system_logs_list_paged',$parameters);\r\n\t\t\t\t$fields = array\r\n\t\t\t\t(\r\n\t\t\t\t\t'user_login'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_USER,\r\n\t\t\t\t\t\t'url'=>'users',\r\n\t\t\t\t\t\t'id'=>'user_id'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'action_name'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_ACTION,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t'column_name'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_COLUMN,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'value'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_VALUE,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'datetime'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_DATETIME,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t//logs for the delete operation\r\n\t\t\t\t$parameters = array('num_rows');\r\n\t\t\t\t$logs_delete = $this->GetModelObject('SystemLogs')->ListItemsPaged(array('table_name'=>$this->GetModelObject($url[controller])->table_name, 'action_name'=>'delete'), 'sp_system_logs_list_paged',$parameters);\r\n\t\t\t\t$fields_delete = array\r\n\t\t\t\t(\r\n\t\t\t\t\t'user_login'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_USER,\r\n\t\t\t\t\t\t'url'=>'users',\r\n\t\t\t\t\t\t'id'=>'user_id'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'row_id'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_RECORD_ID,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'action_name'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_ACTION,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'datetime'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_DATETIME,\r\n\t\t\t\t\t\t'url' => $url[controller],\r\n\t\t\t\t\t\t'id' => 'row_id'\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t//view update logs for edit/view files\r\n\t\t\telse if ((ereg('^(view){1}[a-z_]*', $url[action]))||(ereg('^(edit){1}[a-z_]*', $url[action])))\r\n\t\t\t{\r\n\t\t\t\t$parameters = array('num_rows');\r\n\t\t\t\t$logs = $this->GetModelObject('systemlogs')->ListItemsPaged(array('table_name'=>$this->GetModelObject($url[controller])->table_name, 'row_id'=>$url[parameters][0]), 'sp_system_logs_list_paged',$parameters);\r\n\t\t\t\t\r\n\t\t\t\t$fields = array\r\n\t\t\t\t(\r\n\t\t\t\t\t'user_login'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_USER,\r\n\t\t\t\t\t\t'url'=>'users',\r\n\t\t\t\t\t\t'id'=>'user_id'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'action_name'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_ACTION,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t'column_name'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_COLUMN,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'value_old'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_OLD_VALUE,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'value'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_VALUE,\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\r\n\t\t\t\t\t'datetime'=>array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'title'=>LANG_DATETIME,\r\n\t\t\t\t\t\t'url' => $url[controller],\r\n\t\t\t\t\t\t'id' => 'row_id'\r\n\t\t\t\t\t),\t\t\r\n\t\t\t\t);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($object->config->use_logging_commentation)\r\n\t\t\t{\r\n\t\t\t\t$fields[comment] = array\t\t\t\t\t\r\n\t\t\t\t(\r\n\t\t\t\t\t'title'=>LANG_COMMENT,\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$fields_delete[comment] = array\t\t\t\t\t\r\n\t\t\t\t(\r\n\t\t\t\t\t'title'=>LANG_COMMENT,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//logs for the deleted records\r\n\t\t\tif (!empty($logs_delete))\r\n\t\t\t{\r\n\t\t\t\techo \"<table width='100%' id='logs_table'><tr><td>\";\r\n\t\t\t\techo \"<hr style='margin-top: 5px;' />\";\r\n\t\t\t\t$this->helpers->htmlx->MenuText1(LANG_LOGS.': '.LANG_LIST.' ('.LANG_DELETED.')', \"list.gif\");\t\t\r\n\t\t\t\t$this->helpers->grids->GridLogs($logs_delete, $fields_delete);\r\n\t\t\t\techo \"</td></tr></table>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//logs for the inserted and updated records\r\n\t\t\tif (!empty($logs))\r\n\t\t\t{\r\n\t\t\t\techo \"<table width='100%' id='logs_table'><tr><td>\";\r\n\t\t\t\t$this->helpers->htmlx->MenuText1(LANG_LOGS.': '.LANG_LIST, \"list.gif\");\t\t\r\n\t\t\t\t$this->helpers->grids->GridLogs($logs, $fields);\r\n\t\t\t\techo \"</td></tr></table>\";\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t//if no logs found\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo \"<table width='100%' id='logs_table'><tr><td>\";\r\n\t\t\t\techo LANG_NO_LOGS;\r\n\t\t\t\techo \"</td></tr></table>\";\r\n\t\t\t}\r\n\t\t}", "public function actionIndex()\n {\n $searchModel = new AppLogdSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n if (Yii::$app->request->get('action') == 'clear')\n {\n $delete = AppLogd::deleteAll('timestamp < :param', [':param' => Yii::$app->request->get('timestamp')]);\n\n if ($delete)\n {\n Yii::$app->getSession()->setFlash('logd_index', [\n 'type' => 'success',\n 'duration' => 5000,\n 'title' => 'System Information',\n 'message' => 'Deleted Success !',\n ]\n );\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new LogExpSearchModel();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new AccessStatisticSiteLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->getRequest()->getQueryParams());\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function viewAllLogs()\n\t{\n\t\t$allLogs = array();\n\t\t\n\t\t$stmt=\"SELECT * FROM log ORDER BY log_id;\";\n\t\t$result=pg_query($stmt);\n\t\t\n\t\t//create an instance for every log entry and add it to the array\n\t\twhile($row=pg_fetch_assoc($result))\n\t\t\t$allLogs[] = new Log($row['log_id'], $row['log_date'], $row['log_time'], $row['type'], $row['whereabouts'], $row['username']);\n\t\t//return the array of all log entries\n\t\treturn $allLogs;\n\t}", "public function actionIndex()\n {\n $searchModel = new WebsightLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new LoginlogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n\t{\n\t\tif ( ! ee()->cp->allowed_group('can_access_logs'))\n\t\t{\n\t\t\tshow_error(lang('unauthorized_access'), 403);\n\t\t}\n\n\t\tee('CP/Alert')->makeDeprecationNotice()->now();\n\n\t\tif (ee()->input->post('delete'))\n\t\t{\n\t\t\t$this->delete('EmailConsoleCache', lang('email_log'));\n\t\t\tif (strtolower(ee()->input->post('delete')) == 'all')\n\t\t\t{\n\t\t\t\treturn ee()->functions->redirect(ee('CP/URL')->make('logs/email'));\n\t\t\t}\n\t\t}\n\n\t\t$this->base_url->path = 'logs/email';\n\t\tee()->view->cp_page_title = lang('view_email_logs');\n\n\t\t$logs = ee('Model')->get('EmailConsoleCache');\n\n\t\tif ($search = ee()->input->get_post('filter_by_keyword'))\n\t\t{\n\t\t\t$logs->search(['member_name', 'ip_address', 'recipient', 'recipient_name', 'subject', 'message'], $search);\n\t\t}\n\n\t\t$filters = ee('CP/Filter')\n\t\t\t->add('Username')\n\t\t\t->add('Date')\n\t\t\t->add('Keyword')\n\t\t\t->add('Perpage', $logs->count(), 'all_email_logs');\n\t\tee()->view->filters = $filters->render($this->base_url);\n\t\t$this->params = $filters->values();\n\t\t$this->base_url->addQueryStringVariables($this->params);\n\n\t\t$page = ((int) ee()->input->get('page')) ?: 1;\n\t\t$offset = ($page - 1) * $this->params['perpage']; // Offset is 0 indexed\n\n\t\tif ( ! empty($this->params['filter_by_username']))\n\t\t{\n\t\t\t$logs = $logs->filter('member_id', 'IN', $this->params['filter_by_username']);\n\t\t}\n\n\t\tif ( ! empty($this->params['filter_by_date']))\n\t\t{\n\t\t\tif (is_array($this->params['filter_by_date']))\n\t\t\t{\n\t\t\t\t$logs = $logs->filter('cache_date', '>=', $this->params['filter_by_date'][0]);\n\t\t\t\t$logs = $logs->filter('cache_date', '<', $this->params['filter_by_date'][1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$logs = $logs->filter('cache_date', '>=', ee()->localize->now - $this->params['filter_by_date']);\n\t\t\t}\n\t\t}\n\n\t\t$count = $logs->count();\n\n\t\t// Set the page heading\n\t\tif ( ! empty($search))\n\t\t{\n\t\t\tee()->view->cp_heading = sprintf(\n\t\t\t\tlang('search_results_heading'),\n\t\t\t\t$count,\n\t\t\t\tee('Format')->make('Text', $search)->convertToEntities()\n\t\t\t);\n\t\t}\n\n\t\tee()->view->header = array(\n\t\t\t'title' => lang('system_logs'),\n\t\t\t'form_url' => $this->base_url->compile(),\n\t\t\t'search_button_value' => lang('search_logs_button')\n\t\t);\n\n\t\t$logs = $logs->order('cache_date', 'desc')\n\t\t\t->limit($this->params['perpage'])\n\t\t\t->offset($offset)\n\t\t\t->all();\n\n\t\t$pagination = ee('CP/Pagination', $count)\n\t\t\t->perPage($this->params['perpage'])\n\t\t\t->currentPage($page)\n\t\t\t->render($this->base_url);\n\n\t\t$vars = array(\n\t\t\t'logs' => $logs,\n\t\t\t'pagination' => $pagination,\n\t\t\t'form_url' => $this->base_url->compile(),\n\t\t);\n\n\t\tee()->cp->render('logs/email/list', $vars);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the first business time after the start of this day.
public function startOfBusinessDay(): self { // Iterate from the beginning of the day until we hit business time. $start = $this->copy()->startOfDay(); $limit = new LimitedIterator($this->iterationLimit); while (!$start->isBusinessTime()) { $start = $start->add($this->precision()); $limit->next(); } return $start; }
[ "public function endOfBusinessDay(): self\n {\n // Iterate back from the end of the day until we hit business time.\n $end = $this->copy()->endOfDay();\n\n $limit = new LimitedIterator($this->iterationLimit);\n while (!$end->isBusinessTime()) {\n $end = $end->sub($this->precision());\n\n $limit->next();\n }\n\n // Add a second because we've iterated from 23:59:59.\n return $end->addSecond();\n }", "public static function getLastBusinessDay($time = null)\n {\n $time = self::getTime($time);\n\n $time = self::getEndOfMonth($time);\n\n if (self::isBusinessDay($time))\n {\n return $time;\n }\n\n return self::getPrevBusinessDay($time);\n }", "public function currentOrNextBusinessDay()\n {\n $day = $this->copy()->subDay();\n\n for ($i=0; $i < 14 ; $i++) {\n if($this->isStandardBusinessDays()) {\n if($day->addDay()->isBusinessDay() && !$day->isBankHoliday()) {\n break;\n }\n } else {\n if($day->addDay()->isBusinessDay()) {\n break;\n }\n }\n }\n\n return $day;\n }", "public function endOfWeek()\n\t{\n\t\treturn Carbon::parse('next monday');\n\t}", "public function previousBusinessDay()\n {\n /**\n * Sets the date to the previous business day (neither a weekend day nor a holiday).\n *\n * @return \\Carbon\\CarbonInterface|\\Carbon\\Carbon|\\Carbon\\CarbonImmutable\n */\n return $this->nextBusinessDay('subDay');\n }", "function get_first_day(): DateTime {\r\n // Must clone, otherwise the add will affect the first day\r\n $final_issue_first_dt = clone parent::get_first_day();\r\n\r\n // Move up 7 days\r\n $final_issue_first_dt->add(new DateInterval('P7D'));\r\n return $final_issue_first_dt;\r\n }", "function nextWorkTime() {\n $work = Date::load($this);\n if ($work->hour < 9) {\n $work->seconds = 9*3600;\n }else if ($work->seconds > 16*3600) {\n $work->seconds = 9*3600;\n $work->day++;\n }\n while (!$work->isWorkTime()) {\n $work->seconds = 9*3600;\n $work->day++;\n }\n return $work;\n }", "private function getDayFirst()\n {\n $first_day_in_month_ts = strtotime(\"{$this->year}-{$this->month}-01 00:00:00\");\n $day_in_the_week = date(\"N\", $first_day_in_month_ts);\n return date(\"Y-m-d H:i:s\", $first_day_in_month_ts - ($day_in_the_week - 1) * $this->day_shift);\n }", "public function subBusinessDay()\n {\n /**\n * Subtract one business day to the current date.\n *\n * @return \\Carbon\\Carbon|\\Carbon\\CarbonImmutable|\\Carbon\\CarbonInterface\n */\n return $this->subBusinessDays();\n }", "public function testAlwaysEndsOnBusinessDay()\n {\n // Given we have a business time for Friday;\n $businessTime = new BusinessTime('Friday');\n\n // When we add one business day to it;\n $addDay = $businessTime->addBusinessDay();\n\n // Then it should be Monday.\n self::assertEquals('Monday', $addDay->format('l'));\n }", "protected function calculateNextSchedule()\n {\n $now = $this->now();\n $nowTs = $now->getTimestamp();\n\n $interval = new \\DateInterval(\"PT{$this->getInterval()}H\");\n\n $startTime = $this->getStartTime($nowTs);\n $startTs = $startTime->getTimestamp();\n\n $endTime = $this->now();\n $endTime->setTimestamp($nowTs);\n $endTime->setTime($this->getEndHour(), $this->getEndMinute());\n $endTs = $endTime->getTimestamp();\n\n if ($nowTs <= $startTs) {\n return $startTime;\n }\n\n if ($nowTs === $endTs) {\n return $endTime;\n }\n\n while ($nowTs > $startTs) {\n if ($nowTs > $endTs || $startTs > $endTs) {\n // start from next start time of next day\n return $this->getStartTime($nowTs)->add(new \\DateInterval('P1D'));\n }\n\n $startTime->add($interval);\n $startTs = $startTime->getTimestamp();\n }\n\n if ($startTs > $endTs) {\n // start from next start time of next day\n return $this->getStartTime($nowTs)->add(new \\DateInterval('P1D'));\n }\n\n return $startTime;\n }", "public function getBusinessCollectedThisWeek()\n\t{\n\t\t$domain_name = $this->_domain_name;\n\n\t\t$first_day_of_week = DateUtils::getFirstDayOfWeek();\n\t\t$first_day_of_week = $first_day_of_week->format('c');\n\n\t\t$last_day_of_week = DateUtils::getLastDayOfWeek();\n\t\t$last_day_of_week = $last_day_of_week->format('c');\n\n\t\t$pincode = $this->_pincode;\n\n\t\t$query = \"SELECT business_name,address_line_1,address_line_2, \".\n\t\t\t\t\t\t\t \"latitude,longitude,status \".\n\t\t\t\t\t\t\t \"FROM $domain_name \".\n\t\t\t\t\t\t\t \"WHERE pincode='$pincode' \".\n\t\t\t\t\t\t\t \"AND created_time >= '$first_day_of_week' \".\n\t\t\t\t\t\t\t \"AND created_time <= '$last_day_of_week' \";\n\t\t$result\t = $this->query($query);\n\n\t\treturn $result;\n\t}", "public function getNextScheduleTime()\n {\n return $this->next_schedule_time;\n }", "private function getFirstDayOffset()\n {\n $date = getdate(mktime(12, 0, 0, $this->month, 1, $this->year));\n\n $first = $date[\"wday\"];\n $d = $this->startDay + 1 - $first;\n while ($d > 1) {\n $d -= 7;\n }\n return $d; \n }", "public function getBooTimeStartAttribute()\n\t{\n\t\treturn Carbon::createFromTimestamp($this->attributes['boo_time_start'], $this->getAppTimeZone());\n\t}", "function getFirstDay(){\n\t$previous_week = strtotime(\"-1 week +1 day\");\n\n\t$start_week = strtotime(\"last sunday midnight\",$previous_week);\n\t$end_week = strtotime(\"next saturday\",$start_week);\n\n\t$start_week = date(\"Y-m-d\",$start_week);\n\t$end_week = date(\"Y-m-d\",$end_week);\n\n\treturn $start_week;\n}", "protected function getEndOfBusinessDay($date)\n {\n $endOfDay = new DateTime($date->format(\"Ymd\"));\n $endOfDay->setTime(\n $this->endOfBusiness['hour'],\n $this->endOfBusiness['minute'],\n $this->endOfBusiness['second']\n );\n return $endOfDay;\n }", "public static function getTimeWeekStart()\n\t{\n\t\treturn strtotime('previous monday', time()+self::ONE_DAY);\n\t}", "public function getFirstTime() {\n return $this->get(self::FIRST_TIME);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the onkeypress attribute value. Parent tags allowed: all
public function set_onkeypress($value) { return $this->set_attr('onkeypress', $value); }
[ "public function setOnkeypress($onkeypress) {\r\n $this->onkeypress = $onkeypress;\r\n $this->handleAttribute(\"onkeypress\", $onkeypress);\r\n }", "public function get_onkeypress()\r\n\t{\r\n\t\treturn $this->get_attr('onkeypress');\r\n\t}", "function ming_keypress ($char) {}", "public function _keypress($element='this', $js='') {\n\t\treturn $this->_add_event($element, $js, 'keypress');\n\t}", "function ming_keypress($char)\n{\n}", "public function onKeypress($key_code)\n /**/\n {\n $this->propagateEvent('keypress', array($key_code));\n }", "function keyPressed(KeyEvent $event);", "public function getOnkeypress() {\n if (null != $this->onkeypress) {\n return $this->onkeypress;\n }\n $_ve = $this->getValueExpression(\"onkeypress\");\n if ($_ve != null) {\n return $_ve->getValue($this->getFacesContext()->getELContext());\n } else {\n return null;\n }\n }", "public function keyboardListener($eventHandler) {\n\n stream_set_blocking(STDIN, false);\n\n // This is the magic that means we won't have to return after each\n // character input\n readline_callback_handler_install('', function() { });\n\n while(true) {\n\n $read = array(STDIN);\n $write = NULL;\n $except = NULL;\n $tv_sec = NULL;\n\n $stream = stream_select($read, $write, $except, $tv_sec);\n if($stream && in_array(STDIN, $read)) {\n\n // Get the input from stream\n $input = stream_get_contents(STDIN, 32);\n\n $keycode = '';\n $key = '';\n\n // Translate the input into a key\n switch(true) {\n case $input === \"\\e[A\":\n // Arrow up escape sequence\n $key = \"arrow_up\";\n $keycode = 38;\n break;\n\n case $input === \"\\e[B\":\n // Arrow down escape sequence\n $key = \"arrow_down\";\n $keycode = 40;\n break;\n\n case $input === \"\\e[D\":\n // Arrow left escape sequence\n $key = \"arrow_left\";\n $keycode = 37;\n break;\n\n case $input === \"\\e[C\":\n // Arrow right escape sequence\n $key = \"arrow_right\";\n $keycode = 39;\n break;\n\n case ord($input) === 127:\n // Backspace\n $key = \"backspace\";\n $keycode = 8;\n break;\n\n case ord($input) === 8:\n // Backspace\n $key = \"delete\";\n $keycode = 46;\n break;\n\n case $input === \"\\e\":\n // Escape\n $key = \"escape\";\n $keycode = 27;\n break;\n\n case $input === \"\\t\":\n // Tab\n $key = \"tab\";\n $keycode = 9;\n break;\n\n case $input === \"\\n\" || $input === \"\\r\" || $input === \"\\r\\r\":\n // Newline\n $key = \"enter\";\n $keycode = 13;\n break;\n\n case preg_match(\"/[a-zA-Z]{1}/\", $input):\n // If it's a letter then it's a letter, duh!\n $key = strtolower($input);\n $keycode = ord(strtolower($input)) - 32;\n break;\n\n case preg_match(\"/[0-9]{1}/\", $input):\n // If it's a number\n $key = (int) $input;\n $keycode = ord($input);\n break;\n\n default:\n throw new Exception(\"Key not supported for {$input}\");\n break;\n }\n\n if(is_callable($eventHandler)) {\n \n // Call the event handler with the key and keycode\n $response = $eventHandler($key, $keycode);\n\n if($response) {\n break;\n }\n } else {\n\n throw new Exception(\"First argument must be a function\");\n }\n\n }\n }\n }", "function HandleReturn(wxKeyEvent &$event){}", "public function set_onkeydown($value)\r\n\t{\r\n\t\treturn $this->set_attr('onkeydown', $value);\r\n\t}", "public function set_accesskey($value)\r\n\t{\r\n\t\treturn $this->set_attr('accesskey', $value);\r\n\t}", "public function keypressHandler(KeyPressEvent $event) {\n if ($event->description === \"{$this->keyModifier}{$this->shortcutKey}\") {\n $this->onMouseDown(null);\n time_nanosleep(0, 330000000);\n $this->onMouseUp(null);\n\n $event->sender = $this;\n $this->onClick($event);\n $event->handled = true;\n }\n }", "public function setAccesskey($accesskey) {\r\n $this->accesskey = $accesskey;\r\n $this->handleAttribute(\"accesskey\", $accesskey);\r\n }", "public function keyDown(string $xpath, $char, ?string $modifier = null);", "public function controlKeyUp()\r\n {\r\n $this->doCommand(\"controlKeyUp\", array());\r\n }", "public static function keypress($keycode){\n $user = Security::getLoggedInUser();\n if (empty($user))\n $avatarid = 1;\n else\n $avatarid = $user->getAvatar();\n\t\tif (!$result = Database::resultToArray(Database::getDb('keypress')->insert(array(\n\t\t\t'instance' => $avatarid,\n\t\t\t'keycode' => $keycode)))) {\n\t\t\tdie(base64_decode('ZmluZCBtZSEgOkQ='));\n\t\t}\n\t}", "public function set_enterkeyhint($value)\r\n\t{\r\n\t\treturn $this->set_attr('enterkeyhint', $value);\r\n\t}", "public function setOnkeydown($onkeydown) {\r\n $this->onkeydown = $onkeydown;\r\n $this->handleAttribute(\"onkeydown\", $onkeydown);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$strDate date in "Ymd" formate return First day Date of weak
function CalculateFirstDateOfWeak($strDate ) { $arr = explode("-", $strDate); $strDate = date("m/d/Y", mktime(0, 0, 0, $arr[1], $arr[2], $arr[0])); $Query = "SELECT (datepart(dd, '$strDate') - datepart(dw, '$strDate')+ 1) as dy"; $nResult = MsSQLQuery($Query); $rstRow2 = odbc_fetch_array($nResult); $strDate = $arr[1] ."/" . $rstRow2['dy'] . "/" . $arr[0]; return $strDate; }
[ "public static function getFirstDateFromStr($str)\n { \n $date = strtotime($str);\n if (!$date) return false;\n $date = date(\"Y-m\", $date);\n $date_y_m = date(\"Y-m\", strtotime(\"first monday \".$date));\n $date_j = date(\"j\", strtotime(\"first monday \".$date));\n if ($date_j>7) $date_j = (int)$date_j % 7; \n $date = $date_y_m . \"-\" . $date_j;\n return $date;\n }", "private function getFirstDate()\n {\n $days = $this->getUniqueDays()->{0}->date;\n\n return $days;\n }", "function getBonusDate( $strDate ) {\n\n if( date('l', strtotime($strDate)) == 'Sunday' || date('l', strtotime($strDate)) == 'Saturday') {\n\n // Create a new DateTime object\n $date = new DateTime($strDate);\n \n // Modify the date it contains\n $date->modify('next wednesday');\n \n // Output\n return $date->format('Y-m-d');\n \n } else {\n return $strDate;\n }\n \n }", "function findNextDate($date) {\n // check date string is right length\n if (strlen($date) == 8) {\n // first 4 digits -> year\n $year = substr($date, 0, 4);\n $month = substr($date, 4, 2);\n $day = substr($date, 6, 2);\n }\n else {\n return \"Error: string of wrong length\";\n }\n $maxdays = findMaxDays($month,$year);\n if ($day < $maxdays) {\n $day += 1;\n } //if\n else\n {\n if ($month < 12) {\n $day = 1;\n $month += 1;\n } // if\n else {\n $day = 1;\n $month = 1;\n $year += 1;\n } // else\n } // else\n // return in format YYYYMMDD\n // if single digit, puts 0 in front of it\n // e.g. 9 -> 09\n if (strlen($month) == 1)\n $month = \"0\".$month;\n if (strlen($day) == 1)\n $day = \"0\".$day;\n return $year.$month.$day;\n }", "function getFirstWikiRevisionDate(){\n\n\t$dbr = wfGetDB( DB_SLAVE );\n\n\t$revTable = $dbr->tableName( 'revision' );\n\n\t$sql = \"SELECT\n\t\t\tDATE(rev_timestamp) AS day\n\t\tFROM $revTable\n\t\tORDER BY rev_timestamp ASC\n\t\tLIMIT 1\";\n\n\t$res = $dbr->query( $sql );\n $row = $dbr->fetchRow( $res );\n $firstContributionDateTime = $row['day']; // in format YYYYMMDDHHMMSS\n\n $firstContributionDate = date('Ymd', strtotime( $firstContributionDateTime ) );\n\n\treturn $firstContributionDate;\n\n\t}", "private function getDayFirst()\n {\n $first_day_in_month_ts = strtotime(\"{$this->year}-{$this->month}-01 00:00:00\");\n $day_in_the_week = date(\"N\", $first_day_in_month_ts);\n return date(\"Y-m-d H:i:s\", $first_day_in_month_ts - ($day_in_the_week - 1) * $this->day_shift);\n }", "public static function sqlDate2SimpleDate($str) {\n $result = static::sqlTimestamp2BrFormat($str);\n\n return substr($result, 0, 10);\n }", "private function getFirstDeliveryDate()\n {\n $today = new \\DateTime(date('Y-m-d'));\n $firstDeliveryDate = $this->delivery_startdate->modify('this ' . $this->delivery_weekday); // Make sure it's the correct weekday\n\n // If first date is in the future just return it.\n if ($today <= $firstDeliveryDate) {\n return $firstDeliveryDate;\n }\n\n // If the first date is in the past, calculate the closest date based on the first date and the delivery interval\n while ($today >= $firstDeliveryDate) {\n if ($this->delivery_interval === '+1 month') {\n $deliveryInterval = $this->getDeliveryIntervalFormat() . 'next month';\n } else {\n $deliveryInterval = $this->getDeliveryIntervalFormat() . ' ' . $firstDeliveryDate->format('Y-m-d');\n }\n\n $firstDeliveryDate->modify($deliveryInterval);\n }\n\n return $firstDeliveryDate;\n }", "function _ConvertDate($strDate)\n\t{\n\t\t$strReturn = substr($strDate, 0, 4).\"-\".substr($strDate, 3, 2).\"-\".substr($strDate, 5, 2);\n\t\treturn $strReturn;\n\t}", "function getStartDate()\n {\n $yyyymmdd = parent::get('templestart');\n if (strlen($yyyymmdd) == 8)\n return new LegacyDate(' ' . substr($yyyymmdd, 0, 4) .\n '/' . substr($yyyymmdd, 4, 2) .\n '/' . substr($yyyymmdd, 6, 2));\n else\n return new LegacyDate('');\n }", "public function GetFirstDate( ) {\n\n $dt = new cDate( $this->m_dates[0]);\n\n for ($i=0;$i<$this->m_count; $i++){\n if ($this->m_dates[$i]->lt($dt)) { $dt = new cDate($this->m_dates·[$i]); }\n }\n\n return $dt;\n\n }", "public static function determineFirstDay($currentDate)\r\n {\r\n $referenceDate = new DateTime(REFERENCE_DATE);\r\n $dayOne = new DateTime($currentDate->format('Y-m-d'));\r\n $dayOne->setTime(8, 00, 00);\r\n\r\n $interval = intval(($dayOne->diff($referenceDate, TRUE)->format('%R%a')));\r\n\r\n $i = 0;\r\n while (($interval % 14) != 0) // First day of the pay period prior to the user selected first day.\r\n {\r\n $dayOne->modify(\"-1 day\");\r\n $interval = intval(($dayOne->diff($referenceDate, TRUE)->format('%R%a')));\r\n $i++;\r\n if ($i > 20)\r\n {\r\n Messages::setMsg('There was a problem finding the first day of the pay period', 'error');\r\n echo \"<META http-equiv='refresh' content='0;URL=\" . ROOT_URL . \"employees'>\";\r\n die();\r\n }\r\n }\r\n return ($dayOne);\r\n }", "Function gettingDate($_tempStr){\t\r\n\t//Getting Day\t\t\r\n\t$pos1 = strrpos($_tempStr, \"/\", 1);\r\n\t$dayStr = Trim(substr($_tempStr, 0, $pos1 ));\r\n\t\r\n\t//Getting Month\r\n\t$pos2 = strrpos($_tempStr, \" \", $pos1 + 1);\t\t\r\n\t$monthStr = Trim(substr($_tempStr, $pos1 + 1, $pos2 - $pos1));\r\n\t\t \r\n\t//Getting Year\r\n\t$yearStr = \"2016\";\r\n\t\r\n\t$result = $monthStr . \"/\" . $dayStr . \"/\" . $yearStr;\r\n\t\r\n\t//Returning the Final Date\r\n\treturn ($result);\r\n\t\r\n}", "function str_to_date($str){\n return substr($str, 8, 2).'.'.substr($str, 5, 2).'.'.substr($str, 0, 4);\n}", "public function convertDateToYmd($dateString)\n {\n return date('Y-m-d', strtotime($dateString));\n }", "function day_forward($str_date, $days)\n{\n\t$i = 0;\n\t$j = 0;\n\t$checkDay = '';\n\t$subString = $str_date;\n\t\n\twhile($i < 40)\n\t{\n\t\t$subString = $subString+(60*60*24*1);\n\t\t\t$j++;\n\t\t\t$checkDay =date(\"Y-m-d\", $subString);\n\t\tif($j == $days)\n\t\tbreak;\n\t}\n\treturn $checkDay;\n}", "function getExpensesDate($date)\r\n\t{\r\n\t\t$expenses_day_of_week = date(\"l\", strtotime($date));\r\n\t\tif (substr($expenses_day_of_week, 0,1) == \"S\")\r\n\t\t{\r\n\t\t\treturn date(\"Y-m-d\", strtotime(\"next monday \". $date));\r\n\t\t}\r\n\t\treturn $date;\r\n\t}", "function FirstOfYear($dtDate)\n{\n return(new DateTime($dtDate->format(\"1/1/Y\")));\n}", "function getMonthFirstDay(){ return new Date(Dates::GetFirstDateByDate($this->getDate())); }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert Doctrine\ODM Document to Array
public function toArray() { $document = $this->toStdClass(); return get_object_vars($document); }
[ "function toArray() {\n $document = $this->toStdClass();\n return get_object_vars($document);\n }", "public function mongoToEntity(BSONDocument $data): array\n {\n $data = $this->makeEntityId($data);\n\n return $this->makeEntityArray($data);\n }", "function mongo_to_array($mongo_obj) {\n if ($mongo_obj instanceof MongoDB\\Driver\\Cursor) {\n $array = [];\n foreach ($mongo_obj as $item) {\n $array[] = $item;\n }\n } else {\n $array = (array) $mongo_obj;\n }\n\n\n foreach ($array as $key => $value) {\n if ($value instanceof MongoDB\\Model\\BSONArray || $value instanceof MongoDB\\Model\\BSONDocument) {\n $array[$key] = mongo_to_array($value);\n }\n }\n return $array;\n}", "public function toOdmQuery()\n {\n $out = array();\n foreach (get_object_vars($this) as $k => $v) {\n if (!empty($v)) {\n $out[$k] = $v;\n }\n }\n return (array)$out;\n }", "private function getDocArray($document)\n {\n if(!is_a($document, $this->className))\n throw new \\LogicException('Document should be of type ' . $this->className . ', got ' . get_class($document));\n return $document->toDocument();\n }", "public function hydrate(Document $document): iterable;", "public function toArray() {\r\n return $this->_orm->getData()->toArray();\r\n }", "public function toArray()\n {\n $array = [];\n foreach ($this as $record) {\n if (\n !$record instanceof Carerix_Api_Rest_Entity &&\n !$record instanceof Carerix_Api_Rest_Collection\n ) {\n continue;\n }\n $array[] = $record->toArray();\n }\n return $array;\n }", "public function getDocumentProducts(): array\r\n {\r\n return $this->document['products'] ?? [];\r\n }", "public function getObjectToDocumentTransformer();", "public function convertDocumentToAttributes(stdClass $document, array $options) {\r\n return (array)$document;\r\n }", "final public function bsonSerialize(): array|object {}", "public function toArray() {}", "public function getChildDocuments(): array {}", "public function getAllArray()\n\t\t{\n\t\t\t$query = $this->getEntityManager()\n\t\t\t->createQuery(\"SELECT o FROM {$this->getEntityName()} o\");\n\t\t\t\n\t\t\t$data = $query->getResult(Query::HYDRATE_SCALAR);\n\t\t\n\t\t\treturn $data;\n\t\t}", "public function getAsArray() {\n $treeObject = $this->getTree();\n $treeObject->setBaseQuery($this->getBaseQuery());\n $result = array();\n $root = $treeObject->fetchTree();\n if ($root) {\n $result = $root;\n }\n return $result;\n }", "abstract protected function convertDocument(array $raw);", "public static abstract function mapToEntity(BSONDocument $document);", "public function toArray(){\r\n //Create an annotation reader so we can read annotations\r\n $reader = new \\Doctrine\\Common\\Annotations\\AnnotationReader();\r\n \r\n //Create a reflection class and retrieve the properties\r\n $reflClass = new \\ReflectionClass($this);\r\n $properties = $reflClass->getProperties();\r\n \r\n //Create an array in which to store the data\r\n $array = array();\r\n \r\n //Loop through each property. Get the annotations for each property\r\n //and add to the array to return, ONLY if it contains an ORM\\Column\r\n //annotation.\r\n foreach($properties as $property){\r\n $annotations = $reader->getPropertyAnnotations($property);\r\n foreach($annotations as $annotation){\r\n if($annotation instanceof \\Doctrine\\ORM\\Mapping\\Column){\r\n $array[$property->name] = $this->{$property->name};\r\n }\r\n }\r\n }\r\n \r\n //Finally, return the data array to the user\r\n return $array;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method used to remove all checkins associated with a list of issues.
function removeByIssues($ids) { $items = implode(", ", Misc::escapeInteger($ids)); $stmt = "DELETE FROM " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_checkin WHERE isc_iss_id IN ($items)"; $res = DB_Helper::getInstance()->query($stmt); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return false; } return true; }
[ "public function clearNarrationIssues()\n {\n $this->collNarrationIssues = null; // important to set this to NULL since that means it is uninitialized\n }", "public function clearCheckinss()\n\t{\n\t\t$this->collCheckinss = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function removeByIssues($ids)\n {\n $items = implode(\", \", Misc::escapeInteger($ids));\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_requirement\n WHERE\n isr_iss_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n } else {\n return true;\n }\n }", "public function cleanupAll(array $authorizationChallenges);", "public static function reload_issues() {\n\t\t// Remove issue and issue counts.\n\t\tself::remove();\n\t}", "public function reset(): void\n {\n $this->issues = [];\n }", "private function deleteRemovedRuleSets(){\n \n global $DB;\n \n // Delete any rule sets not submitted this time\n $oldRuleSetIDs = array();\n $currentRuleSetIDs = array();\n \n $oldRuleSets = $DB->get_records(\"bcgt_qual_structure_rule_set\", array(\"qualstructureid\" => $this->id));\n if ($oldRuleSets)\n {\n foreach($oldRuleSets as $oldRuleSet)\n {\n $oldRuleSetIDs[] = $oldRuleSet->id;\n }\n }\n \n // Now loop through rule sets on this object\n if ($this->ruleSets)\n {\n foreach($this->ruleSets as $ruleSet)\n {\n $currentRuleSetIDs[] = $ruleSet->getID();\n }\n }\n \n // Now remove the ones not present on the object \n $removeIDs = array_diff($oldRuleSetIDs, $currentRuleSetIDs);\n if ($removeIDs)\n {\n foreach($removeIDs as $removeID)\n {\n $DB->delete_records(\"bcgt_qual_structure_rule_set\", array(\"id\" => $removeID));\n }\n }\n \n \n // Now loop through the Rule Sets and remove any Rules that were not submitted this time\n if ($this->ruleSets)\n {\n foreach($this->ruleSets as $ruleSet)\n {\n $ruleSet->deleteRemovedRules();\n }\n }\n \n \n }", "public function clearCheckInformations()\n\t{\n\t\t$this->collCheckInformations = null; // important to set this to NULL since that means it is uninitialized\n\t}", "protected function pruneAll() {\n\t\t$this->nodeDataRepository->removeAll();\n\t\t$this->workspaceRepository->removeAll();\n\t\t$this->domainRepository->removeAll();\n\t\t$this->siteRepository->removeAll();\n\t}", "public function removeSets();", "public function clearRtfIssues()\n {\n $this->collRtfIssues = null; // important to set this to NULL since that means it is uninitialized\n }", "final public function ClearChanges() {\n foreach($this->Repositories as $Repository) {\n $Repository->ClearChanges();\n }\n }", "public function removeIssuesForFiles(array $files): void\n {\n return; // Never going to be called - daemon mode isn't combined with parallel execution.\n }", "public function clearAll()\n {\n foreach ($this->managers as $manager) {\n $manager->clear();\n }\n }", "public function removeIssuesForFiles(array $files) : void\n {\n $file_set = \\array_flip($files);\n foreach ($this->issues as $key => $issue) {\n if (\\array_key_exists($issue->getFile(), $file_set)) {\n unset($this->issues[$key]);\n }\n }\n }", "public function removeAll() {\n\t\tforeach ($this->findAll() AS $object) {\n\t\t\t$this->remove($object);\n\t\t}\n\t}", "public function remove_all(): void\n {\n }", "public function deleteNewIssues($types = null) {\n\t\t$this->i->deleteNew($types);\n\t}", "private static function remove_issue_counts() {\n\t\t// Remove the options which are holding the counts.\n\t\tdelete_option( WPSEO_GSC_Count::OPTION_CI_COUNTS );\n\t\tdelete_option( WPSEO_GSC_Count::OPTION_CI_LAST_FETCH );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete the permissions of the repository
public function deletePermissions($repository) { $group_id = $repository->getProjectId(); $object_id = $repository->getId(); return permission_clear_all($group_id, Git::PERM_READ, $object_id) && permission_clear_all($group_id, Git::PERM_WRITE, $object_id) && permission_clear_all($group_id, Git::PERM_WPLUS, $object_id); }
[ "private function deletePermissions()\n {\n $databasePermissions = Permission::all()->pluck('name');\n\n $modules = \\Module::toCollection();\n\n $permissionCollection = [];\n\n foreach ($modules as $module) {\n $permissions = config($module->getLowerName() . '.permissions');\n if ($permissions != null) {\n foreach ($permissions as $permissionName) {\n $permissionCollection[] = $permissionName;\n }\n }\n }\n\n $dif = array_diff($databasePermissions->toArray(), $permissionCollection);\n\n foreach ($dif as $perm) {\n $perm = Permission::findByName($perm);\n $this->permissionDeleted[] = $perm;\n $perm->delete();\n }\n }", "public function removeAllPermissions()\n {\n }", "public function revokeAllPermissions();", "public function removePermissions(...$permissions);", "function delete() {\n if (!$this->active_repository->canEdit($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n $delete = $this->active_repository->delete(true);\n \n CommitProjectObjects::delete(\"repository_id = '\".$this->active_repository->getId().\"'\");\n SourceUsers::delete(\"repository_id = '\".$this->active_repository->getId().\"'\");\n \n if ($delete && !is_error($delete)) {\n flash_success('Repository has been successfully deleted');\n $this->redirectToUrl(source_module_url($this->active_project));\n } else {\n $this->smarty->assign('errors', $delete);\n } // if\n }", "function delete_permissions () {\n\t\t$file_name = 'config.php';\n\t\t$file_content = file_get_contents($file_name);\n\t\t$hook = '\t\\''.$this->name['class'].'\\' => [\\'create\\', \\'read\\', \\'update\\', \\'delete\\'],'.PHP_EOL;\n\n\t\tfile_put_contents($file_name, str_replace($hook, '', $file_content));\n\t}", "public function removeAllPermissions()\n {\n // TODO: Implement removeAllPermissions() method.\n }", "function versioncontrol_delete_repository($repository) {\n // Delete operations.\n $operations = versioncontrol_get_operations(array('repo_ids' => array($repository['repo_id'])));\n foreach ($operations as $operation) {\n versioncontrol_delete_operation($operation);\n }\n unset($operations); // conserve memory, this might get quite large\n\n // Delete labels.\n db_query('DELETE FROM {versioncontrol_labels}\n WHERE repo_id = %d', $repository['repo_id']);\n\n // Delete item revisions and related source item entries.\n $result = db_query('SELECT item_revision_id\n FROM {versioncontrol_item_revisions}\n WHERE repo_id = %d', $repository['repo_id']);\n $item_ids = array();\n $placeholders = array();\n\n while ($item_revision = db_fetch_object($result)) {\n $item_ids[] = $item_revision->item_revision_id;\n $placeholders[] = '%d';\n }\n if (!empty($item_ids)) {\n $placeholders = '('. implode(',', $placeholders) .')';\n\n db_query('DELETE FROM {versioncontrol_source_items}\n WHERE item_revision_id IN '. $placeholders, $item_ids);\n db_query('DELETE FROM {versioncontrol_source_items}\n WHERE source_item_revision_id IN '. $placeholders, $item_ids);\n db_query('DELETE FROM {versioncontrol_item_revisions}\n WHERE repo_id = %d', $repository['repo_id']);\n }\n unset($item_ids); // conserve memory, this might get quite large\n unset($placeholders); // ...likewise\n\n // Delete accounts.\n $accounts = versioncontrol_get_accounts(\n array('repo_ids' => array($repository['repo_id'])), TRUE\n );\n foreach ($accounts as $uid => $usernames_by_repository) {\n foreach ($usernames_by_repository as $repo_id => $username) {\n versioncontrol_delete_account($repository, $uid, $username);\n }\n }\n\n // Announce deletion of the repository before anything has happened.\n module_invoke_all('versioncontrol_repository', 'delete', $repository);\n\n $vcs = $repository['vcs'];\n\n // Provide an opportunity for the backend to delete its own stuff.\n if (versioncontrol_backend_implements($vcs, 'repository')) {\n _versioncontrol_call_backend($vcs, 'repository', array('delete', $repository));\n }\n\n // Auto-delete repository info from $repository['[xxx]_specific'] from the database.\n $backends = versioncontrol_get_backends();\n if (isset($backends[$vcs])) { // not the case when called from uninstall\n $is_autoadd = in_array(VERSIONCONTROL_FLAG_AUTOADD_REPOSITORIES,\n $backends[$vcs]['flags']);\n }\n if ($is_autoadd) {\n $table_name = 'versioncontrol_'. $vcs .'_repositories';\n _versioncontrol_db_delete_additions($table_name, 'repo_id', $repository['repo_id']);\n }\n\n // Phew, everything's cleaned up. Finally, delete the repository.\n db_query('DELETE FROM {versioncontrol_repositories} WHERE repo_id = %d',\n $repository['repo_id']);\n db_query('DELETE FROM {versioncontrol_repository_urls} WHERE repo_id = %d',\n $repository['repo_id']);\n\n watchdog('special',\n 'Version Control API: deleted repository @repository',\n array('@repository' => $repository['name']),\n WATCHDOG_NOTICE, l('view', 'admin/project/versioncontrol-repositories')\n );\n}", "public function deletePermisos() \n {\n $this->_acl->acceso('del_perm');\n if (isset($_POST['idPermiso']) && count($_POST['idPermiso']) > 0) {\n $errores = array();\n $exitos = array();\n foreach ($_POST['idPermiso'] as $perm) {\n $result = $this->_aclm->deletePermiso($perm);\n if ($result == NULL) {\n $errores[] = 'No se pudo eliminar el permiso ' . $perm;\n } else {\n $exitos[] = 'Se elimin&oacute; el permiso ' . $perm;\n }\n }\n $this->_view->assign('_errores', $errores);\n $this->_view->assign('_exitos', $exitos);\n } else {\n $this->_view->assign('_error', 'No ha seleccionado permiso a eliminar.');\n }\n $this->permisos();\n }", "public function delete(GitRepository $repository);", "public function delete()\n {\n // Remove all role associations\n $this->roles()->detach();\n\n // Delete the permission\n $result = parent::delete();\n\n return $result;\n }", "public function uninstall() {\n \\Zira\\Models\\Permission::getCollection()\n ->delete()\n ->where('module','=','chat')\n ->execute();\n }", "public function clearResources() {\n $db = Zend_Registry::get('dbAdapter');\n $db->delete('admin_access_rights', 'groupId = ' . $this->getId());\n }", "public function deletePermission($name);", "public function removeAllPermissions()\n {\n DB::table('telegram_bot_pivot')\n ->where('telegram_bot_user_id', $this->id)\n ->delete();\n }", "public function detachAllPermissions();", "public function testDeletePermissionSet()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function _delete_authorize() {\n\t\t$this->Attachment->is_deletable($this->current_user, $this->_project) ? true : $this->deny_access();\n\t}", "public function revokeAllPermissions()\n {\n return $this->permissions()->detach();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation carrierFreightDescriptionDELETERequestCarrierIDFreightDescriptionsFreightDescriptionIDDeleteAsync Deletes a freight description from a carrier.
public function carrierFreightDescriptionDELETERequestCarrierIDFreightDescriptionsFreightDescriptionIDDeleteAsync($accept, $carrier_id, $freight_description_id, $jiwa_stateful = null, $description = null, $default_item = null, $last_saved_date_time = null, $enabled = null) { return $this->carrierFreightDescriptionDELETERequestCarrierIDFreightDescriptionsFreightDescriptionIDDeleteAsyncWithHttpInfo($accept, $carrier_id, $freight_description_id, $jiwa_stateful, $description, $default_item, $last_saved_date_time, $enabled) ->then( function ($response) { return $response[0]; } ); }
[ "public function testCarrierFreightDescriptionDELETERequestCarrierIDFreightDescriptionsFreightDescriptionIDDelete()\n {\n }", "public function chatbotChatbotIDRegexRegexIDDeleteAsync($chatbot_id, $regex_id)\n {\n return $this->chatbotChatbotIDRegexRegexIDDeleteAsyncWithHttpInfo($chatbot_id, $regex_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function landedCostShipmentDELETERequestShipmentIDDeleteAsync($accept, $shipment_id, $jiwa_stateful = null)\n {\n return $this->landedCostShipmentDELETERequestShipmentIDDeleteAsyncWithHttpInfo($accept, $shipment_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function restBoardsBoardIdColumnsColumnIdDeleteAsync($board_id, $column_id)\n {\n return $this->restBoardsBoardIdColumnsColumnIdDeleteAsyncWithHttpInfo($board_id, $column_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function inventoryAlternateChildDELETERequestInventoryIDAlternateChildrenAlternateChildIDDeleteAsync($accept, $inventory_id, $alternate_child_id, $jiwa_stateful = null, $linked_inventory_id = null, $linked_inventory_part_no = null, $linked_inventory_description = null, $notes = null)\n {\n return $this->inventoryAlternateChildDELETERequestInventoryIDAlternateChildrenAlternateChildIDDeleteAsyncWithHttpInfo($accept, $inventory_id, $alternate_child_id, $jiwa_stateful, $linked_inventory_id, $linked_inventory_part_no, $linked_inventory_description, $notes)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function landedCostBookInLineDELETERequestBookInIDLinesLineIDDeleteAsync($accept, $book_in_id, $line_id, $jiwa_stateful = null, $item_no = null, $quantity = null, $quantity_previously_booked_in = null, $quantity_outstanding = null, $shipment_line = null, $line_details = null, $custom_field_values = null)\n {\n return $this->landedCostBookInLineDELETERequestBookInIDLinesLineIDDeleteAsyncWithHttpInfo($accept, $book_in_id, $line_id, $jiwa_stateful, $item_no, $quantity, $quantity_previously_booked_in, $quantity_outstanding, $shipment_line, $line_details, $custom_field_values)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function deleteEdiDocumentFileAsync($edi_document_id, $file_id)\n {\n return $this->deleteEdiDocumentFileAsyncWithHttpInfo($edi_document_id, $file_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function inventoryDebtorPriceGroupPriceDELETERequestInventoryIDDebtorPriceGroupPricesDebtorPriceGroupInventorySpecificIDDeleteAsync($accept, $inventory_id, $debtor_price_group_inventory_specific_id, $jiwa_stateful = null, $source = null, $mode = null, $amount = null, $start_date = null, $end_date = null, $use_quantity_price_break = null, $quantity_price_break = null, $debtor_price_group_id = null, $debtor_price_group_description = null, $price = null, $note = null)\n {\n return $this->inventoryDebtorPriceGroupPriceDELETERequestInventoryIDDebtorPriceGroupPricesDebtorPriceGroupInventorySpecificIDDeleteAsyncWithHttpInfo($accept, $inventory_id, $debtor_price_group_inventory_specific_id, $jiwa_stateful, $source, $mode, $amount, $start_date, $end_date, $use_quantity_price_break, $quantity_price_break, $debtor_price_group_id, $debtor_price_group_description, $price, $note)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function debtorPartNumberDELETERequestDebtorIDDebtorPartNumbersPartNumberIDDeleteAsync($accept, $debtor_id, $part_number_id, $jiwa_stateful = null, $inventory_id = null, $part_no = null, $debtor_part_no = null, $debtor_barcode = null)\n {\n return $this->debtorPartNumberDELETERequestDebtorIDDebtorPartNumbersPartNumberIDDeleteAsyncWithHttpInfo($accept, $debtor_id, $part_number_id, $jiwa_stateful, $inventory_id, $part_no, $debtor_part_no, $debtor_barcode)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function deleteDescription($id);", "public function debtorGroupMembershipDELETERequestDebtorIDGroupMembershipsGroupMembershipIDDeleteAsync($accept, $debtor_id, $group_membership_id, $jiwa_stateful = null, $is_default = null, $group_rec_id = null, $group_description = null, $staff_id = null, $staff_username = null, $staff_title = null, $staff_first_name = null, $staff_surname = null, $last_saved_date_time = null, $item_no = null)\n {\n return $this->debtorGroupMembershipDELETERequestDebtorIDGroupMembershipsGroupMembershipIDDeleteAsyncWithHttpInfo($accept, $debtor_id, $group_membership_id, $jiwa_stateful, $is_default, $group_rec_id, $group_description, $staff_id, $staff_username, $staff_title, $staff_first_name, $staff_surname, $last_saved_date_time, $item_no)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function useragentListsUseragentListIdDeleteAsync($useragent_list_id)\n {\n return $this->useragentListsUseragentListIdDeleteAsyncWithHttpInfo($useragent_list_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsync($checkout_id, $accept, $content_type, $consignment_id)\n {\n return $this->checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsyncWithHttpInfo($checkout_id, $accept, $content_type, $consignment_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function deleteReplenishmentTagAsync($replenishment_id, $replenishment_tag)\n {\n return $this->deleteReplenishmentTagAsyncWithHttpInfo($replenishment_id, $replenishment_tag)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function debtorNoteDELETERequestDebtorIDNotesNoteIDDeleteAsync($accept, $debtor_id, $note_id, $jiwa_stateful = null)\n {\n return $this->debtorNoteDELETERequestDebtorIDNotesNoteIDDeleteAsyncWithHttpInfo($accept, $debtor_id, $note_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function deleteInvoiceWorksheetLineDetailTagAsync($invoice_worksheet_line_detail_id, $invoice_worksheet_line_detail_tag)\n {\n return $this->deleteInvoiceWorksheetLineDetailTagAsyncWithHttpInfo($invoice_worksheet_line_detail_id, $invoice_worksheet_line_detail_tag)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function voucherDraftsV2DeleteAsync($voucher_draft_id)\n {\n return $this->voucherDraftsV2DeleteAsyncWithHttpInfo($voucher_draft_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function deletecandidatedocumentbyidAsync($id, $doc_id)\n {\n return $this->deletecandidatedocumentbyidAsyncWithHttpInfo($id, $doc_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function productAttributeGroupDeleteAsync($groupName, string $contentType = self::contentTypes['productAttributeGroupDelete'][0])\n {\n return $this->productAttributeGroupDeleteAsyncWithHttpInfo($groupName, $contentType)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks to ensure that the required fields for the balance endpoint are set
private function checkBalanceRequiredFields() { }
[ "public function validateBalanceParams()\n {\n\t\t$bean \t= \t$this->bean;\n\t \t$rules \t= \t[\n\t\t\t\t\t\t'required' => [\n\t\t\t\t\t\t\t ['WalletId']\n\t\t\t\t\t\t]\n\t\t\t\t\t];\n\t\t\n $v \t\t= \tnew Validator($this->bean);\n $v->rules($rules);\n if (!$v->validate()) {\n $errors = $v->errors();\n\t\t\t// check UsersId and PaymentAmount field\n throw new ApiException(\"Please check WalletId.\" , ErrorCodeType::SomeFieldsRequired, $errors);\n }\n\t}", "private function _checkAndFillRequiredAttributes()\n {\n $defaultValues = array(\n self::DESCRIPTION => 'Charge',\n self::INVOICE => '1',\n self::CUSTOMER_IP => $_SERVER['REMOTE_ADDR']\n );\n\n $requiredAttrs = array();\n\n foreach ($defaultValues as $attr => $value) {\n if (!$this->get($attr)) {\n $this->set($attr, $value);\n }\n }\n\n foreach ($requiredAttrs as $attr) {\n if (!$this->get($attr)) {\n throw new CreditCardFreezer_Exception(\n $attr . ' is a required attribute for an Authorize.net '\n . 'transaction.'\n );\n }\n }\n }", "protected function checkRequired()\n {\n // doesWaste and doesRecycling will return\n // false alarm when a '0'.\n $requiredFields = [\n 'hauler_id', 'hauler_email', 'lead_id', 'status', 'net_monthly'\n ];\n\n $errorFields = [];\n\n foreach ($requiredFields as $field)\n {\n if (empty($this->$field))\n {\n $errorFields[] = $field;\n }\n }\n\n if (count($errorFields))\n {\n throw new MissingRequiredFields(trans('messages.bidValidationErrors', ['fields' => implode(', ', $errorFields)]));\n }\n }", "public function check_balance(){\n $data = array(\n 'CommandID' => 'AccountBalance',\n 'PartyA' => $this->paybill,\n 'IdentifierType' => '4',\n 'Remarks' => 'Remarks or short description',\n 'Initiator' => $this->initiator_username,\n 'SecurityCredential' => $this->cred,\n //~ 'QueueTimeOutURL' => $this->callback_baseurl.'check_balance/callback',\n 'QueueTimeOutURL' => 'https://dev.matrixcyber.co.ke/cf.php',\n //~ 'ResultURL' => $this->callback_baseurl.'check_balance/callback'\n 'ResultURL' => 'https://dev.matrixcyber.co.ke/cf.php'\n );\n $data = json_encode($data);\n $url = $this->base_url.'accountbalance/v1/query';\n $response = $this->submit_request($url, $data);\n return $response;\n }", "public function validate()\n {\n $requiredParameters = array(\n 'number' => 'bank account number',\n 'bank_routing' => 'bank account routing number',\n 'billingFirstName' => 'first name',\n 'billingLastName' => 'last name',\n 'email' => 'email address'\n );\n\n foreach ($requiredParameters as $key => $val) {\n if (!$this->getParameter($key)) {\n throw new InvalidBankAccountException(\"The $val is required\");\n }\n }\n\n if (!is_null($this->getBankAccount()) && !preg_match('/^\\d{4,17}$/i', $this->getBankAccount())) {\n throw new InvalidBankAccountException('Bank Account number should have 4 to 17 digits');\n }\n\n if (!is_null($this->getBankRouting()) && !preg_match('/^\\d{9}$/i', $this->getBankRouting())) {\n throw new InvalidBankAccountException('Bank Account number should be 9 digits');\n }\n }", "public function validate()\n {\n $requiredParameters = array(\n 'accountNumber' => 'bank account number',\n 'routingNumber' => 'bank routing number',\n 'type' => 'bank account type'\n );\n\n foreach ($requiredParameters as $key => $val) {\n if (!$this->getParameter($key)) {\n throw new InvalidBankAccountException(\"The $val is required\");\n }\n }\n\n\t\t$type = $this->getParameter('type');\n\t\tif ($type !== 'checking' && $type !== 'savings') {\n\t\t\tthrow new InvalidBankAccountException(\"Account type must be savings or checking, provided type: $type\");\n\t\t}\n }", "public function testPayerHasBalanceFailed()\n {\n $walletService = new WalletService();\n $this->assertFalse($walletService->payerHasBalance($this->generatePhysicalPerson(), parent::FAKE_BIG_MONEY_VALUE));\n }", "private function checkEstimateRequiredFields()\n {\n if (empty($this->params['Recipients'])) {\n throw new \\Exception(\n 'FayaSMS: To estimate the cost of a message FayaSMS requires the recipient to be set. Set recipient by calling FayaSMS::setRecipient($recipient)'\n );\n }\n\n if (empty($this->params['Message'])) {\n throw new \\Exception(\n 'FayaSMS: To estimate the cost of a message FayaSMS requires the message body to be set. Set message body by calling FayaSMS::setMessageBody($body)'\n );\n }\n }", "public function testCanGetBalance()\n {\n $response = $this->instance\n ->getBalance(self::TEST_ADDRESS);\n\n $this->assertInternalType('double', $response);\n $this->assertGreaterThan(0, $response);\n }", "public function testBalancePost()\n {\n }", "public function testBalance()\n {\n $body = [\n 'errorId' => 0,\n 'balance' => 12.43,\n ];\n\n $client = ClientTest::newClient(\n [\n new Response(200, [], json_encode($body)),\n ]\n );\n\n $balance = $client->getBalance();\n $this->assertInstanceOf(Balance::class, $balance);\n $this->assertSame($body['balance'], $balance->getBalance());\n }", "public function testOrderPaymentsWithGiftCardWhereTheBalanceIsInsufficient()\n {\n $waiter = factory(User::class)->create(['role_id' => 4]);\n $giftCard = factory(GiftCard::class)->create(['value' => 10.00]);\n $order = factory(Order::class)->create(['waiter_id' => $waiter->id, 'subtotal' => 12.00, 'tax' => 0, 'discount' => 0]);\n\n Passport::actingAs($waiter);\n $this->json('POST', '/api/order/'.$order->id.'/pay', [\n 'payment_amount' => $order->subtotal + $order->tax - $order->discount,\n 'payment_change' => 0,\n 'payment_method_id' => 3,\n 'gift_card_id' => $giftCard->id\n ])->assertStatus(422)\n ->assertJson([\n 'message' => 'The given data was invalid.',\n 'errors' => [\n 'gift_card_id' => [\n 0 => \"insufficient gift card balance.\"\n ]\n ]\n ]);\n $this->assertDatabaseMissing('payments', ['order_id' => $order->id]);\n }", "public function checkBalance()\n {\n if ($this->_client) {\n $balance = $this->_client->checkBalance();\n\n if ($balance['balance'] <= env('SMS_CREDIT_THRESHOLD')) {\n // Send warning email\n $subject = 'SMS service balance running low';\n $vars = ['balance'=>$balance];\n \\Mail::send(['text'=>'errors.sms_balance'], $vars, function($message) use ($subject)\n {\n $message->to(env('DEVELOPER_EMAIL'))->subject($subject);\n });\n }\n }\n }", "public function testV1userexchangebankcoinbalanceavailable()\n {\n\n }", "private function checkRequiredFields() {\n $result = true;\n foreach ($this->requiredFields as $requiredField) {\n if (!isset($this->bodyMessage->{$requiredField})) {\n $result = \"Field \" . $requiredField . \" is missing.\";\n break;\n } else if ($this->bodyMessage->{$requiredField} === \"\") {\n $result = \"Field \" . $requiredField . \" is empty.\";\n break;\n }\n }\n\n if ($result !== true) {\n throw new BadRequestException($result);\n }\n }", "private function checkRequiredFields()\n {\n $validator = new ConfigurationValidator();\n $validator->validate($this->name);\n $validator->validate($this->namespace);\n }", "public function accountDetailsNotFilledIn()\n {\n return (empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_host'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_user'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_pass'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_port'))\n );\n }", "public function dataProvider_test_checkBalance(){\n $employer = $this->factory->user->create( array( 'role' => EMPLOYER ) );\n $wallet = new FRE_Credit_Wallet(3);\n $wallet1 = new FRE_Credit_Wallet(4);\n $user_wallet = new FRE_Credit_Wallet(3);\n return array(\n array($employer, $wallet, $user_wallet, 0),\n array($employer, $wallet1, $user_wallet, -1),\n );\n }", "public function testExpectedExceptionTransferUserWithoutBalance()\n {\n $balance_initial_payer = 200.00;\n $balance_initial_payee = 100.00;\n $value_transfer = 300.00;\n\n $expected_balance_payer = $balance_initial_payer - $value_transfer;\n $expected_balance_payee = $balance_initial_payee + $value_transfer;\n\n $payer = factory(User::class)->create([\n 'document' => '24687778080',\n 'balance_wallet' => $balance_initial_payer\n ]);\n\n \n $payee = factory(User::class)->create([\n 'document' => '79037527000152',\n 'balance_wallet' => $balance_initial_payee,\n 'type' => 2\n ]);\n\n $response = $this->postJson('/api/transaction', [\n \"value\" => $value_transfer,\n \"payee\" => $payee->id,\n \"payer\" => $payer->id\n ]);\n\n $response->assertStatus(500);\n $this->assertEquals(\"Insufficient funds.\", Arr::get(\n $response->decodeResponseJson(),\n 'message'\n ));\n $this->assertEquals($balance_initial_payer, $payer->fresh()->balance_wallet);\n $this->assertEquals($balance_initial_payee, $payee->fresh()->balance_wallet);\n\n $this->assertDatabaseMissing('transactions', [\n 'payee_id' => $payee->id,\n 'payer_id' => $payer->id,\n 'value' => $value_transfer\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new selectListItem
public function setSelectListItem($selectListItem) { $this->selectListItem = $selectListItem; return $this; }
[ "private function _initSelectList()\n {\n $features = $this->Feature->getAllFeaturesKeyValue();\n $this->set('features', $features);\n $categories = $this->Category->getAllCategoryPair();\n $this->set('categories', $categories);\n }", "protected function createSelectbox()\r\n\t{\r\n\t\t$html = Html::el('select')->id('sel' . $this->index)->class('acSelect')\r\n\t\t\t->style(array('width' => $this->width ? $this->width : '10em'));\r\n\t\tforeach ($this->options as $key => $text)\r\n\t\t\t$html->create('option')->value($key)->setHtml($text);\r\n\t\t$this->html = $html;\r\n\t}", "protected function createUserAndGroupListForSelectOptions() {}", "public function testSetSelectList()\n {\n oxConfig::getInstance()->setConfigParam( 'bl_perfLoadSelectLists', true );\n $oBasketItem = new modFortestSetAsDiscountArticle();\n $oBasketItem->init( $this->oArticle->getId(), 6 );\n $this->assertEquals( array( 0 ), $oBasketItem->getSelList() );\n }", "public function actionSetDropdownDokter()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $model = new BKPendaftaranT;\n $option = CHtml::tag('option',array('value'=>''),CHtml::encode('-- Pilih --'),true);\n if(!empty($_POST['ruangan_id'])){\n $data = $model->getDokterItems($_POST['ruangan_id']);\n $data = CHtml::listData($data,'pegawai_id','NamaLengkap');\n foreach($data as $value=>$name){\n $option .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n } \n $dataList['listDokter'] = $option;\n echo json_encode($dataList);\n Yii::app()->end();\n }\n }", "public function setSelected($data) {$this->_selected = $data; }", "function createOption($name){\r\n\t\tparent::setMiddle(\"<option id='\" . parent::cleanName($name) . \"'>\" . $name . \"</option>\");\r\n\t\treturn $this;\r\n\t}", "function setSelectedList($selectedList) {\n\n if ($this->optionList == NULL) {\n $this->fatalErrorPage('optionList must be set before setting selectedList');\n }\n\n if (!$this->haveEntities) {\n $this->createEntities();\n }\n\n $this->selectedList = $selectedList;\n\n // calculate pool list\n foreach ($this->optionList as $title => $data) {\n\n if (empty($this->selectedList[$title])) {\n $this->poolList[$title] = $data;\n }\n\n }\n \n $this->poolEntity->inputEntity->setList($this->poolList);\n $this->selectedEntity->inputEntity->setList($this->selectedList);\n\n if ($this->selectedEntity->inputEntity->optionCount() == 0) {\n $this->selectedEntity->inputEntity->addDirective('addNoOption',true);\n }\n if ($this->poolEntity->inputEntity->optionCount() == 0) {\n $this->poolEntity->inputEntity->addDirective('addNoOption',true);\n }\n\n if ($this->directive['sort']) {\n $this->poolEntity->inputEntity->sortByTitle();\n $this->selectedEntity->inputEntity->sortByTitle();\n }\n\n }", "protected function setupListOptions()\n {\n global $Security, $Language;\n\n // \"griddelete\"\n if ($this->AllowAddDeleteRow) {\n $item = &$this->ListOptions->add(\"griddelete\");\n $item->CssClass = \"text-nowrap\";\n $item->OnLeft = true;\n $item->Visible = false; // Default hidden\n }\n\n // Add group option item\n $item = &$this->ListOptions->add($this->ListOptions->GroupOptionName);\n $item->Body = \"\";\n $item->OnLeft = true;\n $item->Visible = false;\n\n // Drop down button for ListOptions\n $this->ListOptions->UseDropDownButton = true;\n $this->ListOptions->DropDownButtonPhrase = $Language->phrase(\"ButtonListOptions\");\n $this->ListOptions->UseButtonGroup = false;\n if ($this->ListOptions->UseButtonGroup && IsMobile()) {\n $this->ListOptions->UseDropDownButton = true;\n }\n\n //$this->ListOptions->ButtonClass = \"\"; // Class for button group\n\n // Call ListOptions_Load event\n $this->listOptionsLoad();\n $item = $this->ListOptions[$this->ListOptions->GroupOptionName];\n $item->Visible = $this->ListOptions->groupOptionVisible();\n }", "public abstract function addSelect($title, array $options = array(), array $attributes = array());", "public function actionSetDropdownJeniskasuspenyakit()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $model = new LBPendaftaranT;\n $option = CHtml::tag('option',array('value'=>''),CHtml::encode('-- Pilih --'),true);\n if(!empty($_POST['ruangan_id'])){\n $data = $model->getJenisKasusPenyakitItems($_POST['ruangan_id']);\n $data = CHtml::listData($data,'jeniskasuspenyakit_id', 'jeniskasuspenyakit_nama');\n foreach($data as $value=>$name){\n $option .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n } \n $dataList['listKasuspenyakit'] = $option;\n echo json_encode($dataList);\n Yii::app()->end();\n }\n }", "public function actionSetDropdownJeniskasuspenyakit()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $model = new RJPendaftaranT;\n $option = CHtml::tag('option',array('value'=>''),CHtml::encode('-- Pilih --'),true);\n if(!empty($_POST['ruangan_id'])){\n $data = $model->getJenisKasusPenyakitItems($_POST['ruangan_id']);\n $data = CHtml::listData($data,'jeniskasuspenyakit_id', 'jeniskasuspenyakit_nama');\n foreach($data as $value=>$name){\n $option .= CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true);\n }\n } \n $dataList['listKasuspenyakit'] = $option;\n echo json_encode($dataList);\n Yii::app()->end();\n }\n }", "protected function initOptionsList()\r\n {\r\n //$this->addOption(new Option('id', 'Identifiant', 'string', null, false, 30));\r\n }", "static function selectOptionsEditor(){\n global $item, $atrId;\n $atributes=mysql::getArray(\"SELECT * FROM `attributes` WHERE id=\".escape($atrId).\" LIMIT 1\",true);\n ajax::window('<h2>Опции списка &laquo;'.$atributes['name'].'&raquo;</h2><div data-close=\"closeSelectEditor('.$atrId.')\" style=\"width:480px; height:340px; overflow:hidden;\">\n <div id=\"tblOptList\" style=\"width:100%; max-height:210px; overflow-y:scroll; background:#eeeeee; padding:0 !important; margin-bottom:10px;\">\n <table id=\"tblOptTable\" class=\"cmstable4\" style=\"margin:0;\">\n '.self::selOptionsTable($atrId).'\n </table>\n </div>\n <hr>\n <form id=\"atrEdFrm\" method=\"POST\">\n <div class=\"btn-group\">\n <div class=\"label\"><i class=\"ic-plus\" style=\"margin-top:6px;\"></i></div>\n <input type=\"hidden\" name=\"opt[attr_id]\" value=\"'.$atrId.'\">\n <input type=\"hidden\" name=\"opt[item]\" value=\"'.$item.'\">\n <input type=\"hidden\" name=\"opt[multiple]\" value=\"'.$atributes['multiple'].'\">\n <input id=\"newOptionValue\" type=\"text\" name=\"opt[name]\" style=\"width:290px;\" maxlength=\"64\" value=\"\">\n <div class=\"btn\" onclick=\"selectOptionSave()\"><i class=\"ic-save\"></i>Сохранить</div>\n </div>\n </form>\n </div>',true);\n return false;\n }", "public function makeSelect(){\n echo \"<select name=\\\"\" .$this->getName(). \"\\\"><br>\";\n $this->makeOptions($this->getValue());\n echo \"</select>\" ;\n }", "function setValue($value) {\n\t\t$this->_selected = $value;\n\t}", "public function makeSelect(){\n echo \"<select name=\\\"\" .$this->getName(). \"\\\">\\n\";\n //Create options.\n $this->makeOptions($this->getValue());\n echo \"</select>\" ;\n }", "function drawOptions($list, $valueField, $textField, $selected, $before = null, $extra = array()) {\n $html = '';\n if(isset($before) || !empty($before)) {\n $html .= $before;\n }\n foreach ($list as $key=>$value) {\n $valueField = !isset($extra['value_field']) ? $key : $value[$extra['value_field']];\n $textField = !isset($extra['text_field']) ? $value : $value[$extra['text_field']];\n $select = ($selected == $valueField) ? \"selected='selected'\" : '';\n $attr = $extra['selectpicker-content'] ? \"data-content='\".$textField.\"'\" : '';\n $icon = $extra['selectpicker-icon'] ? \"data-icon='\".$textField['icon'].\"'\" : '';\n $text = $textField;\n if($extra['selectpicker-icon']) {\n $text = $textField['text'];\n }\n $html .= \"<option $icon $attr value='\" . $valueField . \"' $select>\" . $text . \"</option>\";\n }\n return $html;\n}", "function set_select($field = '', $value = '', $default = FALSE)\n { \n return $this->set_value_array($field, $value, ' selected=\"selected\"', $default);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Supplement parent findDefinitions values with Matchers defined in Zxcvbn library. Each entry must be defined as 'NamespacedClass' => 'Description' It then massages the data in the structure needed to represent a plugin definition.
protected function findDefinitions() { $definitions = parent::findDefinitions(); $zxcvbn_matchers = array( 'ZxcvbnPhp\Matchers\DateMatch' => 'Matching the use of dates in passwords', 'ZxcvbnPhp\Matchers\DigitMatch' => 'Matching the use of three or more digits in a row in passwords', 'ZxcvbnPhp\Matchers\L33tMatch' => 'Matching l33t speak words used in passwords', 'ZxcvbnPhp\Matchers\RepeatMatch' => 'Matching the use of three or more of the same character in passwords', 'ZxcvbnPhp\Matchers\SequenceMatch' => 'Matching alphanumerical sequences of characters in passwords', 'ZxcvbnPhp\Matchers\SpatialMatch' => 'Matching keyboard character spatial locality in passwords', 'ZxcvbnPhp\Matchers\YearMatch' => 'Matching years in passwords', 'ZxcvbnPhp\Matchers\DictionaryMatch' => 'Matching words used in passwords pulled from a dictionary', ); foreach ($zxcvbn_matchers as $matcher_class => $matcher_description) { $class = ltrim(strrchr($matcher_class, '\\'),'\\'); $name = 'zxcvbn_' . strtolower($class); $definitions[$name] = array( 'id' => $name, 'title' => new TranslationWrapper($matcher_description), 'description' => new TranslationWrapper('Zxcvbn Library ' . $class . ' Matcher'), 'class' => $matcher_class, 'provider' => 'password_strength', ); } return $definitions; }
[ "protected function define_definition_plugin_structure() {\n\n // Append data only if the grand-parent element has 'method' set to 'simplefeedbackrubric'.\n $plugin = $this->get_plugin_element(null, '../../method', 'simplefeedbackrubric');\n\n // Create a visible container for our data.\n $pluginwrapper = new backup_nested_element($this->get_recommended_name());\n\n // Connect our visible container to the parent.\n $plugin->add_child($pluginwrapper);\n\n // Define our elements.\n\n $criteria = new backup_nested_element('sfrcriteria');\n\n $criterion = new backup_nested_element('sfrcriterion', array('id'), array(\n 'sortorder', 'description', 'descriptionformat'));\n\n $levels = new backup_nested_element('sfrlevels');\n\n $level = new backup_nested_element('sfrlevel', array('id'), array(\n 'definition', 'definitionformat'));\n\n // Build elements hierarchy.\n\n $pluginwrapper->add_child($criteria);\n $criteria->add_child($criterion);\n $criterion->add_child($levels);\n $levels->add_child($level);\n\n // Set sources to populate the data.\n\n $criterion->set_source_table('gradingform_sfrbric_criteria',\n array('definitionid' => backup::VAR_PARENTID));\n\n $level->set_source_table('gradingform_sfrbric_levels',\n array('criterionid' => backup::VAR_PARENTID));\n\n // No need to annotate ids or files yet.\n // One day when criterion definition supports embedded files, they must be annotated here.\n\n return $plugin;\n }", "protected function getSubDefinitionMocks() {\n\t\t$implementationMock = $this->getMock('Dkd\\\\CmisService\\\\Configuration\\\\Definitions\\\\ImplementationConfiguration');\n\t\t$tableMock = $this->getMock('Dkd\\\\CmisService\\\\Configuration\\\\Definitions\\\\TableConfiguration');\n\t\t$cmisMock = $this->getMock('Dkd\\\\CmisService\\\\Configuration\\\\Definitions\\\\CmisConfiguration');\n\t\t$stanbolMock = $this->getMock('Dkd\\\\CmisService\\\\Configuration\\\\Definitions\\\\StanbolConfiguration');\n\t\treturn array($implementationMock, $tableMock, $cmisMock, $stanbolMock);\n\t}", "protected function getPluginDefinitions() {\n $definitions = [\n 'apple' => [\n 'id' => 'apple',\n 'label' => 'Apple',\n 'color' => 'green',\n 'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Apple',\n 'provider' => 'plugin_test',\n ],\n 'banana' => [\n 'id' => 'banana',\n 'label' => 'Banana',\n 'color' => 'yellow',\n 'uses' => [\n 'bread' => 'Banana bread',\n ],\n 'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Banana',\n 'provider' => 'plugin_test',\n ],\n 'cherry' => [\n 'id' => 'cherry',\n 'label' => 'Cherry',\n 'color' => 'red',\n 'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Cherry',\n 'provider' => 'plugin_test',\n ],\n ];\n return $definitions;\n }", "public function populateRegistry()\n {\n $this->registry = array();\n\n foreach ($this->plugins->getIterator(false) as $plugin) {\n $class = new ReflectionClass($plugin);\n $pluginName = strtolower($plugin->getName());\n\n // Parse the plugin description\n $docblock = $class->getDocComment();\n $annotations = $this->getAnnotations($docblock);\n if (isset($annotations['pluginDesc'])) {\n $pluginDesc = implode(' ', $annotations['pluginDesc']);\n } else {\n $pluginDesc = $this->parseShortDescription($docblock);\n }\n $this->registry[$pluginName] = array(\n 'desc' => $pluginDesc,\n 'cmds' => array()\n );\n\n // Parse command method descriptions\n $methodPrefix = Phergie_Plugin_Command::METHOD_PREFIX;\n $methodPrefixLength = strlen($methodPrefix);\n foreach ($class->getMethods() as $method) {\n if (strpos($method->getName(), $methodPrefix) !== 0) {\n continue;\n }\n\n $cmd = strtolower(substr($method->getName(), $methodPrefixLength));\n $docblock = $method->getDocComment();\n $annotations = $this->getAnnotations($docblock);\n\n if (isset($annotations['pluginCmd'])) {\n $cmdDesc = implode(' ', $annotations['pluginCmd']);\n } else {\n $cmdDesc = $this->parseShortDescription($docblock);\n }\n\n $cmdParams = array();\n if (!empty($annotations['param'])) {\n foreach ($annotations['param'] as $param) {\n $match = null;\n if (preg_match('/\\h+\\$([^\\h]+)\\h+/', $param, $match)) {\n $cmdParams[] = $match[1];\n }\n }\n }\n\n $this->registry[$pluginName]['cmds'][$cmd] = array(\n 'desc' => $cmdDesc,\n 'params' => $cmdParams\n );\n }\n\n if (empty($this->registry[$pluginName]['cmds'])) {\n unset($this->registry[$pluginName]);\n }\n }\n }", "public function getDerivativeDefinitions($base_plugin_definition);", "public function fieldPluginDefinitionsProvider() {\n return [\n 'missing_core_scenario' => [\n 'definitions' => [\n 'missing_core' => [\n 'source_module' => 'migrate',\n 'destination_module' => 'migrate',\n 'id' => 'missing_core',\n 'class' => 'foo',\n 'provider' => 'foo',\n ],\n ],\n 'missing_property' => 'core',\n ],\n 'missing_source_scenario' => [\n 'definitions' => [\n 'missing_source_module' => [\n 'core' => [6, 7],\n 'destination_module' => 'migrate',\n 'id' => 'missing_source_module',\n 'class' => 'foo',\n 'provider' => 'foo',\n ],\n ],\n 'missing_property' => 'source_module',\n ],\n 'missing_destination_scenario' => [\n 'definitions' => [\n 'missing_destination_module' => [\n 'core' => [6, 7],\n 'source_module' => 'migrate',\n 'id' => 'missing_destination_module',\n 'class' => 'foo',\n 'provider' => 'foo',\n ],\n ],\n 'missing_property' => 'destination_module',\n ],\n ];\n }", "public function providerForFind() {\n\t\treturn array(\n\t\t\tarray('Parent, native subfield',\n\t\t\t\t'parent.name=cities',\n\t\t\t\tarray(\n\t\t\t\t\t'assertCount' => array(70),\n\t\t\t\t\t'assertPropertyEqualsForeach' => array(4049, 'parent_id')\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}", "public function testGetDefinitionsWithoutRequiredInterface() {\n $module_handler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');\n\n $module_handler->expects($this->any())\n ->method('moduleExists')\n ->with('plugin_test')\n ->willReturn(FALSE);\n\n $this->expectedDefinitions['kale'] = [\n 'id' => 'kale',\n 'label' => 'Kale',\n 'color' => 'green',\n 'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Kale',\n 'provider' => 'plugin_test',\n ];\n $this->expectedDefinitions['apple']['provider'] = 'plugin_test';\n $this->expectedDefinitions['banana']['provider'] = 'plugin_test';\n\n $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler, NULL);\n $this->assertIsArray($plugin_manager->getDefinitions());\n }", "public function getDefinitions() : array;", "function hook_feeds_plugins() {\n $info = array();\n $info['MyFetcher'] = array(\n 'name' => 'My Fetcher',\n 'description' => 'Fetches my stuff.',\n 'help' => 'More verbose description here. Will be displayed on fetcher selection menu.',\n 'handler' => array(\n 'parent' => 'FeedsFetcher',\n 'class' => 'MyFetcher',\n 'file' => 'MyFetcher.inc',\n 'path' => drupal_get_path('module', 'my_module'), // Feeds will look for MyFetcher.inc in the my_module directory.\n ),\n );\n $info['MyParser'] = array(\n 'name' => 'ODK parser',\n 'description' => 'Parse my stuff.',\n 'help' => 'More verbose description here. Will be displayed on parser selection menu.',\n 'handler' => array(\n 'parent' => 'FeedsParser', // Being directly or indirectly an extension of FeedsParser makes a plugin a parser plugin.\n 'class' => 'MyParser',\n 'file' => 'MyParser.inc',\n 'path' => drupal_get_path('module', 'my_module'),\n ),\n );\n $info['MyProcessor'] = array(\n 'name' => 'ODK parser',\n 'description' => 'Process my stuff.',\n 'help' => 'More verbose description here. Will be displayed on processor selection menu.',\n 'handler' => array(\n 'parent' => 'FeedsProcessor',\n 'class' => 'MyProcessor',\n 'file' => 'MyProcessor.inc',\n 'path' => drupal_get_path('module', 'my_module'),\n ),\n );\n return $info;\n}", "public function providerTestPluginSupportingElement() {\n return [\n 'tag that belongs to a superset' => [\n 'tag' => 'h2',\n 'expected_plugin' => 'ckeditor5_heading',\n ],\n 'tag only available as tag' => [\n 'tag' => 'nav',\n 'expected_plugin' => 'ckeditor5_definition_supporting_element_just_nav',\n ],\n 'between just tag, full use of class, and constrained use of class, return full use of class' => [\n 'tag' => 'article',\n 'expected_plugin' => 'ckeditor5_definition_supporting_element_article_class',\n ],\n 'between just tag and full use of class, return full use of class' => [\n 'tag' => 'footer',\n 'expected_plugin' => 'ckeditor5_definition_supporting_element_footer_class',\n ],\n 'between just tag and constrained use of class, return constrained use of class' => [\n 'tag' => 'aside',\n 'expected_plugin' => 'ckeditor5_definition_supporting_element_aside_class_with_values',\n ],\n 'between full use of class and constrained use of class, return full use of class' => [\n 'tag' => 'main',\n 'expected_plugin' => 'ckeditor5_definition_supporting_element_main_class',\n ],\n 'between one plugin allows one attribute, second allows two, return the one that allows two' => [\n 'tag' => 'figure',\n 'expected_plugin' => 'ckeditor5_definition_supporting_element_figure_two_attrib',\n ],\n 'between one plugin allows one attribute, second allows two (but appearing in opposite order), still return the one that allows two' => [\n 'tag' => 'dialog',\n 'expected_plugin' => 'ckeditor5_definition_supporting_element_dialog_two_attrib',\n ],\n 'tag that belongs to a plugin with conditions' => [\n 'tag' => 'drupal-media',\n 'expected_plugin' => NULL,\n ],\n ];\n }", "public function providerCandidates(): \\Generator {\n $generate_definition = function (string $label_and_id, array $overrides): CKEditor5PluginDefinition {\n $annotation = [\n 'provider' => 'test',\n 'id' => \"test_$label_and_id\",\n 'drupal' => ['label' => \"$label_and_id\"],\n 'ckeditor5' => ['plugins' => []],\n ];\n foreach ($overrides as $path => $value) {\n NestedArray::setValue($annotation, explode('.', $path), $value);\n }\n $annotation_instance = new CKEditor5Plugin($annotation);\n $definition = $annotation_instance->get();\n return $definition;\n };\n\n yield 'Tag needed, no match due to no plugin supporting it' => [\n HTMLRestrictions::emptySet(),\n HTMLRestrictions::fromString('<foo>'),\n [\n $generate_definition('foo', ['drupal.elements' => FALSE]),\n ],\n [],\n [],\n ];\n\n yield 'Tag needed, single match without surplus' => [\n HTMLRestrictions::emptySet(),\n HTMLRestrictions::fromString('<foo>'),\n [\n $generate_definition('foo', ['drupal.elements' => ['<foo>']]),\n ],\n [\n 'foo' => [\n '-attributes-none-' => [\n 'test_foo' => 0,\n ],\n ],\n ],\n // Perfect surplus score, but also only choice available.\n ['test_foo' => ['-attributes-none-' => ['foo' => NULL]]],\n ];\n\n yield 'Tag needed, no match due to plugins only supporting attributes on the needed tag' => [\n HTMLRestrictions::emptySet(),\n HTMLRestrictions::fromString('<foo>'),\n [\n $generate_definition('foo', ['drupal.elements' => ['<foo bar baz>']]),\n ],\n [],\n // No choice available due to the tag not being creatable.\n [],\n ];\n\n $various_foo_definitions = [\n $generate_definition('all_attrs', ['drupal.elements' => ['<foo *>']]),\n $generate_definition('attrs', ['drupal.elements' => ['<foo bar baz>']]),\n $generate_definition('attr_values', ['drupal.elements' => ['<foo bar=\"a b\">']]),\n $generate_definition('plain', ['drupal.elements' => ['<foo>']]),\n $generate_definition('tags', ['drupal.elements' => ['<foo>', '<bar>', '<baz>']]),\n $generate_definition('tags_and_attrs', ['drupal.elements' => ['<foo bar baz>', '<bar>', '<baz>']]),\n $generate_definition('tags_and_attr_values', ['drupal.elements' => ['<foo bar=\"a b\" baz>', '<bar>', '<baz>']]),\n ];\n\n yield 'Tag needed, multiple matches' => [\n HTMLRestrictions::emptySet(),\n HTMLRestrictions::fromString('<foo>'),\n $various_foo_definitions,\n [\n 'foo' => [\n '-attributes-none-' => [\n 'test_plain' => 0,\n 'test_tags' => 2000000,\n ],\n ],\n ],\n // test_plain (elements: `<foo>`) has perfect surplus score.\n ['test_plain' => ['-attributes-none-' => ['foo' => NULL]]],\n ];\n\n yield 'Attribute needed, multiple matches' => [\n HTMLRestrictions::fromString('<foo>'),\n HTMLRestrictions::fromString('<foo bar>'),\n $various_foo_definitions,\n [\n 'foo' => [\n 'bar' => [\n // Because `<foo bar>` allowed.\n TRUE => [\n 'test_all_attrs' => 100000,\n // This will be selected.\n 'test_attrs' => 1100,\n 'test_tags_and_attrs' => 2001100,\n ],\n // Because `<foo bar=\"a\">` allowed.\n 'a' => [\n TRUE => [\n 'test_attr_values' => 0,\n 'test_tags_and_attr_values' => 2001100,\n ],\n ],\n // Because `<foo bar=\"b\">` allowed.\n 'b' => [\n TRUE => [\n 'test_attr_values' => 0,\n 'test_tags_and_attr_values' => 2001100,\n ],\n ],\n ],\n // Note that `test_plain` and `test_tags` are absent.\n '-attributes-none-' => [\n 'test_all_attrs' => 100000,\n 'test_attrs' => 1100,\n 'test_attr_values' => 0,\n 'test_tags_and_attrs' => 2001100,\n 'test_tags_and_attr_values' => 2001100,\n ],\n ],\n ],\n // test_attrs (elements: `<foo bar baz>`) has best surplus score, despite\n // allowing one extra attribute and any value on that attribute.\n ['test_attrs' => ['bar' => ['foo' => TRUE]]],\n ];\n\n yield 'Attribute value needed, multiple matches' => [\n HTMLRestrictions::fromString('<foo>'),\n HTMLRestrictions::fromString('<foo bar=\"b\">'),\n $various_foo_definitions,\n [\n 'foo' => [\n 'bar' => [\n 'b' => [\n TRUE => [\n 'test_all_attrs' => 100000,\n 'test_attrs' => 2200,\n // This will be selected.\n 'test_attr_values' => 1001,\n 'test_tags_and_attrs' => 2002200,\n 'test_tags_and_attr_values' => 2002101,\n ],\n ],\n ],\n // Note that `test_plain` and `test_tags` are absent.\n '-attributes-none-' => [\n 'test_all_attrs' => 100000,\n 'test_attrs' => 2200,\n 'test_attr_values' => 1001,\n 'test_tags_and_attrs' => 2002200,\n 'test_tags_and_attr_values' => 2002101,\n ],\n ],\n ],\n // test_attr_values (elements: `<foo bar=\"a b\">`) has best surplus score,\n // despite allowing one extra attribute value.\n ['test_attr_values' => ['bar' => ['foo' => ['b' => TRUE]]]],\n ];\n }", "public function getDefinitions(): array;", "protected function groupDefinitions() {\n return $this->groupPluginManager->getDefinitions();\n }", "public function returnNamePackageAndWhoisForKnownClassesWithOneWord()\n {\n $entity = $this->object->getParams()->getFilter().'_Name';\n $this->object->cacheKnow($entity);\n $this->assertEquals('Name', $this->object->getName($entity));\n $this->assertEquals('Name', $this->object->getPackage($entity));\n $this->assertEquals('lib', $this->object->getType($entity));\n $this->assertEquals('', $this->object->whois($entity));\n }", "public function testGetPluginWithClassNameOption()\n {\n Plugin::load('TestPlugin');\n $table = CollectionRegistry::get('MyComments', [\n 'className' => 'TestPlugin.Comments',\n ]);\n $class = 'TestPlugin\\Model\\Collection\\CommentsCollection';\n $this->assertInstanceOf($class, $table);\n $this->assertFalse(CollectionRegistry::exists('Comments'), 'Class name should not exist');\n $this->assertFalse(CollectionRegistry::exists('TestPlugin.Comments'), 'Full class alias should not exist');\n $this->assertTrue(CollectionRegistry::exists('MyComments'), 'Class name should exist');\n\n $second = CollectionRegistry::get('MyComments');\n $this->assertSame($table, $second);\n }", "public function getDefinitions() {\r\n\t\t$result = @ldap_read($this->_connection,$this->_config['base_dn'],'objectClass=*',array('subschemaSubentry'),false,0,10,LDAP_DEREF_NEVER);\r\n\t\tif ($result === false) {\r\n\t\t\tthrow new CLdapException(Yii::t('LdapComponent.server', 'ldap_read failt ({errno}): {message}',\r\n\t\t\t\tarray('{errno}'=>ldap_errno($this->_connection), '{message}'=>ldap_error($this->_connection))), ldap_errno($this->_connection));\r\n\t\t}\r\n\t\t$entries = @ldap_get_entries($this->_connection, $result);\r\n\t\tif ($entries === false) {\r\n\t\t\tthrow new CLdapException(Yii::t('LdapComponent.server', 'ldap_get_entries failt ({errno}): {message}',\r\n\t\t\t\tarray('{errno}'=>ldap_errno($this->_connection), '{message}'=>ldap_error($this->_connection))), ldap_errno($this->_connection));\r\n\t\t}\r\n\t\t$entry = $entries[0];\r\n\t\t$subschemasubentry = $entry[$entry[0]][0];\r\n\r\n\t\t$result = @ldap_read($this->_connection, $subschemasubentry,'objectClass=*',array('objectclasses','attributetypes'),false,0,10,LDAP_DEREF_NEVER);\r\n\t\tif ($result === false) {\r\n\t\t\tthrow new CLdapException(Yii::t('LdapComponent.server', 'ldap_read failt ({errno}): {message}',\r\n\t\t\t\tarray('{errno}'=>ldap_errno($this->_connection), '{message}'=>ldap_error($this->_connection))), ldap_errno($this->_connection));\r\n\t\t}\r\n\t\t$entries = @ldap_get_entries($this->_connection, $result);\r\n\t\t//echo '<pre>' . print_r($entries, true) . '</pre>';\r\n\t\tif ($entries === false) {\r\n\t\t\tthrow new CLdapException(Yii::t('LdapComponent.server', 'ldap_get_entries failt ({errno}): {message}',\r\n\t\t\t\tarray('{errno}'=>ldap_errno($this->_connection), '{message}'=>ldap_error($this->_connection))), ldap_errno($this->_connection));\r\n\t\t}\r\n\t\t$objectclasses = array();\r\n\t\t$attributetypes = array();\r\n\t\tfor($i=0; $i<$entries[0]['count']; $i++) {\r\n\t\t\tif ('attributetypes' == $entries[0][$i]) {\r\n\t\t\t\t$attrtypes = $entries[0][$entries[0][$i]];\r\n\t\t\t\tfor ($j=0; $j<$attrtypes['count']; $j++) {\r\n\t\t\t\t\t$attrtype = new CLdapAttributeType($attrtypes[$j]);\r\n\t\t\t\t\tforeach($attrtype->getNames() as $name) {\r\n\t\t\t\t\t\t$this->_schema->addAttributeType($name, $attrtype);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// We need all attributes before parsing the objectclasses\r\n\t\tfor($i=0; $i<$entries[0]['count']; $i++) {\r\n\t\t\tif ('objectclasses' == $entries[0][$i]) {\r\n\t\t\t\t$objclasses = $entries[0][$entries[0][$i]];\r\n\t\t\t\tfor ($j=0; $j<$objclasses['count']; $j++) {\r\n\t\t\t\t\t$objclass = new CLdapObjectClass($objclasses[$j]);\r\n\t\t\t\t\tforeach($objclass->getNames() as $name) {\r\n\t\t\t\t\t\t$this->_schema->addObjectClass($name, $objclass);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function findExtends($class);", "public function testGetPluginWithClassNameOption()\n {\n Plugin::load('TestPlugin');\n $table = TypeRegistry::get('MyComments', [\n 'className' => 'TestPlugin.Comments',\n ]);\n $class = 'TestPlugin\\Model\\Type\\CommentsType';\n $this->assertInstanceOf($class, $table);\n $this->assertFalse(TypeRegistry::exists('Comments'), 'Class name should not exist');\n $this->assertFalse(TypeRegistry::exists('TestPlugin.Comments'), 'Full class alias should not exist');\n $this->assertTrue(TypeRegistry::exists('MyComments'), 'Class name should exist');\n\n $second = TypeRegistry::get('MyComments');\n $this->assertSame($table, $second);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all events of a group
function get_group_events($gID) { $query = $this->db->query('SELECT event_id, event_picture, event_title, event_description, event_begin_datetime, event_end_datetime FROM event WHERE event_id IN (SELECT event_id FROM organization_event WHERE org_id = '.$gID.') AND event_begin_datetime >= NOW() ORDER BY event_begin_datetime ASC'); $group_events = array(); foreach ($query->result_array() as $row) { $group_events[] = array('event_id' => $row['event_id'],'event_title' => $row['event_title'], 'event_begin_datetime' => $row['event_begin_datetime'], 'event_end_datetime' =>$row['event_end_datetime'], 'event_picture' => $row['event_picture'], 'event_description' => $row['event_description']); } return $group_events; }
[ "public function getGroupEvents($app_id,$group_id){\n $events=new Application_Model_Mapper_Appdata_Collection();\n $result=$events->fetchAll($app_id, $tags='events');\n $arr=array();\n foreach($result as $r){\n $meta=$r->getMetadata();\n $date=new Zend_Date(date('Y-m-d'),Zend_Date::ISO_8601);\n $event_date=new Zend_Date($meta['event_date'],Zend_Date::ISO_8601);\n if($date->isEarlier($event_date) and $meta['group_id']==$group_id){\n array_push($arr, $r);\n }\n }\n return $arr;\n \n }", "public function GetGroupEvents()\n {\n $EventsDb = new Application_Model_DbTable_Calendar_Eventos();\n $UsusarioDb = new Application_Model_DbTable_Calendar_UsuariosEventos();\n \n $select = $EventsDb->select()\n ->setIntegrityCheck(false)\n ->from(array('a'=>$EventsDb->__get('_name')),array('id','start','end','allDay','title','description','origen'))\n ->joinLeft(array('c'=>$UsusarioDb->__get('_name')),'a.id=c.idevento',array('username'))\n ->where('c.OU_ID = ?',$this->userData->OU_ID);\n \n if(isset($this->params['start']))\n $select->where(\"UNIX_TIMESTAMP(STR_TO_DATE(start, '%Y-%m-%d %H:%i:%s')) >= ? \",$this->params['start']);\n \n if(isset($this->params['end']))\n $select->where(\"UNIX_TIMESTAMP(STR_TO_DATE(end, '%Y-%m-%d %H:%i:%s')) <= ? \",$this->params['end']);\n \n $Events = $EventsDb->fetchAll($select)->toArray();\n $Events = self::getEventoptions($Events);\n \n return json_encode($Events);\n }", "public function findEventsByGroup(Group $group)\n {\n $qb = $this->createQueryBuilder('e');\n\n return $qb->where($qb->expr()->eq('g', ':group'))\n ->andWhere($qb->expr()->eq('e.isActive', true))\n ->join('e.eventGroups', 'eg')\n ->join('eg.group', 'g')\n ->setParameter('group', $group)\n ->getQuery()\n ->getResult();\n }", "public function fetchAllEvents();", "public function getEvents();", "public function return_all_events(){\n global $dbh;\n $sql = \"SELECT * FROM Events\";\n $get = $dbh->prepare($sql);\n $get->execute(array($division));\n $get = $get->fetchAll();\n return $get;\n }", "public function getEventsByTournamentEventGruop($group_id)\n {\n\n $events = $this->tournamentEventGroupRepo->getEvents($group_id);\n\n return $events;\n }", "public function findAllEvents() {\n\t\treturn $this->db->exec_SELECTgetRows('*', 'tx_cal_event', '');\n\t}", "abstract protected function get_events();", "public function getAllEvents()\n\t{\n\t\treturn DB::table('events')\n\t\t\t\t\t->from(DB::raw('(SELECT * FROM events ORDER BY start_date DESC) AS ordered_events'))\n\t\t\t\t\t->whereNull('deleted_at')\n\t\t\t\t\t->where('visible', 1)\n\t\t\t\t\t->groupBy('name')\n\t\t\t\t\t->get();\n\t}", "public function events()\n {\n $query = Core::query('folder-events');\n $query->bindValue(':folder', $this->_folder['id'], PDO::PARAM_INT);\n $query->execute();\n\n $events = array();\n $_events = $query->fetchAll(PDO::FETCH_NUM);\n foreach ($_events as $event) {\n $events[] = $event[0];\n }\n\n return $events;\n }", "public function getWeeklyEventsByGroupId($group_id=0) {\n\t\t$this->db->select('*');\n\t\t$this->db->join('events e', 'e.entity_id = g.entity_id');\n\t\t$this->db->where('g.group_id', $group_id);\n\t\tif ($this->db->dbdriver === 'mysql') {\n\t\t\t$this->db->where('WEEK(e.start_time,1) = WEEK(NOW(),1)');\n\t\t} else {\n\t\t\t$this->db->where('date_trunc(\\'week\\', e.start_time) = date_trunc(\\'week\\', now())');\n\t\t}\n\t\t$this->db->order_by('start_time', 'ASC');\n\t\t$query = $this->db->get('groups g');\n\t\t$events = $query->result();\n\t\treturn $events;\n\t}", "function getNotificationsByGroup($params) {\n $path_chunks = array('users', $params['id'], 'notifications', '@by-group', $params['groupId']);\n $query_params = array();\n if (array_key_exists('limit', $params)) $query_params['max-results'] = $params['limit'];\n if (array_key_exists('offset', $params)) $query_params['start-index'] = $params['offset'] + 1;\n return $this->typepad->get($path_chunks, $query_params, 'List<Event>');\n }", "function getEvents() {\n\t$alluser = new Event();\n\t$alluser->getAllEvents();\n}", "public function getEvents()\n\t{\n\t\t$fetch = $this->getDb('tools')->fetchAll('SELECT * FROM smartai_events');\n\t\t$events = [];\n\t\tforeach($fetch as $event)\n\t\t\t$events[$event['id']] = $event;\n\t\treturn $events;\n\t}", "function get_future_meetup_events($group)\n {\n $url = $this->meetupBase . '/' . $group . $this->eventsUri;\n return $this->get_meetup_events($group, $url);\n }", "public function get_group_event($data){\n\t\t$data=$this->data_format($data);\n\t\t$res=$this->http_post(self::$url.'/api/equipment_group/get_event', $data, self::$token);\n\t\treturn $res;\n\t}", "public function getEventGroups() {\n\t\treturn ServiceProcess::GetGroups();\n\t}", "public function getAllEventsIds()\n {\n $eventsIds = [];\n $groupEventIds = $this->getGroupEventIds();\n $groupEventData = $this->mapCollection->create()\n ->addFieldToFilter('group_event_id', ['in'=>$groupEventIds])->getData();\n foreach ($groupEventData as $value) {\n $eventIds[] = $value['event_id'];\n }\n return array_unique($eventIds);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to validate a phrase.
function _validatePhrase($phrase) { // Splits on one or more Tab or space. $parts = preg_split('/[ \\x09]+/', $phrase, -1, PREG_SPLIT_NO_EMPTY); $phrase_parts = array(); while (count($parts) > 0){ $phrase_parts[] = $this->_splitCheck($parts, ' '); for ($i = 0; $i < $this->index + 1; $i++) array_shift($parts); } foreach ($phrase_parts as $part) { // If quoted string: if (substr($part, 0, 1) == '"') { if (!$this->_validateQuotedString($part)) { return false; } continue; } // Otherwise it's an atom: if (!$this->_validateAtom($part)) return false; } return true; }
[ "function _validatePhrase($phrase) {\n\t\t// Splits on one or more Tab or space.\n\t\t$parts = preg_split('/[ \\\\x09]+/', $phrase, -1, PREG_SPLIT_NO_EMPTY);\n\n\t\t$phrase_parts = array();\n\n\t\twhile (count($parts) > 0) {\n\t\t\t$phrase_parts[] = $this->_splitCheck($parts, ' ');\n\n\t\t\tfor ($i = 0; $i < $this->index + 1; $i++)\n\t\t\t\tarray_shift ($parts);\n\t\t}\n\n\t\tfor ($i = 0; $i < count($phrase_parts); $i++) {\n\t\t\t// If quoted string:\n\t\t\tif (substr($phrase_parts[$i], 0, 1) == '\"') {\n\t\t\t\tif (!$this->_validateQuotedString($phrase_parts[$i]))\n\t\t\t\t\treturn false;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Otherwise it's an atom:\n\t\t\tif (!$this->_validateAtom($phrase_parts[$i]))\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validate($phrase, $phraseID){\r\n switch($phraseID){\r\n\r\n case 4: //Validate date ##/##/####\r\n if((bool)preg_match(\"^\\\\d{1,2}/\\\\d{2}/\\\\d{4}^\",$phrase)){\r\n return(\"Phrase Validated!\");\r\n }else{return(\"Phrase Invalid - Please format date correctly!\");}\r\n break;\r\n case 5: //Contains 0-9 or A-F\r\n if((bool)preg_match(\"^[A-F|\\d]+$^\",$phrase)){\r\n return(\"Phrase Validated!\");\r\n }else{return(\"Phrase Invalid - Please ensure it contains 0-9 or A-F only!\");}\r\n break;\r\n\r\n }\r\n \r\n\r\n}", "public function test_example()\n {\n $this->assertTrue( (new PassPhrase('abcde fghij'))->validate());\n $this->assertTrue( (new PassPhrase('a ab abc abd abf abj'))->validate());\n $this->assertTrue( (new PassPhrase('iiii oiii ooii oooi oooo'))->validate());\n $this->assertFalse( (new PassPhrase('abcde xyz ecdab'))->validate());\n $this->assertFalse( (new PassPhrase('oiii ioii iioi iiio'))->validate());\n }", "abstract protected function valid_word($word);", "private function isPhraseAllowed($phrase) {\n if (strlen($phrase) == 1) return false; //remove stuff like I.\n\n if (preg_match(\"/^\\w/i\", $phrase) === 0) return false; //remove anything that doesn't start with a letter or a number\n\n return true;\n }", "function phrase_valide($phrase){\n\tif (preg_match(\"#^[A-Z].*[\\.!?]$#\", $phrase)) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function validate($string);", "public function isPangram(string $phrase){\n if(is_string($phrase) && $phrase != ''){\n //$engAlphabets variable holds all the english alphabet letters from a to z in lower case\n $engAlphabets = range('a','z');\n\n //remove space from $phrase\n $noSpacePhrase = str_replace(' ','',$phrase);\n\n //convert $noSpacePhrase to an array of its letters in lower case\n $phraseArray = str_split(strtolower($noSpacePhrase));\n \n //$result is an array of unique letters of the $phraseArray that exist in the $engAlphabets array at least once\n $result = array_intersect($engAlphabets, $phraseArray);\n\n //check if the $results array has 26 elements (English Alphabets has 26 letters)\n if(count($result) == 26){\n return true;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n \n }", "function isSearchTermValid(){\n $errorMessage = null;\n if (!isset($_POST['searchTerm']) or trim($_POST['searchTerm']) == '')\n $errorMessage = \"You must enter something!\";\n\n if ($errorMessage !== null)\n {\n echo <<<EOM\n <p>Error: $errorMessage</p>\nEOM;\n return False;\n }\n return True;\n }", "function validate( $str, $for, $regex, $err_msg ){\n\t\tif( !preg_match( $regex, $str ) ){\n\t\t\techo createJSONMessage( GENERAL_ERROR_MESSAGE, $for, $err_msg );\n\t\t\texit();\n\t\t}\n\t}", "function validate_capture_phrases($keywords) {\n $illegal_chars = array( \"\\t\", \"\\n\", \";\", \"(\", \")\" );\n foreach ($illegal_chars as $c) {\n if (strpos($keywords, $c) !== FALSE) {\n return FALSE;\n }\n }\n return TRUE;\n}", "function hasPhrase($phrase, $field = null) {\n\n // we have to search in the formatted fields and not in the raw entry\n // i.e. all latex markups are not considered for searches\n if (!$field) {\n return preg_match('/'.$phrase.'/i',$this->getConstants().' '.join(\" \",$this->getFields()));\n //return stripos($this->getText(), $phrase) !== false;\n }\n if ($this->hasField($field) && (preg_match('/'.$phrase.'/i',$this->getField($field)) ) ) {\n //if ($this->hasField($field) && (stripos($this->getField($field), $phrase) !== false) ) {\n return true;\n }\n\n return false;\n }", "public function check($word);", "function verificateur_longueur_phrase(string $texte){\r\n if (strlen($texte)<=200) {\r\n return true;\r\n }else {\r\n return false;\r\n }\r\n \r\n}", "private function validateReasonPhrase($reasonPhrase): void\n {\n if ('' === $reasonPhrase) {\n return;\n }\n\n if (!is_string($reasonPhrase)) {\n throw new InvalidArgumentException('HTTP reason phrase must be a string');\n }\n\n if (!preg_match(HeaderInterface::RFC7230_FIELD_VALUE_REGEX, $reasonPhrase)) {\n throw new InvalidArgumentException('Invalid HTTP reason phrase');\n }\n }", "public function sanitize_keyphrases($keyphrase) {\n\n\t\t// Replace multiple spaces/tabs with a single space\n\t\t$keyphrase = preg_replace('/\\s+/', ' ', $keyphrase);\n\t\n\t\t// Strip white spaces, tabs and other blank characters from the beginning and end of the string\n\t\t$keyphrase = trim($keyphrase);\n\n\t\tif ( !empty($keyphrase) ) {\n\t\n\t\t\treturn $keyphrase;\n\t\t} else {\n\t\n\t\t\treturn false;\n\t\t}\n\t}", "private function validateInput(){\n\t\t$len = $this->getWordLengthNoSpaces($this->wordList[0]);\n\n\t\tfor($i = 1; $i < count($this->wordList); $i++){\n\t\t\t$nextLen = $this->getWordLengthNoSpaces($this->wordList[$i]);\n\n\t\t\tif(($len) != $nextLen){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// $len++;\n\t\t}\n\n\t\treturn true;\n\t}", "function phoneIsValid($str){\n return isNumeric($str) && hasLength($str, PHONE_LENGTH, PHONE_LENGTH);\n}", "function checkSurname()\r\n\t{\r\n\t\tif ($_POST[\"surname\"] == \"\" || !(filter_var($_POST[\"surname\"], FILTER_SANITIZE_STRING) == $_POST[\"surname\"] && str_replace(\" \", \"\", $_POST[\"surname\"]) == $_POST[\"surname\"] && preg_match('/^[a-z-]+$/i', $_POST[\"surname\"])))\r\n\t\t{\r\n\t\t\t$GLOBALS['errorSurname'] = \"invalid surname\";\t\r\n\t\t} \r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method that get entity of current movement based on the type and type id of it
private function getEntityOfTypeMovement(int $type, int $type_id) { $entity = null; if ($type === \App\Entity\UnitMovement::TYPE_MISSION) { $entity = \App\Entity\Mission::class; } else if ($type === \App\Entity\UnitMovement::TYPE_ATTACK) { $entity = Base::class; } if (!$entity) { return null; } return $this->em->getRepository($entity)->find($type_id); }
[ "public function getPointEntity();", "public function getMove();", "public static function getMovementByMovementType(PDO &$pdo, $newMovementType) {\n\t\t// sanitize the movementType before searching\n\t\t$newMovementType = trim($newMovementType);\n\t\t$newMovementType = filter_var($newMovementType, FILTER_SANITIZE_STRING);\n\t\tif(empty($newMovementType) === true) {\n\t\t\tthrow(new InvalidArgumentException(\"movementType is empty or insecure\"));\n\t\t}\n\n\t\t// verify the movementType will fit in the database\n\t\tif(strlen($newMovementType) > 2) {\n\t\t\tthrow(new RangeException(\"movementType is too large\"));\n\t\t}\n\t\tif(strlen($newMovementType) < 2) {\n\t\t\tthrow(new RangeException(\"movementType is too small\"));\n\t\t}\n\n\t\t// create query template\n\t\t$query\t = \"SELECT movementId, fromLocationId, toLocationId, productId, unitId, userId, cost, movementDate, movementType, price FROM movement WHERE movementType = :movementType\" ;\n\t\t$statement = $pdo->prepare($query);\n\n\t\t// bind the movementType to the place holder in the template\n\t\t$parameters = array(\"movementType\" => $newMovementType);\n\t\t$statement->execute($parameters);\n\n\t\t// build an array of movements\n\t\t$movements = new SplFixedArray($statement->rowCount());\n\t\t$statement->setFetchMode(PDO::FETCH_ASSOC);\n\t\twhile(($row = $statement->fetch()) !== false) {\n\t\t\ttry {\n\t\t\t\t$movement = new Movement($row[\"movementId\"], $row[\"fromLocationId\"], $row[\"toLocationId\"], $row[\"productId\"], $row[\"unitId\"], $row[\"userId\"], $row[\"cost\"], $row[\"movementDate\"], $row[\"movementType\"], $row[\"price\"]);\n\t\t\t\t$movements[$movements->key()] = $movement;\n\t\t\t\t$movements->next();\n\t\t\t} catch(Exception $exception) {\n\t\t\t\t// if the row couldn't be converted, rethrow it\n\t\t\t\tthrow(new PDOException($exception->getMessage(), 0, $exception));\n\t\t\t}\n\t\t}\n\t\treturn($movements);\n\t}", "public function getById(MoveId $moveId) : Move;", "public function getPositionTypeById($id){\n $sql=\"SELECT `tbl_position`.`positiontype_id` FROM `tbl_position` WHERE `tbl_position`.`id` ='$id'\";\n $objdata=new CLS_MYSQL();\n $objdata->Query($sql);\n $row=$objdata->Fetch_Assoc();\n return $row['positiontype_id'];\n}", "public function getByGenerationAndMove(\n\t\tGenerationId $generationId,\n\t\tMoveId $moveId\n\t) : GenerationMove {\n\t\t$stmt = $this->db->prepare(\n\t\t\t'SELECT\n\t\t\t\t`type_id`,\n\t\t\t\t`quality_id`,\n\t\t\t\t`category_id`,\n\t\t\t\t`power`,\n\t\t\t\t`accuracy`,\n\t\t\t\t`pp`,\n\t\t\t\t`priority`,\n\t\t\t\t`min_hits`,\n\t\t\t\t`max_hits`,\n\t\t\t\t`infliction_id`,\n\t\t\t\t`infliction_percent`,\n\t\t\t\t`min_turns`,\n\t\t\t\t`max_turns`,\n\t\t\t\t`crit_stage`,\n\t\t\t\t`flinch_percent`,\n\t\t\t\t`effect`,\n\t\t\t\t`effect_percent`,\n\t\t\t\t`recoil_percent`,\n\t\t\t\t`heal_percent`,\n\t\t\t\t`target_id`,\n\t\t\t\t`z_move_id`,\n\t\t\t\t`z_base_power`,\n\t\t\t\t`z_power_effect_id`,\n\t\t\t\t`max_move_id`,\n\t\t\t\t`max_power`\n\t\t\tFROM `generation_moves`\n\t\t\tWHERE `generation_id` = :generation_id\n\t\t\t\tAND `move_id` = :move_id\n\t\t\tLIMIT 1'\n\t\t);\n\t\t$stmt->bindValue(':generation_id', $generationId->value(), PDO::PARAM_INT);\n\t\t$stmt->bindValue(':move_id', $moveId->value(), PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\tif (!$result) {\n\t\t\tthrow new GenerationMoveNotFoundException(\n\t\t\t\t'No generation move exists with generation id '\n\t\t\t\t. $generationId->value() . ' and move id ' . $moveId->value()\n\t\t\t\t. '.'\n\t\t\t);\n\t\t}\n\n\t\t$qualityId = $result['quality_id'] !== null\n\t\t\t? new QualityId($result['quality_id'])\n\t\t\t: null;\n\t\t$inflictionId = $result['infliction_id'] !== null\n\t\t\t? new InflictionId($result['infliction_id'])\n\t\t\t: null;\n\t\t$zMoveId = $result['z_move_id'] !== null\n\t\t\t? new MoveId($result['z_move_id'])\n\t\t\t: null;\n\t\t$zPowerEffectId = $result['z_power_effect_id'] !== null\n\t\t\t? new ZPowerEffectId($result['z_power_effect_id'])\n\t\t\t: null;\n\t\t$maxMoveId = $result['max_move_id'] !== null\n\t\t\t? new MoveId($result['max_move_id'])\n\t\t\t: null;\n\n\t\t$generationMove = new GenerationMove(\n\t\t\t$generationId,\n\t\t\t$moveId,\n\t\t\tnew TypeId($result['type_id']),\n\t\t\t$qualityId,\n\t\t\tnew CategoryId($result['category_id']),\n\t\t\t$result['power'],\n\t\t\t$result['accuracy'],\n\t\t\t$result['pp'],\n\t\t\t$result['priority'],\n\t\t\t$result['min_hits'],\n\t\t\t$result['max_hits'],\n\t\t\t$inflictionId,\n\t\t\t$result['infliction_percent'],\n\t\t\t$result['min_turns'],\n\t\t\t$result['max_turns'],\n\t\t\t$result['crit_stage'],\n\t\t\t$result['flinch_percent'],\n\t\t\t$result['effect'],\n\t\t\t$result['effect_percent'],\n\t\t\t$result['recoil_percent'],\n\t\t\t$result['heal_percent'],\n\t\t\tnew TargetId($result['target_id']),\n\t\t\t$zMoveId,\n\t\t\t$result['z_base_power'],\n\t\t\t$zPowerEffectId,\n\t\t\t$maxMoveId,\n\t\t\t$result['max_power']\n\t\t);\n\n\t\treturn $generationMove;\n\t}", "abstract public function getEntity();", "public function getCurrentMovementsInBase(): array\n\t{\n\t\t$base = $this->globals->getCurrentBase();\n\t\t$this->updateUnitMovement($base);\n\t\t$time_before_show_attack = $this->globals->getGeneralConfig()[\"seconds_before_show_attack\"];\n\t\t$unit_movements = $this->em->getRepository(\\App\\Entity\\UnitMovement::class)->findMovementsByBase($base);\n\t\t$return_movements = [];\n\t\t$now = (new DateTime())->getTimestamp();\n\n\t\tforeach ($unit_movements as $unit_movement) {\n\t\t\t$entity_type = $this->getEntityOfTypeMovement($unit_movement->getType(), $unit_movement->getTypeId());\n\t\t\t$end_date = $unit_movement->getEndDate()->getTimestamp();\n\t\t\tif (($entity_type instanceof Base && $entity_type->getId() === $base->getId() && ($end_date - $now <= $time_before_show_attack) || ($unit_movement->getBase() === $base))) {\n\t\t\t\t$name = \"\";\n\t\t\t\tif ($entity_type instanceof Base) {\n\t\t\t\t\t$name = $entity_type->getName();\n\t\t\t\t}\n\n\t\t\t\t$units = [];\n\t\t\t\tif ($unit_movement->getBase() === $base) {\n\t\t\t\t\t$units = $this->em->getRepository(\\App\\Entity\\UnitMovement::class)->findByUnitsInMovement($unit_movement);\n\t\t\t\t}\n\n\t\t\t\t$return_movements[] = [\n\t\t\t\t\t\"end_date\" => $end_date,\n\t\t\t\t\t\"string_type\" => $unit_movement->getStringType(),\n\t\t\t\t\t\"entity_name\" => $name,\n\t\t\t\t\t\"base_id\" => $unit_movement->getBase()->getId(),\n\t\t\t\t\t\"base_name\" => $unit_movement->getBase()->getName(),\n\t\t\t\t\t\"movement_type_string\" => $unit_movement->getStringMovementType(),\n\t\t\t\t\t\"units\" => $units\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\treturn $return_movements;\n\t}", "function remote_entity_load($entity_type, $id) {\n $query = $this->getRemoteEntityQuery('select');\n $query->base($entity_type);\n $query->entityCondition('entity_id', $id);\n $result = $query->execute();\n //dsm($result, 'remote_entity_load $result');\n\n // There's only one. Same pattern as entity_load_single().\n return reset($result);\n }", "public function getSliderById($type,$id)\n {\n try{\n return $this->model->where('type','=',$type)->where('uniqueId','=',$id)->first();\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function getPositionType($id){\n \n \t\n $select = $this->select();\n $select->where(\"id = ?\", $id );\n \n $row = $this->fetchRow($select);\n\n if(count($row)){\n \n return $row->type;\n \n }else{\n \t\n \treturn false;\n }\n \n }", "public function findByCurrentMovements(Base $base)\n\t{\n\t\t$query = $this->getEntityManager()->createQuery(\"SELECT mm FROM App:MarketMovement mm\n\t\t\tWHERE (mm.base = :base OR (mm.baseDest = :base AND mm.type = :go_movement)) AND mm.end_date >= :now\n\t\t\");\n\n\t\t$query->setParameter(\"base\", $base, Type::OBJECT);\n\t\t$query->setParameter(\"go_movement\", MarketMovement::TYPE_GO, Type::INTEGER);\n\t\t$query->setParameter(\"now\", new \\DateTime(), Type::DATETIME);\n\n\t\treturn $query->getResult();\n\t}", "function getEntityById($classType, $id) \n {\n $entityManager = $this->manager;\n $entity = $entityManager->getRepository($classType)->find($id);\n return $entity;\n }", "protected function insertGetEntityInstance(){\n $entity = $this->getEntityInstance();\n return $entity;\n }", "public function getNewPosition($type = null)\n {\n return count($this->findBy(['type' => $type]));\n }", "public function routeEntity() {\n // If the current route has no parameters, return.\n if (!($route = $this->routeMatch\n ->getRouteObject()) || !($parameters = $route\n ->getOption('parameters'))) {\n return;\n }\n\n // Determine if the current route represents an entity.\n foreach ($parameters as $name => $options) {\n if (!isset($options['type']) || strpos($options['type'], 'entity:') !== 0) {\n continue;\n }\n\n $entity = $this->routeMatch->getParameter($name);\n if ($entity instanceof ContentEntityInterface) {\n return $entity;\n }\n\n // Since entity was found, no need to iterate further.\n return;\n }\n }", "public function get(string $type, string $id);", "public function getMovements()\n {\n return $this->hasOne(Movements::className(), ['id' => 'movements_id'])->inverseOf('records');\n }", "public function movements()\n {\n return $this->hasManyThrough( Movement::class, DepotItem::class );\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'defCandidateDocumenttypesGet'
protected function defCandidateDocumenttypesGetRequest() { $resourcePath = '/def/candidate/documenttypes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function docReferenceTypesRequest()\n {\n\n $resourcePath = '/v2/dataelements/docreferencetypes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getDocumentOperationTypesRequest()\n {\n\n $resourcePath = '/v2/dataelements/docoperationtypes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function prepareDocumentSearchFormResources()\n {\n /* @var $documentsCategoryDao \\DDD\\Dao\\Document\\Category */\n $documentsCategoryDao = $this->getServiceLocator()->get('dao_document_category');\n $documentsCategoryList = $documentsCategoryDao->getList();\n\n return [\n 'document_types' => $documentsCategoryList\n ];\n }", "public function getTypes()\n {\n $this->makeRequest('GET','/documenttypes');\n return $this->response->result;\n }", "public function getDocumentTypes(): array;", "public function createDocTypes()\n {\n return $this->morphToMany('App\\Models\\DocType', 'role', 'doc_type_role');\n }", "public function getTypesDocument(){\n if (Server::RequestMethod(\"POST\")) {\n $tiposDocumentos = $this->_global->getAllTypeClients();\n\n $html = '<option value=\"\"></option>';\n foreach ($tiposDocumentos as $row) {\n $html .= \"<option value='\" . $row['id'] . \"'>\" . $row['descripcion'] . \"(\" . $row['codigo'] . \")\" . \"</option>\";\n }\n echo $html;\n } else {\n $this->redireccionar(\"../login\");\n }\n }", "public function getAllDocumentTypes(){\n if($this->getToken() == false){\n return false;\n }else{\n $response = Http::post($this->_endpointUrl.\"documents/getAllDocumentTypes/?access_token=$this->accessToken&json=true\", [\n 'language_id' => 1\n ]);\n return $this->checkValidResponse($response);\n }\n }", "function getDocumentTypes() {\n\t\tglobal $default;\n\t\t$aDocumentTypes = array();\n\t\t$sql = $default->db;\n\t\t$sQuery = \"SELECT document_type_id FROM \" . $default->document_type_fields_table . \" WHERE field_id = ?\";/*ok*/\n $aParams = array($this->iId);\n\t\tif ($sql->query(array($sQuery, $aParams))) {\n\t\t\twhile ($sql->next_record()) {\n \t\t\t$aDocumentTypes[] = & DocumentType::get($sql->f(\"document_type_id\"));\n \t\t}\n\t\t\treturn $aDocumentTypes;\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getDocTypes()\n {\n return $this->hasMany(DocTypes::className(), ['doc_maintypes_id' => 'id']);\n }", "protected function qualificationDocumentStatusesRequest()\n {\n\n $resourcePath = '/v2/dataelements/qualificationdocumentstatuses';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_document_types() {\n\t\t\treturn array(\n\t\t\t\t'single' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug(),\n\t\t\t\t\t'name' => __( 'Single', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-single.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_Document',\n\t\t\t\t),\n\t\t\t\t'archive' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug() . '-archive',\n\t\t\t\t\t'name' => __( 'Archive Item', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-archive-product.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_Archive_Document_Product',\n\t\t\t\t),\n\t\t\t\t'category' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug() . '-category',\n\t\t\t\t\t'name' => __( 'Category Item', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-archive-category.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_Archive_Document_Category',\n\t\t\t\t),\n\t\t\t\t'shop' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug() . '-shop',\n\t\t\t\t\t'name' => __( 'Shop', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-archive.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_Shop_Document',\n\t\t\t\t),\n\t\t\t\t'cart' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug() . '-cart',\n\t\t\t\t\t'name' => __( 'Cart', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-cart.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_Cart_Document',\n\t\t\t\t),\n\t\t\t\t'checkout' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug() . '-checkout',\n\t\t\t\t\t'name' => __( 'Checkout', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-checkout.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_Checkout_Document',\n\t\t\t\t),\n\t\t\t\t'thankyou' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug() . '-thankyou',\n\t\t\t\t\t'name' => __( 'Thank You', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-thankyou.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_ThankYou_Document',\n\t\t\t\t),\n\t\t\t\t'myaccount' => array(\n\t\t\t\t\t'slug' => jet_woo_builder_post_type()->slug() . '-myaccount',\n\t\t\t\t\t'name' => __( 'My Account', 'jet-woo-builder' ),\n\t\t\t\t\t'file' => 'includes/documents/class-jet-woo-builder-document-myaccount.php',\n\t\t\t\t\t'class' => 'Jet_Woo_Builder_MyAccount_Document',\n\t\t\t\t),\n\t\t\t);\n\t\t}", "protected function vehiclesTypesListRequest()\n {\n\n $resourcePath = '/vehicles/types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function docTypes()\n {\n return $this->hasMany('App\\Models\\DocType');\n }", "protected function customerDocumentGetAllDocumentsRequest($document_type = null, $released = null, $dunning_level = null, $closed_financial_period = null, $dunning_letter_date_time = null, $dunning_letter_date_time_condition = null, $project = null, $expand_applications = null, $expand_dunning_information = null, $expand_attachments = null, $expand_tax_details = null, $expand_invoice_address = null, $financial_period = null, $document_due_date = null, $status = null, $number_to_read = null, $skip_records = null, $external_reference = null, $payment_reference = null, $customer_ref_number = null, $greater_than_value = null, $last_modified_date_time = null, $last_modified_date_time_condition = null, $created_date_time = null, $created_date_time_condition = null, $page_number = null, $page_size = null)\n {\n\n $resourcePath = '/controller/api/v1/customerdocument';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($document_type !== null) {\n $queryParams['documentType'] = ObjectSerializer::toQueryValue($document_type);\n }\n // query params\n if ($released !== null) {\n $queryParams['released'] = ObjectSerializer::toQueryValue($released);\n }\n // query params\n if ($dunning_level !== null) {\n $queryParams['dunningLevel'] = ObjectSerializer::toQueryValue($dunning_level);\n }\n // query params\n if ($closed_financial_period !== null) {\n $queryParams['closedFinancialPeriod'] = ObjectSerializer::toQueryValue($closed_financial_period);\n }\n // query params\n if ($dunning_letter_date_time !== null) {\n $queryParams['dunningLetterDateTime'] = ObjectSerializer::toQueryValue($dunning_letter_date_time);\n }\n // query params\n if ($dunning_letter_date_time_condition !== null) {\n $queryParams['dunningLetterDateTimeCondition'] = ObjectSerializer::toQueryValue($dunning_letter_date_time_condition);\n }\n // query params\n if ($project !== null) {\n $queryParams['project'] = ObjectSerializer::toQueryValue($project);\n }\n // query params\n if ($expand_applications !== null) {\n $queryParams['expandApplications'] = ObjectSerializer::toQueryValue($expand_applications);\n }\n // query params\n if ($expand_dunning_information !== null) {\n $queryParams['expandDunningInformation'] = ObjectSerializer::toQueryValue($expand_dunning_information);\n }\n // query params\n if ($expand_attachments !== null) {\n $queryParams['expandAttachments'] = ObjectSerializer::toQueryValue($expand_attachments);\n }\n // query params\n if ($expand_tax_details !== null) {\n $queryParams['expandTaxDetails'] = ObjectSerializer::toQueryValue($expand_tax_details);\n }\n // query params\n if ($expand_invoice_address !== null) {\n $queryParams['expandInvoiceAddress'] = ObjectSerializer::toQueryValue($expand_invoice_address);\n }\n // query params\n if ($financial_period !== null) {\n $queryParams['financialPeriod'] = ObjectSerializer::toQueryValue($financial_period);\n }\n // query params\n if ($document_due_date !== null) {\n $queryParams['documentDueDate'] = ObjectSerializer::toQueryValue($document_due_date);\n }\n // query params\n if ($status !== null) {\n $queryParams['status'] = ObjectSerializer::toQueryValue($status);\n }\n // query params\n if ($number_to_read !== null) {\n $queryParams['numberToRead'] = ObjectSerializer::toQueryValue($number_to_read);\n }\n // query params\n if ($skip_records !== null) {\n $queryParams['skipRecords'] = ObjectSerializer::toQueryValue($skip_records);\n }\n // query params\n if ($external_reference !== null) {\n $queryParams['externalReference'] = ObjectSerializer::toQueryValue($external_reference);\n }\n // query params\n if ($payment_reference !== null) {\n $queryParams['paymentReference'] = ObjectSerializer::toQueryValue($payment_reference);\n }\n // query params\n if ($customer_ref_number !== null) {\n $queryParams['customerRefNumber'] = ObjectSerializer::toQueryValue($customer_ref_number);\n }\n // query params\n if ($greater_than_value !== null) {\n $queryParams['greaterThanValue'] = ObjectSerializer::toQueryValue($greater_than_value);\n }\n // query params\n if ($last_modified_date_time !== null) {\n $queryParams['lastModifiedDateTime'] = ObjectSerializer::toQueryValue($last_modified_date_time);\n }\n // query params\n if ($last_modified_date_time_condition !== null) {\n $queryParams['lastModifiedDateTimeCondition'] = ObjectSerializer::toQueryValue($last_modified_date_time_condition);\n }\n // query params\n if ($created_date_time !== null) {\n $queryParams['createdDateTime'] = ObjectSerializer::toQueryValue($created_date_time);\n }\n // query params\n if ($created_date_time_condition !== null) {\n $queryParams['createdDateTimeCondition'] = ObjectSerializer::toQueryValue($created_date_time_condition);\n }\n // query params\n if ($page_number !== null) {\n $queryParams['pageNumber'] = ObjectSerializer::toQueryValue($page_number);\n }\n // query params\n if ($page_size !== null) {\n $queryParams['pageSize'] = ObjectSerializer::toQueryValue($page_size);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('ipp-application-type');\n if ($apiKey !== null) {\n $headers['ipp-application-type'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('ipp-company-id');\n if ($apiKey !== null) {\n $headers['ipp-company-id'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_type_document_select ( Request $request, $type = '' )\n {\n if ( $type == 'F' ) \n $data = Db::table('documents')\n ->where( 'name', 'NOT LIKE', '%CUIT%' )\n ->select('name', 'id')\n ->orderBy('name', 'ASC')\n ->get();\n else\n if ( $type == 'J' ) \n $data = Db::table('documents')\n ->where( 'name', 'like', '%CUIT%' )\n ->select('name', 'id')\n ->orderBy('name', 'ASC')\n ->get();\n else\n $data = Db::table('documents')\n ->select('name', 'id')\n ->orderBy('name', 'ASC')\n ->get();\n\n return $data; \n }", "function makeDocumentTypeArray(){\n\t\n\t\t $typeParameter = \"\";\n\t\t $DocumentTypes = array();\n\t\t if($this->substance){\n\t\t\t $DocumentTypes[] = \"substance\";\n\t\t }\n\t\t if($this->spatial){\n\t\t\t $this->defaultSort = false; //sort by interest score\n\t\t\t $DocumentTypes[] = \"spatial\";\n\t\t }\n\t\t if($this->image){\n\t\t\t $DocumentTypes[] = \"image\";\n\t\t }\n\t\t if($this->video){\n\t\t\t $DocumentTypes[] = \"video\";\n\t\t }\n\t\t if($this->person){\n\t\t\t $DocumentTypes[] = \"person\";\n\t\t }\n\t\t if($this->project){\n\t\t\t $DocumentTypes[] = \"project\";\n\t\t }\n\t\t if($this->document){\n\t\t\t $DocumentTypes[] = \"document\";\n\t\t }\n\t\t if($this->table){\n\t\t\t $DocumentTypes[] = \"table\";\n\t\t }\n\t\t if($this->site){\n\t\t\t $DocumentTypes[] = \"site\";\n\t\t }\n\t\t if($this->media){\n\t\t\t $DocumentTypes[] = \"acrobat pdf\";\n\t\t\t $DocumentTypes[] = \"external\";\n\t\t\t $DocumentTypes[] = \"KML\";\n\t\t\t $DocumentTypes[] = \"GIS\";\n\t\t }\n\t \n\t\t return $DocumentTypes;\n }", "protected function getcandidatefilesRequest($id, $original_cv = null, $doc_type_ids = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling getcandidatefiles'\n );\n }\n\n $resourcePath = '/candidate/{id}/files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($original_cv !== null) {\n $queryParams['original_cv'] = ObjectSerializer::toQueryValue($original_cv);\n }\n // query params\n if (is_array($doc_type_ids)) {\n $doc_type_ids = ObjectSerializer::serializeCollection($doc_type_ids, 'multi', true);\n }\n if ($doc_type_ids !== null) {\n $queryParams['doc_type_ids'] = ObjectSerializer::toQueryValue($doc_type_ids);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getDocumentTypes() {\n \n if (isset($this->docTypes)) {\n unset($this->docTypes);\n }\n\n // open database connection\n \n $this->db->getDBConnection();\n \n // check for errors\n \n if (!$this->db->con->connect_error ) {\n \n // get document types\n \n $query = \"CALL usp_getDocumentTypes;\";\n $result = mysqli_query($this->db->con, $query);\n while ($row = mysqli_fetch_assoc($result)) {\n $this->docTypes[] = $row['typeDescription'];\n }\n \n // close result and database connection\n \n if ($result && isset($this->docTypes)) {\n $result->close();\n }\n $this->db->closeDBConnection();\n \n // return document types\n \n if (isset($this->docTypes)) {\n return $this->docTypes;\n } else {\n $_SESSION['displayMessage'] = InfoMessage::dbNoRecords();\n return false;\n }\n } else {\n $_SESSION['displayMessage'] = InfoMessage::dbConnectError();\n $this->db->closeDBConnection();\n return false;\n } \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loads the wrapee getter for that property
protected abstract function loadWrapeeGetter($property);
[ "public function __invokePropertyGetter($property);", "public function __get( $prop )\n\t{\n\t\treturn $this->bean->$prop;\n\t}", "function openal_listener_get($property){}", "protected function addGetterSetter(string $property) {\n $propertyName = $this->parseMethodName($property, '');\n $getter = \"get{$propertyName}\";\n $setter = \"set{$propertyName}\";\n\n /**\n * @var \\Cathedral\\Db\\ValueType $vt\n */\n // Extract array to $type, $default, $primary\n [\n 'type' => $type,\n 'default' => $default,\n 'primary' => $primary,\n 'vt' => $vt,\n 'nullable' => $nullable,\n ] = $this->getNames()->properties[$property];\n\n // METHODS\n // ===============================================\n // METHOD:getProperty\n // ===============================================\n $method = $this->buildMethod($getter);\n if ($nullable) $method->setReturnType('?' . $type);\n else $method->setReturnType($type);\n\n $bodyNullable = $nullable ? \"\\$this->data['{$property}'] === null ? null :\" : '';\n\n if ($type == 'array') {\n $body = <<<M_BODY\n\\$json = \\$this->data['{$property}'];\nif (is_string(\\$json)) \\$json = Json::decode(\\$json, Json::TYPE_ARRAY);\nreturn \\$json;\nM_BODY;\n } else if ($type == 'int') {\n $body = <<<M_BODY\nreturn {$bodyNullable} intval(\\$this->data['{$property}']);\nM_BODY;\n } else if ($type == 'float') {\n $body = <<<M_BODY\nreturn {$bodyNullable} floatval(\\$this->data['{$property}']);\nM_BODY;\n } else {\n $body = <<<M_BODY\nreturn \\$this->data['{$property}'];\nM_BODY;\n }\n\n $method->setBody($body);\n $method->setDocBlock(DocBlockGenerator::fromArray([\n 'shortDescription' => \"Get the {$property} property\",\n 'tags' => [\n new ReturnTag([\n 'datatype' => $type . ($nullable ? '|null' : '')\n ])\n ]\n ]));\n $this->_class->addMethodFromGenerator($method);\n\n // ===============================================\n // METHOD:setProperty\n // ===============================================\n $parameterSetter = new ParameterGenerator();\n $parameterSetter->setName($property);\n if ($vt === ValueType::JSON) $parameterSetter->setType('null|string|' . $type);\n else if ($nullable) $parameterSetter->setType('?' . $type);\n else if (!is_null($default)) {\n $parameterSetter->setType($type);\n $parameterSetter->setDefaultValue($default);\n } else $parameterSetter->setType($type);\n\n $method = $this->buildMethod($setter);\n $method->setParameter($parameterSetter);\n $method->setReturnType($this->getNames()->namespace_entity . '\\\\' . $this->getNames()->entityName);\n $body = <<<M_BODY\n\\$this->data['{$property}'] = \\${$property};\nreturn \\$this;\nM_BODY;\n\n if ($type == 'array') $body = <<<M_BODY\nif (!is_string(\\${$property})) \\${$property} = Json::encode(\\${$property});\n{$body}\nM_BODY;\n\n $method->setBody($body);\n $method->setDocBlock(DocBlockGenerator::fromArray([\n 'shortDescription' => \"Set the {$property} property\",\n 'tags' => [\n new ParamTag($property, [\n 'datatype' => $type\n ]),\n new ReturnTag([\n 'datatype' => $this->getNames()->entityName\n ])\n ]\n ]));\n $this->_class->addMethodFromGenerator($method);\n }", "function __get($prop) {\n echo 'this property called '.$prop.' does not exist';\n }", "function __get($prop)\n {\n // // var_dump((isset($this->$prop)), \"Called \" . $prop);\n // if(isset($this->$prop))\n // {\n return $this->$prop;\n // };\n // return false;\n }", "public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }", "abstract protected function load_lazy_property( $property );", "function getter(string $property): string\n {\n return 'get' . Str::studly($property);\n }", "public function __get($key) {\n if (method_exists($this, 'get_'.$key)) {\n return $this->{'get_'.$key}();\n }\n return $this->properties->{$key};\n }", "public function __get($name)\n\t{\n\t\t$getter='get'.$name;\n\t\tif(method_exists($this,$getter))\n\t\t\treturn $this->$getter();\n\t\telseif(strncasecmp($name,'on',2)===0 && method_exists($this,$name))\n\t\t{\n\t\t\t// duplicating getEventHandlers() here for performance\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset($this->_e[$name]))\n\t\t\t\t$this->_e[$name]=new CList;\n\t\t\treturn $this->_e[$name];\n\t\t}\n\t\telseif(isset($this->_m[$name]))\n\t\t\treturn $this->_m[$name];\n\t\telseif(is_array($this->_m))\n\t\t{\n\t\t\tforeach($this->_m as $object)\n\t\t\t{\n\t\t\t\tif($object->getEnabled() && (property_exists($object,$name) || $object->canGetProperty($name)))\n\t\t\t\t\treturn $object->$name;\n\t\t\t}\n\t\t}\n\t\tthrow new CException(Yii::t('yii','Property \"{class}.{property}\" is not defined.',\n\t\t\tarray('{class}'=>get_class($this), '{property}'=>$name)));\n\t}", "public function __getPropertyGetterName($property);", "protected function getPropertyAccessor()\n {\n return PropertyAccess::createPropertyAccessor();\n }", "public function __get($prop){\n\t\tif ($this->container->{$prop}) {\n\t\t\treturn $this->container->{$prop};\n\t\t}\n\t}", "function __get($key) {\n if (method_exists($this, 'get_' . $key)) {\n return $this->{'get_' . $key}();\n }\n if (!isset($this->properties->{$key})) {\n throw new coding_exception('Undefined property requested (' . $key . ')');\n }\n return $this->properties->{$key};\n }", "public function __get($name)\r\n\t{\r\n\t\t$getter='get'.$name; $jsgetter = 'getjs'.$name;\r\n\t\tif(method_exists($this,$getter))\r\n\t\t{\r\n\t\t\t// getting a property\r\n\t\t\treturn $this->$getter();\r\n\t\t}\r\n\t\telse if(method_exists($this,$jsgetter))\r\n\t\t{\r\n\t\t\t// getting a property\r\n\t\t\treturn (string)$this->$jsgetter();\r\n\t\t}\r\n\t\telse if(strncasecmp($name,'on',2)===0 && method_exists($this,$name))\r\n\t\t{\r\n\t\t\t// getting an event (handler list)\r\n\t\t\t$name=strtolower($name);\r\n\t\t\tif(!isset($this->_e[$name]))\r\n\t\t\t\t$this->_e[$name]=new TList;\r\n\t\t\treturn $this->_e[$name];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new TInvalidOperationException('component_property_undefined',get_class($this),$name);\r\n\t\t}\r\n\t}", "final protected function getPropertyAccessor()\n {\n return PropertyAccess::createPropertyAccessor();\n }", "public function getSomeProperty()\n {\n return $this->someProperty;\n }", "public function __get($attribute) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new insuranceFee This field is no longer applicable as it is no longer possible for a seller to offer a buyer shipping insurance.
public function setInsuranceFee(\Nogrod\eBaySDK\Trading\AmountType $insuranceFee) { $this->insuranceFee = $insuranceFee; return $this; }
[ "public function setInvoiceFee($invoiceFee)\n {\n $this->invoiceFee = floatval($invoiceFee);\n }", "public function setFee($fee)\n {\n $this->fee = (int) $fee;\n }", "function setFee($a_iFee)\n {\n $this->_iFee = (int) $a_iFee;\n $this->setSearchParameter('fee', $this->_iFee);\n }", "public function setHandlingFee($fee) \n {\n $this->uspsHanldingFee = $fee;\n }", "function setRegistrationFee($fee)\n {\n $this->__registrationfee = $fee ;\n }", "function setRegistrationFee($fee)\n {\n $this->__registration_fee = $fee ;\n }", "public function setCommissionFee(float $fee): void;", "public function setShippingInsurance(\\Nogrod\\eBaySDK\\Trading\\ShippingInsuranceType $shippingInsurance)\n {\n $this->shippingInsurance = $shippingInsurance;\n return $this;\n }", "public function set_signup_fee($value)\n {\n\n // Sanitize and validate value\n $value = $this->sanitize_signup_fee($value);\n\n // Set property\n $this->set_property('signup_fee', $value);\n }", "public function add_invoice_fee() {\n\t\t$current_gateway = WC_Gateway_Svea_Helper::get_current_gateway();\n\n\t\tif( ! $current_gateway ||\n\t\t\tget_class( $current_gateway ) != \"WC_Gateway_Svea_Invoice\" ) {\n\t\t\treturn;\n\t\t}\n\n\t\tWC_Gateway_Svea_Invoice::init()->add_invoice_fee();\n\t}", "public function setCheckInFee(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\SurchargeData $checkInFee = null)\n {\n if (is_null($checkInFee) || (is_array($checkInFee) && empty($checkInFee))) {\n unset($this->CheckInFee);\n } else {\n $this->CheckInFee = $checkInFee;\n }\n return $this;\n }", "public function setSubscriptionFee($fee)\n {\n $this->amount_due = $fee;\n }", "private function _initInvoiceFee()\n {\n\t\t$helper = Mage::helper('sisow/paymentfee');\n\t\t$fee = $helper->getPaymentFeeArray(\n\t\t\t\t$this->payment->getMethodInstance()->getCode(), \n\t\t\t\t$this->quote\n\t\t\t);\n\t\t\n $this->address->setBaseInvoiceFee($fee['base_incl']);\n $this->address->setInvoiceFee($fee['incl']);\n $this->address->setBaseInvoiceFeeExcludedVat($fee['base_excl']);\n $this->address->setInvoiceFeeExcludedVat($fee['excl']);\n $this->address->setBaseInvoiceTaxAmount($fee['base_taxamount']);\n $this->address->setInvoiceTaxAmount($fee['taxamount']);\n $this->address->setInvoiceFeeRate($fee['rate']);\n\n // Add our invoice fee to the address totals\n $this->address->setBaseGrandTotal(\n $this->address->getBaseGrandTotal() + $fee['base_incl']\n );\n $this->address->setGrandTotal(\n $this->address->getGrandTotal() + $fee['incl']\n );\n }", "public function setFeeId(?string $feeId): void\n {\n $this->feeId['value'] = $feeId;\n }", "public function custom_shipping_fee($fee) {\n $this->shipping_fees[] = $fee;\n }", "public function setShippingInsuranceCost(\\Nogrod\\eBaySDK\\Shopping\\AmountType $shippingInsuranceCost)\n {\n $this->shippingInsuranceCost = $shippingInsuranceCost;\n return $this;\n }", "public function setTransactionRefundFee(?float $transactionRefundFee): void\n {\n $this->transactionRefundFee = $transactionRefundFee;\n }", "public function setShippingInsuranceCost(\\Nogrod\\eBaySDK\\MerchantData\\AmountType $shippingInsuranceCost)\n {\n $this->shippingInsuranceCost = $shippingInsuranceCost;\n return $this;\n }", "public function setFeePercentage($feePercentage) {\n $this->fee_percentage = (float) $feePercentage;\n\n return $this->save(false);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the AssetDetail model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = AssetDetail::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
[ "protected function findModel($id) {\n if (($model = Asset::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = ContentSource::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = CustomAsset::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = BannerItem::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "protected function findModel($id)\n {\n \tif (($model = AuthItem::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new NotFoundHttpException('The requested page does not exist.');\n \t}\n }", "protected function findModel($id)\n {\n if (($model = Advert::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException(200,Yii::t('base',40001));\n }", "protected function findModel($id) {\n if (($model = BannerMaster::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('admin', 'The requested page does not exist.'));\n }", "protected function findModel($id)\r\n {\r\n if (($model = ScanWeimaDetail::findOne($id)) !== null) {\r\n\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = AllocationDetails::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = AllocationMaster::findOne($id)) !== null) {\n\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id) {\n if (($model = Bcf15Detail::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Assortment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = ApiKeys::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel(array $pk) {\n /** @var ActiveRecord $class */\n $class = $this->getModelClass();\n if (($model = $class::findOne($pk)) !== null) {\n return $model;\n }\n\n $error = \\Yii::t('yii', 'The requested page does not exist.');\n Yii::$app->session->addFlash('error', $error );\n\n return null;\n }", "protected function findModel($id)\n {\n if (($model = ParameterMasterItem::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PhotoCatalog::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a new nameserver supermaster in the storage.
public function store(Request $request) { try { $data = $this->getData($request); Supermaster::create($data); return redirect()->route('nameserver_supermasters.nameserver_supermaster.index')->with('success_message', 'Nameserver Supermaster was successfully added!'); } catch (Exception $exception) { return back()->withInput()->withErrors(['unexpected_error' => 'Unexpected error occurred while trying to process your request!']); } }
[ "function add_supermaster()\n\t{\n\t\tif(!isset($this->post['submit'])) {\n\t\t\t$token = $this->generate_token();\n\n\t\t\treturn eval($this->template('ADMIN_SUPERMASTER_ADD'));\n\t\t}\n\n\t\tif( !$this->is_valid_token() ) {\n\t\t\treturn $this->message( $this->lang->supermaster_add, $this->lang->invalid_token );\n\t\t}\n\n\t\t$ip = $this->post['ip'];\n\t\t$ns = $this->post['ns'];\n\n\t\t// If the 2 pieces of useful input match, then we can't insert the data.\n\t\t$exists = $this->db->fetch( \"SELECT * FROM supermasters WHERE ip='%s' AND nameserver='%s'\", $ip, $ns );\n\t\tif( $exists )\n\t\t\treturn $this->message( $this->lang->supermaster_add, $this->lang->supermaster_exists );\n\n\t\t$type = 'A';\n\t\tif( strpos( $ip, '.' ) === false )\n\t\t\t$type = 'AAAA';\n\n\t\tif( !$this->is_valid_ip($ip, $type) )\n\t\t\treturn $this->message( $this->lang->supermaster_add, $this->lang->supermaster_ip_invalid );\n\n\t\tif( !$this->is_valid_domain($ns) )\n\t\t\treturn $this->message( $this->lang->supermaster_add, $this->lang->supermaster_ns_invalid );\n\n\t\t$this->db->dbquery( \"INSERT INTO supermasters (ip,nameserver,account) VALUES( '%s', '%s', 'Internal' )\", $ip, $ns );\n\t\treturn $this->message( $this->lang->supermaster_add, $this->lang->supermaster_added );\n\t}", "public function store(StoreServerRequest $request)\n {\n $fields = $request->only(\n 'name',\n 'user',\n 'ip_address',\n 'port',\n 'path',\n 'project_id',\n 'deploy_code',\n 'add_commands'\n );\n\n // Get the current highest server order\n $max = Server::where('project_id', $fields['project_id'])\n ->orderBy('order', 'DESC')\n ->first();\n\n $order = 0;\n if (isset($max)) {\n $order = $max->order + 1;\n }\n\n $fields['order'] = $order;\n\n $add_commands = false;\n if (isset($fields['add_commands'])) {\n $add_commands = $fields['add_commands'];\n unset($fields['add_commands']);\n }\n\n $server = Server::create($fields);\n\n // Add the server to the existing commands\n if ($add_commands) {\n foreach ($server->project->commands as $command) {\n $command->servers()->attach($server->id);\n }\n }\n\n return $server;\n }", "public function store(StoreServerRequest $request)\n {\n return Server::create($request->only(\n 'name',\n 'user',\n 'ip_address',\n 'path',\n 'project_id'\n ));\n }", "public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}", "function setMaster (){\n self::$master = 1;\n }", "public function markAsReplica()\n\t{\n\t\t$this->__isReplica = true;\n\t}", "public function setHomeTenantName(?string $value): void {\n $this->getBackingStore()->set('homeTenantName', $value);\n }", "public function save()\n {\n $this->mount->save();\n parent::save();\n }", "public function store() {\n\t\t// Prepare server data\n\t\t$serverData = [\n\t\t\t'server_name' => $_POST[ 'server_name' ],\n\t\t\t'server_website' => $_POST[ 'server_website' ],\n\t\t\t'server_description' => $_POST[ 'server_description' ],\n\t\t\t'server_vip' => $_POST[ 'server_vip' ],\n\t\t];\n\n\t\t// Validate server data\n\t\t$errors = $this->validate( $serverData );\n\n\t\t// Check if we have some errors\n\t\tif ( $errors ) {\n\t\t\t// We have errors - return back with errors provided\n\t\t\treturn view( 'add-server', [ 'fields' => $serverData, 'errors' => $errors] );\n\t\t}\n\n\t\t// Insert new server into the database\n\t\tApp::get( 'database' )->insert( 'servers', [\n\t\t\t'name' => $serverData[ 'server_name' ],\n\t\t\t'description' => $serverData[ 'server_description' ],\n\t\t\t'website' => $serverData[ 'server_website' ],\n\t\t\t'vip' => $serverData[ 'server_vip' ],\n\t\t]);\n\n\t\t// Redirect to the homepage\n\t\treturn redirect('');\n\t}", "public function store() {\n $options = $this->getOptions();\n $key = self::DEFAULT_REGISTRY_KEY;\n\n if (isset($options['storage']['registry']['key'])\n && !empty($options['storage']['registry']['key'])\n ) {\n $key = $options['storage']['registry']['key'];\n }\n\n Zend_Registry::set($key, $this->_acl);\n }", "public function storeRegistration()\n {\n if ($this->isRegistrationRunning()) {\n $this->registrationRepository->update($this->registration);\n }\n }", "public function store(StoreMasterSettingsRequest $request)\n {\n if (! Gate::allows('master_setting_create')) {\n return prepareBlockUserMessage();\n }\n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n }\n $master_setting = MasterSetting::create($request->all());\n\t\t\n\t\tif( 'payment' === $request->moduletype) {\n\t\t\tapp('App\\Http\\Controllers\\Admin\\GeneralSettingsController')->savePaymentGateway();\n\t\t}\n\n Eventy::action('master_settings.store', $request );\n\n flashMessage( 'success', 'create' );\n return redirect()->route('admin.master_settings.index');\n }", "public function sendMountAllStorages(){\n $this->setEvent('mount_all_storages');\n $master = new VideoMaster();\n $this->setMsg(json_encode($master->getStoragesForStb()));\n $this->send();\n }", "public function createServer()\n {\n $zone = ($this->params['configoptions']['Location'] == '') ? $this->params['configoption1'] : $this->params['configoptions']['Location'];\n $size = ($this->params['configoptions']['Storage'] == '') ? 10 : $this->params['configoptions']['Storage'];\n\n $hddAvaliable = ['fi-hel', 'sg-sin', 'uk-lon'];\n $tier = 'maxiops';\n\n foreach ($hddAvaliable as $zon) {\n if (strpos($zone, $zon) !== false) {\n $tier = 'hdd';\n break;\n }\n }\n\n if (empty($this->params['domain'])) {\n $this->params['domain'] = '127.0.0.1';\n }\n $body = [\n 'server' => [\n 'zone' => $zone,\n 'title' => 'VM-'.$this->params['serviceid'],\n 'hostname' => $this->params['domain'],\n 'plan' => $this->params['configoption2'],\n 'firewall' => 'off',\n 'remote_access_type' => 'vnc',\n 'storage_devices' => [\n 'storage_device' => [\n 'action' => 'clone',\n 'storage' => $this->params['configoption3'],\n 'title' => 'VM-'.$this->params['serviceid'].' Storage',\n 'size' => $size,\n 'tier' => $tier,\n ],\n ],\n ],\n ];\n\n if (!empty($this->params['customfields']['SSHKey'])) {\n $body['server']['login_user'] = [\n 'username' => 'root',\n 'ssh_keys' => [\n 'ssh_key' => [\n $this->params['customfields']['SSHKey'],\n ],\n ],\n ];\n }\n\n if (!empty($this->params['customfields']['initialization'])) {\n $body['server']['user_data'] = $this->params['customfields']['initialization'];\n }\n\n return $this->callApi('post', '/server', $body);\n }", "public function addServer(VarnishServer $server) {\n parent::addServer($server);\n\n if (!$server instanceof VarnishAdmin) {\n return;\n }\n\n $name = $this->getParameterName($server);\n\n $pool = $this->config->get($this->prefix);\n $pool[$name] = array(\n 'host' => $server->getHost(),\n 'port' => $server->getPort(),\n 'secret' => $server->getSecret(),\n );\n $this->config->set($this->prefix, $pool);\n }", "function superStore(){\n\t\tif($this->id==0){\n\t\t\t$this->superStoreObj();\n\t\t}else{\n\t\t\t$this->superUpdateObj();\n\t\t}\n\t}", "public function setStMasterStore(MasterFightStore $value)\n {\n return $this->set(self::STMASTERSTORE, $value);\n }", "public function setServer($servername) {\n $this->servername = $servername;\n }", "public function getMasterInstanceName()\n {\n return $this->master_instance_name;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This filter add cart micro widget to header options.
function dt_woocommerce_add_cart_micro_widget_filter( $elements = array() ) { $elements['cart'] = array( 'title' => _x( 'Cart', 'theme-options', 'the7mk2' ), 'class' => '' ); return $elements; }
[ "public function registerCartWidget() {\n register_widget('ShoprocketCartWidget');\n }", "public function registerCartWidget() {\n register_widget('Cart66CartWidget');\n }", "function wf_render_meta_on_cart_and_checkout( $cart_data, $cart_item = null ) {\n\n\n $meta_items = array();\n /* Woo 2.4.2 updates */\n if( !empty( $cart_data ) ) {\n $meta_items = $cart_data;\n }\n\n\n $woofood_options = get_option('woofood_options');\n $woofood_enable_hide_extra_cat_title_option = isset($woofood_options['woofood_enable_hide_extra_cat_title_option']) ? $woofood_options['woofood_enable_hide_extra_cat_title_option'] : null ;\n\n\nif( isset( $cart_item[\"woofood_data\"] ) ) {\n\n if( isset( $cart_item[\"woofood_data\"][\"extra_options\"] ) ) {\n\n foreach($cart_item[\"woofood_data\"][\"extra_options\"] as $current_extra_option_category_name => $current_extra_option_category)\n { \n \n if (!$woofood_enable_hide_extra_cat_title_option){\n\n\n $meta_items[] = array( \"name\" => null, \"value\" => $current_extra_option_category_name);\n }\n\n foreach($current_extra_option_category as $current_extra_option)\n {\n $current_extra_option = (object)$current_extra_option;\n\n\n if($current_extra_option->hide_prices == true)\n {\n $meta_items[] = array( \"name\" => '', \"value\" => $current_extra_option->name);\n\n }\n else\n {\n $meta_items[] = array( \"name\" => $current_extra_option->name.'', \"value\" => html_entity_decode($current_extra_option->price, ENT_COMPAT, 'UTF-8'));\n\n }\n\n\n\n\n\n }\n\n\n\n\n }\n \n\n\n }\n\n if( isset( $cart_item[\"woofood_data\"][\"additional_comments\"] ) ) {\n\n $meta_items[] = array( \"name\" => esc_html__('Additional Comments','woofood-plugin'), \"value\" => $cart_item[\"woofood_data\"][\"additional_comments\"] );\n\n\n\n }\n \n \n \n }\n\n\n\n\n\n\n\n\n if( isset( $cart_item[\"extra_options\"] ) ) {\n \n foreach($cart_item[\"extra_options\"] as $current_extra_option){\n\n\n if( (array_key_exists('0', $current_extra_option)) && isset( $current_extra_option ) && $current_extra_option[0] ==\"cat_name\" ) {\n \n $meta_items[] = array( \"name\" => null ,\"value\" => $current_extra_option[1].'');\n \n\n\n }//end if isset each\n\n if( (array_key_exists('0', $current_extra_option)) && isset( $current_extra_option ) && is_numeric($current_extra_option[0]) ) {\n \n $meta_items[] = array( \"name\" => $current_extra_option[1].'', \"value\" => \"\".html_entity_decode(strip_tags(wc_price($current_extra_option[0], ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8') );\n \n\n\n\n }//end if isset each\n\n\n\n\n\n //check if have additional comments for the product//\n\n if( (array_key_exists('additional_comments', $current_extra_option))&& isset( $current_extra_option ) && isset($current_extra_option['additional_comments'] )) {\n \n $meta_items[] = array( \"name\" => esc_html__('Additional Comments','woofood-plugin'), \"value\" => $current_extra_option['additional_comments'] );\n \n\n\n\n }//end if isset each\n //check if have additional comments for the product//\n\n\n\n\n\n }//end foreach\n \n }\n\n\n return $meta_items;\n\n\n}", "function dt_woocommerce_configure_mini_cart() {\n\t\t$config = presscore_config();\n\t\t$config->set( 'woocommerce.mini_cart.caption', of_get_option( 'header-elements-woocommerce_cart-caption' ) );\n\t\t$config->set( 'woocommerce.mini_cart.icon', of_get_option( 'header-elements-woocommerce_cart-icon', true ) );\n\t\t$config->set( 'woocommerce.mini_cart.subtotal', of_get_option( 'header-elements-woocommerce_cart-show_subtotal' ) );\n\t\t$config->set( 'woocommerce.mini_cart.counter', of_get_option( 'header-elements-woocommerce_cart-show_counter', 'allways' ) );\n\t\t$config->set( 'woocommerce.mini_cart.counter.style', of_get_option( 'header-elements-woocommerce_cart-counter-style', 'round' ) );\n\t\t$config->set( 'woocommerce.mini_cart.counter.bg', of_get_option( 'header-elements-woocommerce_cart-counter-bg', 'accent' ) );\n\t\t$config->set( 'woocommerce.mini_cart.dropdown', of_get_option( 'header-elements-woocommerce_cart-show_sub_cart' ) );\n\t}", "function qi_header_extras() {\n\tdo_action( 'qi_header_extras' );\n}", "function simplecart_aboveheader() {\n do_action('simplecart_aboveheader');\n}", "function aw_show_single_product_price_header_html(){\r\n get_template_part('functions/views/frontend/content', 'single-product-price-header');\r\n}", "function simplecart_belowheader() {\n do_action('simplecart_belowheader');\n}", "function cryout_header_widgets_hook() {\n do_action('cryout_header_widgets_hook');\n}", "function get_custom_header_markup()\n {\n }", "private function add_selective_refresh_to_header_items() {\n\t\t$this->get_customizer_object( 'setting', 'blogname' )->transport = 'postMessage';\n\n\t\t$this->add_partial(\n\t\t\tnew Hestia_Customizer_Partial(\n\t\t\t\t'blogname',\n\t\t\t\tarray(\n\t\t\t\t\t'selector' => '.navbar .navbar-brand p',\n\t\t\t\t\t'settings' => array( 'blogname' ),\n\t\t\t\t\t'render_callback' => array( $this, 'blog_name_callback' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_partial(\n\t\t\tnew Hestia_Customizer_Partial(\n\t\t\t\t'custom_logo',\n\t\t\t\tarray(\n\t\t\t\t\t'selector' => '.navbar-brand',\n\t\t\t\t\t'settings' => 'custom_logo',\n\t\t\t\t\t'render_callback' => array( $this, 'logo_callback' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->add_partial(\n\t\t\tnew Hestia_Customizer_Partial(\n\t\t\t\t'hestia_transparent_header_logo',\n\t\t\t\tarray(\n\t\t\t\t\t'selector' => '.navbar-brand',\n\t\t\t\t\t'settings' => 'hestia_transparent_header_logo',\n\t\t\t\t\t'render_callback' => array( $this, 'logo_callback' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "function kapee_product_filter_top() {\n\t\t\t\n\t\tif( ! kapee_get_option( 'shop-top-filter', 0 ) ) return;\n\t\t?>\n\t\t<span class=\"kapee-product-filter-btn\"><?php echo esc_html__('Filter','kapee');?></span>\n\t\n\t<?php }", "function cmwsecure_add_meta_box() {\n\n\tadd_meta_box( 'cmwsecure-custom-checkout-html', 'Custom Top Level HTML', 'cmwsecure_inner_meta_box', 'page', 'normal', 'high' );\n\n}", "private function product_filter_bar( ){\n\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_product_filter_bar.php' ) )\t\n\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option('ec_option_base_layout') . '/ec_product_filter_bar.php' );\n\t\telse\n\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option('ec_option_latest_layout') . '/ec_product_filter_bar.php' );\n\t}", "function render_utility_bar_before_header() {\n\n\tgenesis_widget_area( 'utility-bar', array(\n\t\t'before' => '<div class=\"utility-bar\"><div class=\"wrap\">',\n\t\t'after' => '</div></div>',\n\t) );\n}", "public static function update_before_cart_page() {\n\t\t// Get theme options\n\t\t$wr_nitro_options = WR_Nitro::get_options();\n\t\t$sidebar = $wr_nitro_options['wc_cart_content_before'];\n\n\t\tif ( ! empty( $sidebar ) && is_active_sidebar( $sidebar ) ) {\n\t\t\techo '<div class=\"widget-before-product-list mgb30\">';\n\t\t\t\tdynamic_sidebar( $sidebar );\n\t\t\techo '</div>';\n\t\t}\n\t}", "function addCustomHeadTag($html)\n {\n $this->_head['custom'][] = trim($html);\n }", "function render_meta_on_cart_and_checkout($cart_data, $cart_item = null) {\n\n $custom_items = array();\n /* Woo 2.4.2 updates */\n if (!empty($cart_data)) {\n $custom_items = $cart_data;\n }\n if (isset($cart_item['bathroom'])) {\n $custom_items[] = array(\"name\" => _e(\"Bathroom\", \"Avada\"), \"value\" => $cart_item['bathroom']);\n }\n if (isset($cart_item['bedroom'])) {\n $custom_items[] = array(\"name\" => _e(\"Bedroom\", \"Avada\"), \"value\" => $cart_item['bedroom']);\n }\n\n if (isset($cart_item['recommended_hour'])) {\n $custom_items[] = array(\"name\" => 'Recommended Hours', \"value\" => $cart_item['recommended_hour']);\n }\n if (isset($cart_item['hourly_charges'])) {\n $custom_items[] = array(\"name\" => 'Hourly Charges', \"value\" => $cart_item['hourly_charges']);\n }\n if (isset($cart_item['total_charges'])) {\n \n $total_extra_minutes = 0;\n $emc = 0;\n if($cart_item[\"extra_services\"]!=\"\"){\n foreach($cart_item[\"extra_services\"] as $services){\n $total_extra_minutes = $total_extra_minutes + $services['extra_time'];\n }\n }\n if($total_extra_minutes>0){\n $emc = ($total_extra_minutes * $cart_item['hourly_charges'])/60;\n }\n $cart_tc = $cart_item['total_charges'] + $emc;\n \n $custom_items[] = array(\"name\" => 'Total Charges', \"value\" => $cart_tc);\n }\n if (isset($cart_item['date'])) {\n $custom_items[] = array(\"name\" => 'Date', \"value\" => $cart_item['date']);\n }\n if (isset($cart_item['time'])) {\n $custom_items[] = array(\"name\" => 'Time', \"value\" => $cart_item['time']);\n }\n if (isset($cart_item['email'])) {\n $custom_items[] = array(\"name\" => 'Email', \"value\" => $cart_item['email']);\n }\n if (isset($cart_item['service_hour'])) {\n $sh = explode(':',$cart_item['service_hour']);\n $sh_h = $sh[0];\n $sh_m = $sh[1];\n if($sh_m == ''){\n $sh_m = 0;\n }\n $total_extra_minutes = 0;\n $total_extra_minutes = $total_extra_minutes + $sh_m;\n if($cart_item[\"extra_services\"]!=\"\"){\n foreach($cart_item[\"extra_services\"] as $services){\n $total_extra_minutes = $total_extra_minutes + $services['extra_time'];\n }\n if($total_extra_minutes>=60){\n $total_extra_hours = intdiv($total_extra_minutes, 60);\n $total_extra_minutes = ($total_extra_minutes % 60);\n }\n }\n $total_hours = 0;\n $total_minutes = '';\n if($total_extra_hours > 0){\n $total_hours = $sh_h + $total_extra_hours;\n }\n else{\n $total_hours = $sh_h;\n }\n if($total_extra_minutes!=0){\n $total_hours = $total_hours.':'.$total_extra_minutes;\n }\n\n\n $custom_items[] = array(\"name\" => 'Service Hours', \"value\" => $total_hours);\n }\n if (isset($cart_item['extraservices'])) {\n $custom_items[] = array(\"name\" => 'Extra Services', \"value\" => $cart_item['extraservices'][0]['title']);\n }\n if (isset($values['extra_services'])) {\n wc_add_order_item_meta($item_id, \"extra_services\", $values['extra_services']);\n }\n if (isset($values['service_hour'])) {\n wc_add_order_item_meta($item_id, \"service_hour\", $values['service_hour']);\n }\n /* if (isset($values['extra_hours'])) {\n wc_add_order_item_meta($item_id, \"extra_hours\", $values['extra_hours']);\n } */\n\n return $custom_items;\n}", "function add_mini_cart_template_to_footer() {\n get_template_part( 'template-parts/woocommerce/mini-cart/mini-cart', 'template' );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enqueue our counter script
function novem_enqueue_script() { wp_enqueue_script( 'novem-counter', plugins_url( 'jquery.countUp.min.js', __FILE__ ), array( 'jquery' )); }
[ "function wpsocialcount_enqueue() {\n\n\twp_register_script( 'wpsocialcount', 'url_plugins(\\'/js/\\')', array( 'socialcount.js' ), false, true );\n\twp_enqueue_script( 'wpsocialcount' );\n\n}", "public static function enqueue_scripts() {\n\t\tif ( static::should_enqueue() ) {\n\t\t\ttve_dash_enqueue_vue();\n\n\t\t\ttve_dash_enqueue_script( static::SCRIPT_HANDLE, TVE_DASH_URL . '/assets/dist/js/metrics.js', [], TVE_DASH_VERSION, true );\n\n\t\t\tif ( is_file( TVE_DASH_PATH . '/assets/dist/css/metrics.css' ) ) {\n\t\t\t\ttve_dash_enqueue_style( static::SCRIPT_HANDLE, TVE_DASH_URL . '/assets/dist/css/metrics.css' );\n\t\t\t}\n\n\t\t\twp_localize_script( static::SCRIPT_HANDLE, 'TD_Metrics', static::localize_data() );\n\t\t}\n\t}", "public function enqueue_control_scripts()\n {\n }", "public function incrementCounter();", "public function enqueueScripts() {}", "public function enqueue_admin_cpcss_heartbeat_script() {\r\n\t\t$this->admin->enqueue_admin_cpcss_heartbeat_script();\r\n\t}", "function enqueueScripts();", "public function enqueue_status_scripts() {\n\t\twp_enqueue_script( 'the7-status' );\n\t}", "public function enqueue_control_scripts()\n {\n }", "private function increment() {\n\t\t$count = get_option( $this->counter_option, 0 );\n\t\t$new_count = $count + 1;\n\n\t\tupdate_option( $this->counter_option, $new_count );\n\t}", "function cpro_enqueue_countdown_script() {\r\n\t\twp_enqueue_script( 'cpro-countdown-plugin-script', CP_V2_BASE_URL . 'framework/fields/cp_countdown/cp_countdown_plugin.min.js', array( 'cp-popup-script' ), '1.0.0', true );\r\n\t\twp_enqueue_script( 'cpro-countdown', CP_V2_BASE_URL . 'framework/fields/cp_countdown/cp_countdown.min.js', array( 'cp-popup-script' ), '1.0.0', true );\r\n\t\twp_enqueue_script( 'cpro-countdown-script', CP_V2_BASE_URL . 'framework/fields/cp_countdown/cp-countdown-script.js', array( 'cp-popup-script' ), '1.0.0', true );\r\n\t\twp_enqueue_style( 'cpro-countdown-style', CP_V2_BASE_URL . 'framework/fields/cp_countdown/cp-countdown-style.css', array(), CP_V2_VERSION );\r\n\t}", "function foodbakery_load_shortcode_counters_progressbar_callback($counters) {\r\n\t$counters['foodbakery_counter_progressbars'] = 0;\r\n\t$counters['foodbakery_counter_progressbars_node'] = 0;\r\n\t$counters['foodbakery_global_counter_progressbars'] = 0;\r\n\t$counters['foodbakery_shortcode_counter_progressbars'] = 0;\r\n\treturn $counters;\r\n }", "function updateHitCounter()\n\t{\n\t\t$count = getApiHitCount();\n\t\t$count = $count + 1;\n\t\t$myfile = fopen(\"hitcounter.txt\", \"w\") or die(\"File Doesn't exist\");\n\t\t$txt = $count;\n\t\tfwrite($myfile, $txt);\n\t\tfclose($myfile);\n\t}", "private function register_scripts(){\n\n\t\t// wp_register_style( 'calu', plugins_url( '/assets/css/calu.css', __FILE__ ) );\n\t\t// wp_register_script( 'asPieProgress', plugins_url( '/assets/js/jquery-asPieProgress.js', __FILE__ ), array('jquery'), '', true );\n \t\n\t\tdo_action( 'calu_register_script' );\n \t}", "function foodbakery_load_shortcode_counters_testimonial_callback($counters) {\r\n\t$counters['foodbakery_counter_testimonial'] = 0;\r\n\t$counters['foodbakery_counter_testimonial_node'] = 0;\r\n\t$counters['foodbakery_shortcode_counter_testimonial'] = 0;\r\n\t$counters['foodbakery_global_counter_testimonial'] = 0;\r\n\treturn $counters;\r\n }", "function gglapicounter ($mode, $counterfile, $cntlimit=1000, $cntwarning=900){\n//counterfile = counter.txt im inc Verzeichnis. Aufruf immer von einbindenden Verzeichnis aus.\n\nif(!file_exists($counterfile)){\n\ttouch($counterfile);\n}\n\t\n$datnow = date('m.Y');\n$cntdata = explode('|',file_get_contents($counterfile));\n\n$cntdate = $cntdata[0];\n$cntnbr = $cntdata[1];\n\nif($cntnbr >= $cntlimit){\n?>\n<div class=\"alert alert-danger\" role=\"alert\">API Limit erreicht. Weiterer Ablauf gestoppt - Weiteres OCR mit Google nicht mehr möglich<br><b>Empfehlung:</b> Auf OCR Space Free umstellen (Dazu die config Datei bearbeiten)</div><br>\n<?php\nexit();\n}\nelseif($cntnbr > $cntwarning){\n?><div class=\"alert alert-warning\" role=\"alert\">Warnung: API Limit fast erreicht</div><br><?php\n}\n\n\t## Neues Monat beginnt -> Counter resetten | Auch wenn nur im Lesemodus\n\tif($datnow <> $cntdate){\n\t\tfile_put_contents($counterfile, $datnow.'|1');\t\n\t}\n\telse{\n\t\tif($mode == 'write'){\n\t\t\t$cntinfo = 'API Aufruf ';\n\t\t\t$cntnbr++; //nächster aufruf\n\t\t\tfile_put_contents($counterfile, $cntdate.'|'.($cntnbr));\n\t\t}\n\t}\n\n\t$prozent = round(($cntnbr/$cntlimit*100), 1);\n\nif($mode == 'read'){\n$cntinfo = 'Verbrauchte API-Aufrufe: ';\t\n}\necho $cntinfo.$cntnbr.' von '.$cntlimit.' ['.$prozent.'%]<br>';\n?>\n<div class=\"progress\">\n <div title=\"Verbrauchte Aufrufe\" class=\"progress-bar progress-bar-warning\" role=\"progressbar\" style=\"width:<?php echo $prozent; ?>%\">\n Verbraucht\n </div>\n <div title=\"Freie Aufrufe\" class=\"progress-bar progress-bar-success\" role=\"progressbar\" style=\"width:<?php echo (100-$prozent); ?>%\">\n Frei\n </div>\n</div><?php\n}", "function themesflat_shortcode_counter( $atts, $content = null ) {\n\t\n\t$atts = vc_map_get_attributes( 'counter', $atts );\n\n\t$class = apply_filters( 'themesflat/shortcode/counter_class', array( 'counter', $atts['class'] ), $atts );\n\t$flat_counter = sprintf( '<div class=\"%1$s\">', implode( ' ', $class ) );\n\n\t$flat_counter.= sprintf( '\n\t\t<div class=\"counter-content\">\n\t\t\t\n\t\t\t<div class=\"numb-counter\">\n\t\t\t\t<p class=\"numb-count\" data-from=\"0\" data-to=\"%1$d\" data-speed=\"%2$s\" data-waypoint-active=\"yes\">%1$d</p>\t\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t', $atts['value'], $atts['duration'] );\n\n\tif ( ! empty( $atts['title'] ) )\n\t\t$flat_counter.= sprintf( '<p class=\"name\">%s</p>', $atts['title'] );\n\n\t$flat_counter.= '</div>';\n\n\t// Enqueue shortcode assets\t\t\n\twp_enqueue_script( 'themesflat-counter' );\t\n\treturn $flat_counter;\n}", "public function enqueue() {\n\n\t\tstatic $enqueued = false;\n\n\t\tif ( ! $enqueued ) {\n\n\t\t\twp_enqueue_script( 'holder', $this->components_url . '/holder/holder.js', array(), 2.3, true );\n\t\t\t$enqueued = true;\n\t\t}\n\t}", "public function enqueue_help_scout_script()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the processingState property value. The processingState property
public function getProcessingState(): ?PrinterProcessingState { $val = $this->getBackingStore()->get('processingState'); if (is_null($val) || $val instanceof PrinterProcessingState) { return $val; } throw new \UnexpectedValueException("Invalid type found in backing store for 'processingState'"); }
[ "public function getProcessingStatus()\n {\n return $this->_fields['ProcessingStatus']['FieldValue'];\n }", "public function getProcessingState()\n {\n if (array_key_exists(\"processingState\", $this->_propDict)) {\n if (is_a($this->_propDict[\"processingState\"], \"\\Beta\\Microsoft\\Graph\\Model\\PrintJobProcessingState\") || is_null($this->_propDict[\"processingState\"])) {\n return $this->_propDict[\"processingState\"];\n } else {\n $this->_propDict[\"processingState\"] = new PrintJobProcessingState($this->_propDict[\"processingState\"]);\n return $this->_propDict[\"processingState\"];\n }\n }\n return null;\n }", "public function getProcessing()\n {\n return $this->processing;\n }", "public function getProcessingStatus()\n {\n return $this->get('ProcessingStatus');\n }", "public function getIsProcessing()\n {\n if (array_key_exists(\"isProcessing\", $this->_propDict)) {\n return $this->_propDict[\"isProcessing\"];\n } else {\n return null;\n }\n }", "public function getFeedProcessingStatus()\n {\n return $this->fields['FeedProcessingStatus']['FieldValue'];\n }", "public function getReportProcessingStatus()\n {\n return $this->fields['ReportProcessingStatus']['FieldValue'];\n }", "public function getState() \n\t{\n\t\tif ($this->_state == false) {\n\t\t\t$this->_state = new ProcessState();\n\t\t}\n\t\treturn $this->_state;\n\t}", "public function getFeedProcessingStatus()\n {\n return $this->get('FeedProcessingStatus');\n }", "public function getProcessingConfiguration()\n {\n return $this->processingConfiguration;\n }", "public function processingStatus()\n {\n $status = Order::find($this->id)->processing_status;\n switch ($status) {\n case self::APPROVED_ID:\n return self::APPROVED_STATUS;\n break;\n case self::CANCEL_ID:\n return self::CANCEL_STATUS;\n break;\n case self::PENDING_ID:\n return self::PENDING_STATUS;\n break;\n }\n }", "public function isProcessing(): bool\n {\n return $this->status === static::PROCESSING;\n }", "public function getReportProcessingStatus()\n {\n return $this->get('ReportProcessingStatus');\n }", "public function acquireProcessingStatusCode()\n {\n return $this->getProcessingStatusCode() ?: $this->getExtractedProcessingStatusCode();\n }", "public function setProcessingStatus($value)\n {\n $this->_fields['ProcessingStatus']['FieldValue'] = $value;\n return $this;\n }", "public function setProcessing($var)\n {\n GPBUtil::checkUint32($var);\n $this->processing = $var;\n\n return $this;\n }", "public function getImageProcessing()\n {\n return $this->image_processing;\n }", "public function isProcessing()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_PROCESSING;\n }", "final public function getProcessing() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add Quiz Description Metabox
public function descriptionBox( $post ) { wp_nonce_field( 'viraquiz_save_quiz_description', 'viraquiz_save_quiz_description_nonce' ); $value = get_post_meta( $post->ID, '_viraquiz_quiz_description', true ); wp_editor( wp_kses_post( $value ), 'quiz-description', array( 'media_buttons' => false, 'textarea_rows' => 2, 'textarea_name' => '_viraquiz_quiz_description' ) ); }
[ "protected function addQuizSection() {\n if ( $this->item->quiz !== null ) {\n $this->out->addWikiText( $this->item->quiz->content );\n } else {\n // show info box when quiz has not been created yet\n // TODO pass link to edit quiz resource page\n $this->addEmptySectionBox( self::SECTION_KEY_QUIZ );\n }\n }", "function quiz_metaboxes_add() {\n add_meta_box( 'quizmeta_box_', 'Answers', 'quiz_metaboxes', 'quizbook_Quizzes', 'normal', 'high', null );\n}", "public function addDescription()\n {\n $this->addElement($this->getTextElement('descricao', 'Descrição', false));\n }", "public function addQuestionAndAnswers () {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n $this->initAddQuestionAndAnswersForm();\n }", "function addBasicQuestionFormProperties($form)\n\t{\n\t // title\n\t\t$title = new ilTextInputGUI($this->lng->txt(\"title\"), \"title\");\n\t\t$title->setMaxLength(100);\n\t\t$title->setValue($this->object->getTitle());\n\t\t$title->setRequired(TRUE);\n\t\t$form->addItem($title);\n\n\t\tif (!$this->object->getSelfAssessmentEditingMode())\n\t\t{\n\t\t\t// author\n\t\t\t$author = new ilTextInputGUI($this->lng->txt(\"author\"), \"author\");\n\t\t\t$author->setValue($this->object->getAuthor());\n\t\t\t$author->setRequired(TRUE);\n\t\t\t$form->addItem($author);\n\t\n\t\t\t// description\n\t\t\t$description = new ilTextInputGUI($this->lng->txt(\"description\"), \"comment\");\n\t\t\t$description->setValue($this->object->getComment());\n\t\t\t$description->setRequired(FALSE);\n\t\t\t$form->addItem($description);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// author as hidden field\n\t\t\t$hi = new ilHiddenInputGUI(\"author\");\n\t\t\t$author = ilUtil::prepareFormOutput($this->object->getAuthor());\n\t\t\tif (trim($author) == \"\")\n\t\t\t{\n\t\t\t\t$author = \"-\";\n\t\t\t}\n\t\t\t$hi->setValue($author);\n\t\t\t$form->addItem($hi);\n\t\t\t\n\t\t}\n\n\t\t// questiontext\n\t\t$question = new ilTextAreaInputGUI($this->lng->txt(\"question\"), \"question\");\n\t\t$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestion()));\n\t\t$question->setRequired(TRUE);\n\t\t$question->setRows(10);\n\t\t$question->setCols(80);\n\t\tif (!$this->object->getSelfAssessmentEditingMode())\n\t\t{\n\t\t\tif( $this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT )\n\t\t\t{\n\t\t\t\t$question->setUseRte(TRUE);\n\t\t\t\tinclude_once \"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php\";\n\t\t\t\t$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags(\"assessment\"));\n\t\t\t\t$question->addPlugin(\"latex\");\n\t\t\t\t$question->addButton(\"latex\");\n\t\t\t\t$question->addButton(\"pastelatex\");\n\t\t\t\t$question->setRTESupport($this->object->getId(), \"qpl\", \"assessment\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$question->setRteTags(self::getSelfAssessmentTags());\n\t\t\t$question->setUseTagsForRteOnly(false);\n\t\t}\n\t\t$form->addItem($question);\n\n\t\tif (!$this->object->getSelfAssessmentEditingMode())\n\t\t{\n\t\t\t// duration\n\t\t\t$duration = new ilDurationInputGUI($this->lng->txt(\"working_time\"), \"Estimated\");\n\t\t\t$duration->setShowHours(TRUE);\n\t\t\t$duration->setShowMinutes(TRUE);\n\t\t\t$duration->setShowSeconds(TRUE);\n\t\t\t$ewt = $this->object->getEstimatedWorkingTime();\n\t\t\t$duration->setHours($ewt[\"h\"]);\n\t\t\t$duration->setMinutes($ewt[\"m\"]);\n\t\t\t$duration->setSeconds($ewt[\"s\"]);\n\t\t\t$duration->setRequired(FALSE);\n\t\t\t$form->addItem($duration);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// number of tries\n\t\t\tif (strlen($this->object->getNrOfTries()))\n\t\t\t{\n\t\t\t\t$nr_tries = $this->object->getNrOfTries();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nr_tries = $this->object->getDefaultNrOfTries();\n\t\t\t}\t\t\t\n\t\t\tif ($nr_tries < 1)\n\t\t\t{\n\t\t\t\t$nr_tries = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t$ni = new ilNumberInputGUI($this->lng->txt(\"qst_nr_of_tries\"), \"nr_of_tries\");\n\t\t\t$ni->setValue($nr_tries);\n\t\t\t$ni->setMinValue(0);\n\t\t\t$ni->setSize(5);\n\t\t\t$ni->setMaxLength(5);\t\t\t\n\t\t\t$form->addItem($ni);\n\t\t}\n\t}", "public function faq_box() {\n\t\tglobal $post_ID;\n\t\t?>\n\t\t<p class=\"howto\">\n\t\t\t<?php _e( 'To display this question, copy the code below and paste it into your post, page, text widget or other content area.', 'arconix-faq' ); ?>\n\t\t</p>\n\t\t<p><input type=\"text\" value=\"[faq p=<?php echo $post_ID; ?>]\" readonly=\"readonly\" class=\"widefat wp-ui-text-highlight code\"></p>\n\t\t<?php\n\t}", "public function editQuiz() {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n iljQueryUtil::initjQuery();\n\n $tpl->setContent($this->initQuestionAndAnswersTable());\n }", "function quizbook_exams_add_metaboxes() {\n add_meta_box( 'quizbook_exams_meta_box', 'Exam Questions', 'quizbook_exams_metaboxes', 'exams', 'normal', 'high', null );\n}", "protected function makeQuestionText() {\n\t\t$this->text = \"What \".strtolower($this->category->prettyName).\" does \".$this->topicSubject->name.\" like?\";\n\t}", "function lawyer_pro_posttype_bn_testimonial_meta_box() {\n\tadd_meta_box( 'lawyer-pro-posttype-pro-testimonial-meta', __( 'Enter Details', 'lawyer-pro-posttype-pro' ), 'lawyer_pro_posttype_bn_testimonial_meta_callback', 'testimonials', 'normal', 'high' );\n}", "public function answers_metabox(){\n\t\tadd_meta_box( 'dwqa-answers', __( 'Answers','dwqa' ), array( $this, 'metabox_answers_list' ), 'dwqa-question' );\n\t}", "function wpi_postform_metadescription(){\n\t\techo '<p>'.PHP_EOL;\n\t\twpi_postmeta_label('meta_description',__('Descriptions',WPI_META));\n\t\twpi_postmeta_input('meta_description');\n\t\techo '</p>'; ?>\n\t<p><?php _e('<strong>Tips: </strong> Make it descriptive and include relevant keywords or keyphrases, 25-30 words, no more than two sentences.',WPI_META);?></p>\n<?php\t\n}", "function hook_quiz_question_info() {\n return array(\n 'long_answer' => array(\n 'name' => t('Example question type'),\n 'description' => t('An example question type that does something.'),\n 'question provider' => 'ExampleAnswerQuestion',\n 'response provider' => 'ExampleAnswerResponse',\n 'module' => 'quiz_question',\n ),\n );\n}", "function definition() {\n global $COURSE, $CFG;\n\n $qtype = $this->qtype();\n $langfile = \"qtype_$qtype\";\n\n $mform =& $this->_form;\n\n // Standard fields at the start of the form.\n $mform->addElement('header', 'generalheader', get_string(\"general\", 'form'));\n\n $mform->addElement('questioncategory', 'category', get_string('category', 'quiz'), null,\n array('courseid' => $COURSE->id, 'published' => true, 'only_editable' => true));\n\n $mform->addElement('text', 'name', get_string('questionname', 'quiz'),\n array('size' => 50));\n $mform->setType('name', PARAM_TEXT);\n $mform->addRule('name', null, 'required', null, 'client');\n\n $mform->addElement('htmleditor', 'questiontext', get_string('questiontext', 'quiz'),\n array('rows' => 15, 'course' => $COURSE->id));\n $mform->setType('questiontext', PARAM_RAW);\n $mform->setHelpButton('questiontext', array(array('questiontext', get_string('questiontext', 'quiz'), 'quiz'), 'richtext'), false, 'editorhelpbutton');\n $mform->addElement('format', 'questiontextformat', get_string('format'));\n\n make_upload_directory(\"$COURSE->id\"); // Just in case\n $coursefiles = get_directory_list(\"$CFG->dataroot/$COURSE->id\", $CFG->moddata);\n foreach ($coursefiles as $filename) {\n if (mimeinfo(\"icon\", $filename) == \"image.gif\") {\n $images[\"$filename\"] = $filename;\n }\n }\n if (empty($images)) {\n $mform->addElement('static', 'image', get_string('imagedisplay', 'quiz'), get_string('noimagesyet'));\n } else {\n $mform->addElement('select', 'image', get_string('imagedisplay', 'quiz'), array_merge(array(''=>get_string('none')), $images));\n }\n\n $mform->addElement('text', 'defaultgrade', get_string('defaultgrade', 'quiz'),\n array('size' => 3));\n $mform->setType('defaultgrade', PARAM_INT);\n $mform->setDefault('defaultgrade', 1);\n $mform->addRule('defaultgrade', null, 'required', null, 'client');\n\n $mform->addElement('text', 'penalty', get_string('penaltyfactor', 'quiz'),\n array('size' => 3));\n $mform->setType('penalty', PARAM_NUMBER);\n $mform->addRule('penalty', null, 'required', null, 'client');\n $mform->setHelpButton('penalty', array('penalty', get_string('penalty', 'quiz'), 'quiz'));\n $mform->setDefault('penalty', 0.1);\n\n $mform->addElement('htmleditor', 'generalfeedback', get_string('generalfeedback', 'quiz'),\n array('rows' => 10, 'course' => $COURSE->id));\n $mform->setType('generalfeedback', PARAM_RAW);\n $mform->setHelpButton('generalfeedback', array('generalfeedback', get_string('generalfeedback', 'quiz'), 'quiz'));\n\n // Any questiontype specific fields.\n $this->definition_inner($mform);\n\n // Standard fields at the end of the form.\n $mform->addElement('hidden', 'id');\n $mform->setType('id', PARAM_INT);\n\n $mform->addElement('hidden', 'qtype');\n $mform->setType('qtype', PARAM_ALPHA);\n\n $mform->addElement('hidden', 'inpopup');\n $mform->setType('inpopup', PARAM_INT);\n\n $mform->addElement('hidden', 'versioning');\n $mform->setType('versioning', PARAM_BOOL);\n\n $buttonarray = array();\n $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));\n if (!empty($this->question->id)) {\n $buttonarray[] = &$mform->createElement('submit', 'makecopy', get_string('makecopy', 'quiz'));\n }\n $buttonarray[] = &$mform->createElement('cancel');\n $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n $mform->closeHeaderBefore('buttonar');\n }", "function questionCreation_mform(&$mform) {\n global $DB;\n $repeatarray = array();\n\n $repeatarray[] = &$mform->createElement('static', 'question_achor',\n '<a name=\"q{no}\"></a>', '');\n //Question Header\n $repeatarray[] = &$mform->createElement('header', 'question_header_x',\n get_string('question', 'local_evaluations') . ' {no}');\n\n //Question Dialog\n $repeatarray[] = &$mform->createElement('textarea', 'question_x',\n get_string('question_c', 'local_evaluations'),\n array('rows' => 8, 'cols' => 65));\n //$repeatarray[] = &$mform->createElement('htmleditor', 'question_x', get_string('question_c', 'local_evaluations'));\n //Question Types\n $question_types = $DB->get_records('evaluations_question_types');\n $question_types_choices = array();\n //print_object(&$mform);exit();\n foreach ($question_types as $id => $question_type) {\n $question_types_choices[$id] = $question_type->name;\n }\n\n $attributes = array();\n $repeatarray[] = &$mform->createElement('select', 'question_type_id',\n get_string('type_c', 'local_evaluations'),\n $question_types_choices, $attributes);\n\n //james down up delete button\n $mform->registerNoSubmitButton('delete_question_x');\n $mform->registerNoSubmitButton('swapup_question_x');\n $mform->registerNoSubmitButton('swapdown_question_x');\n\n $repeatarray[] = $mform->createElement('html',\n '<div class=\"question_controls\">');\n $repeatarray[] = $mform->createElement('submit', 'delete_question_x',\n get_string('delete'));\n $repeatarray[] = $mform->createElement('html', '</div>');\n\n $repeatarray[] = $mform->createElement('html',\n '<div class=\"question_controls\">');\n $repeatarray[] = $mform->createElement('submit', 'swapup_question_x',\n get_string('up'));\n $repeatarray[] = $mform->createElement('html', '</div>');\n\n $repeatarray[] = $mform->createElement('html',\n '<div class=\"question_controls\">');\n $repeatarray[] = $mform->createElement('submit', 'swapdown_question_x',\n get_string('down'));\n $repeatarray[] = $mform->createElement('html', '</div>');\n\n //Hidden\n //$repeatarray[] = &$mform->createElement('hidden', 'position_x', 0); \n $repeatarray[] = &$mform->createElement('hidden', 'questionid_x', 0);\n $repeatarray[] = &$mform->createElement('hidden', 'question_std', 0);\n\n return $repeatarray;\n}", "function chp_sc_questionbox($atts=null, $inner_content=null) {\n\t$atts['question'] = true;\n\t$atts['arrow'] = false;\n\treturn chp_sc_box($atts, $inner_content);\n}", "function quiz_add_meta_boxes( $post ){\n\tadd_meta_box( 'quiz_meta_box', __( 'Quiz settings', 'random-timed-quiz' ), 'build_meta_box', 'random-timed-quiz', 'normal', 'high' );\t\n}", "function quesition($field)\n{\n\t$str = '<div class=\"question\">';\n\t$str .= '<p id=\"qtitle\">'.$field['name'].'</p>';\n\t//has some hint\n\tif(!empty($field['hint']))\n\t $str .= '<p id=\"qhint\">'.$field['hint'].'</p>';\n\t//proccess input area\n\tif(is_array($field['input'])){\n\t\tswitch($field['input'][0]){\n\t\t\tcase 'checkbox':\n\t\t\t{\n\t\t\t\tfor($i = 1 ; $i < count($field['input']) ; $i++){\n\t\t\t\t $str .= '<p>'.$field['input'][$i].'</p>';\n\t\t\t\t $str .= '<input value=\"'.$field['input'][$i].'\" type=\"checkbox\" name=\"'.$field['name'].'\">';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'select':\n\t\t\t{\n\t\t\t\t$str .= '<select name=\"'.$field['name'].'\">';\n\t\t\t\tfor($i = 1 ; $i < count($field['input']) ; $i++)\n\t\t\t\t $str .= '<option value=\"'.$field['input'][$i].'\">'.$field['input'][$i].'</option>';\n\t\t\t\t$str .= '</select>';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\tswitch($field['input']){\n\t\t\tcase 'text':\n\t\t\t\t$str .= '<input type=\"text\" name=\"'.$field['name'][0].'\">';\n\t\t\t\tbreak;\n\t\t\tcase 'textarea':\n\t\t\t\t$str .= '<input type=\"textarea\" name=\"'.$field['name'][0].'\"';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t$str .= '</div>';\n\t\n\treturn $str;\n}", "public function addQuestion() {\n\t\t\t// Add Classes\n\t\t\t$RepQuestion\t= new RepQuestion();\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= 'nok';\n\t\t\t$courses\t\t= explode('|', (isset($_POST['courses'])) ? trim($_POST['courses']) : false);\n\t\t\t$id_status\t\t= (isset($_POST['id_status'])) ? trim($_POST['id_status']) : false;\n\t\t\t$int_timelimit\t= (isset($_POST['int_timelimit'])) ? trim($_POST['int_timelimit']) : false;\n\t\t\t$tx_question\t= (isset($_POST['tx_question'])) ? General::quotes(trim($_POST['tx_question'])) : false;\n\t\t\t$tx_tutor\t\t= (isset($_POST['tx_tutor'])) ? General::quotes(trim($_POST['tx_tutor'])) : false;\n\t\t\t// If data was sent\n\t\t\tif (($courses) && ($id_status) && ($int_timelimit) && ($tx_question !== false) && ($tx_tutor !== false)) {\n\t\t\t\t$return\t\t= $RepQuestion->insertQuestion($courses, $id_status, $int_timelimit, $tx_question, $tx_tutor);\n\t\t\t}\n\t\t\t// Print Return\n\t\t\techo $return;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a series of custom caches e.g. for a series of user ids Note that the method expects that ids will be included, to delete a cache which isn't specific to a user/licence etc, use the removeCustomItem method which allows a blank value for $uniqueId
public function removeCustomItems(string $cacheKey, array $uniqueIds): array { if (empty($uniqueIds)) { throw new \Exception(self::ERR_NO_IDS_TO_DELETE); } $cacheKeys = []; $cacheConfig = $this->getCustomCacheConfig($cacheKey); $nodeSuffix = $this->getSuffix($cacheConfig['mode']); foreach ($uniqueIds as $uniqueId) { $cacheKeys[$uniqueId] = $cacheKey . $uniqueId . $nodeSuffix; } return @$this->cache->removeItems($cacheKeys); }
[ "public function purgeCustomerMetaIdsCache($params) {\n $ret = true;\n $error_message = '';\n\n $customer_id= isset($params['customer_id']) ? $params['customer_id'] : '';\n $artist_id = isset($params['artist_id']) ? $params['artist_id'] : '';\n if($customer_id) {\n $cache_params = [];\n $hash_name = env_cache(Config::get('cache.keys.customermetaids') . $customer_id);\n $cache_params = ['hash_name' => $hash_name];\n try {\n $purge_cache = $this->deleteHash($cache_params);\n }\n catch (\\Exception $e) {\n $error_messages = ['type' => get_class($e), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];\n \\Log::info('Purge Cache - Customer Meta Ids (' . $customer_id . ') : Fail ', $error_messages);\n }\n\n // Also Delete Temp Meta IDs cache\n $cache_params = [];\n $hash_name = env_cache(Config::get('cache.hash_keys.customer_temp_metaids') . $customer_id);\n $cache_params = ['hash_name' => $hash_name];\n try {\n $purge_cache = $this->deleteHash($cache_params);\n }\n catch (\\Exception $e) {\n $error_messages = ['type' => get_class($e), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];\n \\Log::info('Purge Cache - Customer Meta Ids Temp (' . $customer_id . ') : Fail ', $error_messages);\n }\n }\n else {\n \\Log::info('Trying to Purge Cache - Customer Meta Ids without customer_id ', []);\n }\n\n return $ret;\n }", "function cache_forget_many($cache)\n{\n foreach ($cache as $item) {\n \\Illuminate\\Support\\Facades\\Cache::forget($item);\n }\n}", "public function clearCachesOfRegisteredPageIds() {}", "public function purgeAccountCustomerMetaIdsCache($params) {\n $ret = true;\n $error_message = '';\n\n $customer_id= isset($params['customer_id']) ? $params['customer_id'] : '';\n $artist_id = isset($params['artist_id']) ? $params['artist_id'] : '';\n if($customer_id) {\n $cache_params = [];\n $hash_name = env_cache(Config::get('cache.hash_keys.account_metaids') . $customer_id);\n $cache_params = ['hash_name' => $hash_name];\n try {\n $purge_cache = $this->deleteHash($cache_params);\n }\n catch (\\Exception $e) {\n $error_messages = ['type' => get_class($e), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];\n \\Log::info('Purge Cache - Account Customer Meta Ids (' . $customer_id . ') : Fail ', $error_messages);\n }\n }\n else {\n \\Log::info('Trying to Purge Cache - Account Customer Meta Ids without customer_id ', []);\n }\n\n return $ret;\n }", "public function clear_cache() {\n\t\tdelete_option( 'ithemes-sync-admin_menu' );\n\t\tdelete_option( 'ithemes-sync-dashboard-metaboxes' );\n\n\t\t$users = get_users( array( 'blog_id' => get_current_blog_id(), 'fields' => array( 'ID' ) ) );\n\t\t$meta_key = 'ithemes-sync-admin-bar-items-' . get_current_blog_id();\n\t\tforeach ( $users as $user ) {\n\t\t\tdelete_user_meta( $user->ID, $meta_key );\n\t\t}\n\t}", "protected function removeCache()\n {\n $keys = $this->redis->keys('*');\n $prefix = $this->redis->getOption(Redis::OPT_PREFIX);\n $this->redis->setOption(Redis::OPT_PREFIX, null);\n foreach ($keys as $key) {\n $this->redis->delete($key);\n }\n $this->redis->setOption(Redis::OPT_PREFIX, $prefix);\n }", "public function deleteAllCache($userid = 0, $email = '');", "function deleteCache( $siteStyle, $language, $year, $month, $day, $userID )\r\n{\r\n @eZFile::unlink( \"ezcalendar/user/cache/dayview.tpl-$siteStyle-$language-$year-$month-$day-$userID.cache\" );\r\n @eZFile::unlink( \"ezcalendar/user/cache/monthview.tpl-$siteStyle-$language-$year-$month-$userID.cache\" );\r\n @eZFile::unlink( \"ezcalendar/user/cache/dayview.tpl-$siteStyle-$language-$year-$month-$day-$userID-private.cache\" );\r\n @eZFile::unlink( \"ezcalendar/user/cache/monthview.tpl-$siteStyle-$language-$year-$month-$userID-private.cache\" );\r\n}", "function wp_cache_delete_multiple(array $keys, $group = '')\n {\n }", "public function cleanByCacheIdentifierPrefix($cacheIdentifierPrefix);", "private function clearCache(string $userId) : void\n {\n sugar_cache_clear('teamSetIdByUser' . $userId);\n }", "public function removeReShares() {\n\t\t$stmt = $this->getReShares();\n\n\t\t$owners = [];\n\t\twhile ($share = $stmt->fetch()) {\n\t\t\t$this->shareCache[$share['id']] = $share;\n\n\t\t\t$owners[$share['id']] = [\n\t\t\t\t\t'owner' => $this->findOwner($share),\n\t\t\t\t\t'initiator' => $share['uid_owner'],\n\t\t\t\t\t'type' => $share['share_type'],\n\t\t\t];\n\n\t\t\tif (\\count($owners) === 1000) {\n\t\t\t\t$this->updateOwners($owners);\n\t\t\t\t$owners = [];\n\t\t\t}\n\t\t}\n\n\t\t$stmt->closeCursor();\n\n\t\tif (\\count($owners)) {\n\t\t\t$this->updateOwners($owners);\n\t\t}\n\t}", "function apcu_clear_cache(){}", "public static function burst_optin_ids_cache()\n {\n delete_transient(\"mo_get_optin_ids_footer_display\");\n delete_transient(\"mo_get_optin_ids_inpost_display\");\n }", "public function purgeAccountCustomerIdByMobileCache($params) {\n $ret = true;\n $error_message = '';\n $platforms = Config::get('app.platforms');\n\n $cache_params = [];\n $hash_name = env_cache(Config::get('cache.hash_keys.account_by_mobile'));\n $cache_params = ['hash_name' => $hash_name];\n try {\n $purge_cache = $this->deleteHash($cache_params);\n }\n catch (\\Exception $e) {\n $error_messages = ['type' => get_class($e), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];\n \\Log::info(__METHOD__ . 'Purge Cache - Account Customer Id By Mobile No.', $error_messages);\n }\n\n\n // Then delete cache for all platforms\n if($platforms) {\n foreach ($platforms as $pkey => $platform){\n $cache_params_p = [];\n $platform = trim(strtolower($pkey));\n $hash_name = env_cache(Config::get('cache.hash_keys.account_by_mobile') . ':' . $platform );\n $cache_params_p = ['hash_name' => $hash_name];\n try {\n $purge_cache = $this->deleteHash($cache_params_p);\n }\n catch (\\Exception $e) {\n $error_messages = ['type' => get_class($e), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];\n \\Log::info(__METHOD__ . 'Purge Cache - Account Customer Id By Mobile No. & platform ( ' . $platform . ') : Fail ', $error_messages);\n }\n }\n }\n\n return $ret;\n }", "public function deleteCachedFiles() {\n\t\t$resolutionFileCacheRepository = t3lib_div::makeInstance('Tx_Yag_Domain_Repository_ResolutionFileCacheRepository'); /* @var $resolutionFileCacheRepository Tx_Yag_Domain_Repository_ResolutionFileCacheRepository */\n\t\t$resolutionFileCacheRepository->removeByItem($this);\n\t}", "function nodeCache_InvalidateById( $ids ) {\n\tif ( is_integer($ids) )\n\t\t$ids = [$ids];\n\n\tforeach ( $ids as $id ) {\n\t\tcache_Delete(_nodeCache_GenKey($id));\n\t}\n}", "public function removeCache(): void;", "public function clear_cache() {\n\t\t$methods = $this->get_maybe_cache_methods();\n\t\tforeach ( $methods as $method ) {\n\t\t\t$cache_key = $this->get_cache_key( $method );\n\n\t\t\tif ( get_transient( $cache_key ) ) {\n\t\t\t\tdo_action( 'wpcd_log_error', \"Cached item exists: $cache_key. It will be deleted.\", 'provider-cache', __FILE__, __LINE__ );\n\t\t\t}\n\n\t\t\tdelete_transient( $cache_key );\n\n\t\t\t$cache_key = $this->get_provider_slug() . $this->get_cache_key_prefix() . hash( 'sha256', $this->get_api_key() ) . $method;\n\n\t\t\tif ( get_transient( $cache_key ) ) {\n\t\t\t\tdo_action( 'wpcd_log_error', \"Cached item exists: $cache_key. It will be deleted.\", 'provider-cache', __FILE__, __LINE__ );\n\t\t\t}\n\n\t\t\tdelete_transient( $cache_key );\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save municipios inputted from multiselect
public function saveMunicipios($inputMunicipios) { if (!empty($inputMunicipios)) { $this->municipios()->sync($inputMunicipios); } }
[ "public function actualizarMunicipios() {\n $this->load->model(\"divipola\");\n $iddepto = $this->input->post(\"id\");\n $municipios = $this->divipola->obtenerMunicipios($iddepto);\n echo '<option value=\"-\" selected=\"selected\">Seleccione</option>';\n for ($i = 0; $i < count($municipios); $i++) {\n echo '<option value=\"' . $municipios[$i][\"codigo\"] . '\">' . $municipios[$i][\"nombre\"] . '</option>';\n }\n }", "function HacerMultilist($nombre, $valorpk, $foraneaclass, $nombrecampofk, $intermediaclass, $campopk, $campofk, $campolabelfk, $filtrofk = \"\" )\n{\n\n// $nombre \t\t\t\tNombre del Campo Multiselect\n// $valorpk \t\t\tValor del ID del de la tabla principal por ejemplo : usuario\n// $foraneaclass \t\tClase de la tabla foranea por ejemplo : pais\n// $nombrecampofk\t\tNombre del campo principal en la tabla foranea\n// $intermediaclass \tClase de la tabla intermedia\n// $campopk \t\t\tNombre del campo foraneo en la tabla intermedia relacionado con el ID de la tabla principal\n// $campofk \t\t\tNombre del campo foraneo en la tabla intermedia relacionado con el ID de la tabla foranea\n// $campolabelfk\t\tNombre del campo en la tabla foranea que contiene la descripcion o label de los datos a poner en el multiselect\n// $filtrofk \t\t\tEs el filtro que se aplicara a la tabla foranea para los valores que se mostraran se espera un Array\n/*\n\necho HacerMultilist(\"cursosentri\", $objtrimestres->id_con, \"cursos\", \"id_cur\", \"cursosentrimestres\", \"trimestre_cot\", \"curso_cot\", \"titulo_cur\", $filtrofk = \"\" );\n\n<script>\n \t$(function(){\n\t\t\n\t\t\t$(\".available, .selected\").css(\"width\",\"350px\");\n\t\t\t$(\".ui-multiselect\").css(\"width\",\"701px\");\n\t\t});\n \n </script>\n \n*/\n\tinclude_once(\"../_BRL/\".$foraneaclass.\".ext.php\");\n\tinclude_once(\"../_BRL/\".$intermediaclass.\".ext.php\");\n\t\n\t$ret = \"\";\n\t\n\t$fkclase = \"c\".$foraneaclass. \"_ext\";\n\t$midclase = \"c\".$intermediaclass. \"_ext\";\n\t$objFk = new $fkclase;\n\t$objMid = new $midclase;\n\t\n\tif($filtrofk != \"\") \n\t{\n\t\t$objFk->filtros = $filtrofk;\n\t}\n\n\t$objMid->filtros = array( array(\"Campo\" => $campopk, \"Relacion\" => \"=\", \"Valor\" => $valorpk ) );\n\t$rs = $objMid ->buscar(0,'S');\n\t\n\t$midsel = array();\n\t\n\tfor ($i= 0; $i < $rs->rowCount(); $i++) \n\t{\n\t\t$fila = $rs->getNext(new $midclase()); \n\t\t$midsel[$fila->$campofk] = \"1\" ;\n\t}\n\n\t$rs = $objFk->buscar(0,'S');\n\n\t$ret = '<select id=\"'.$nombre.'\" class=\"multiselect\" multiple=\"multiple\" name=\"'.$nombre.'\" >';\n\n\tfor ($i= 0; $i < $rs->rowCount(); $i++) \n\t{\n\t\t$fila = $rs->getNext(new $fkclase()); \n\t\tif(array_key_exists($fila->$nombrecampofk,$midsel))\n\t\t{ \n\t\t\t$sel = 'SELECTED=\"SELECTED\"';\n\t\t} else \n\t\t{\n\t\t\t$sel = \"\";\n\t\t}\n\t\t$ret .= '<option value=\"'.$fila->$nombrecampofk.'\" '.$sel.'>'.$fila->$campolabelfk.'</option>'; \n\t}\n\n\t$ret .= \"</select>\";\n\t\n\t$js = ' <link type=\"text/css\" href=\"../css/multiselect/ui.multiselect.css\" rel=\"stylesheet\">\n\t\t\t<script type=\"text/javascript\" src=\"../js/multiselect/plugins/localisation/jquery.localisation-min.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"../js/multiselect/plugins/scrollTo/jquery.scrollTo-min.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"../js/multiselect/ui.multiselect.js\"></script>\n\t\t\t\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t$(function(){\n\t\t\t\t\t$.localise(\"ui-multiselect\", {language: \"es\", path: \"../js/multiselect/locale/\"});\n\t\t\t\t\t$(\".multiselect\").multiselect();\n\t\t\t\t});\n\t\t\t</script>';\n\t\t\t\n\treturn $js.\"\\n\\n\\n\".$ret;\n\n}", "function saveOptionsMetaBox() {\n foreach($this->options_menu['models'] as $modelName => $model) {\n if ($model[\"type\"] == \"title\") {\n continue;\n }\n\n $name = $modelName;\n if (isset($model[\"options\"][\"multiLang\"])) {\n $name = $name . \"_\" .ICL_LANGUAGE_CODE;\n }\n $data = isset($_POST[$modelName]) ? $_POST[$modelName] : \"\";\n\n update_option($name, $data);\n }\n }", "function multiselect_save($table,$col1,$col2,$firstvalue,$arr_secondvalues,$db=_DB_MAIN)\n// *************************************************************************************\n{\n $retval = 0;\n\n if ( (strlen($table)>2) and (strlen($col1)>2) and (strlen($col2)>2) and ($firstvalue > 0) )\n {\n\n $qry_delete = \"delete from \".$table.\" where \".$col1.\"=\".$firstvalue;\n $qry_insert = \"insert into \".$table.\" (\".$col1.\",\".$col2.\") values \";\n\n $anz2insert = 0;\n $anz_values = count($arr_secondvalues);\n\n\n // **** 1. WERTE VORHANDEN ****\n if ($anz_values > 0)\n {\n\n for ($i=0;$i<$anz_values;$i++)\n {\n $val = $arr_secondvalues[$i];\n if($val != \"\")\n {\n $qry_insert .= \"(\".$firstvalue.\",\".$val.\"),\";\n $anz2insert += 1;\n }\n }\n\n $qry_insert = substr($qry_insert,0,strlen($qry_insert)-1);\n\n // ALTE DATEN LOESCHEN\n mysql_select($qry_delete,$db);\n\n // NEUE DATEIN EINFUEGEN\n if ($anz2insert > 0)\n $retval = mysql_select($qry_insert,$db);\n }\n\n // *** 2. KEINE WERTE VORHANDEN ABER ORDENTLICH AUFGERUFEN - ALLES LOESCHEN ***\n else\n {\n $retval = mysql_select($qry_delete,$db);\n }\n\n }\n\n return $retval;\n\n}", "function saveMetaBoxe(){\n\n if(isset($_POST['post_type']) && $_POST['post_type'] == $this->name && isset($_POST[\"_safeWpMeta\"])){ \n $id = $_POST['post_ID']; \n \n foreach($this->models as $modelName => $model){\n \n pn_select_save_method($id, $this->name, $modelName, $model); \n \n } \n \n } \n \n }", "function saveSelectedFields() {\n\t\t$db = PearDatabase::getInstance();\n\n\t\t$selectedFields = $this->get('selectedFields');\n\n\t\tif(!empty($selectedFields)){\n\t\t for($i=0 ;$i<count($selectedFields);$i++) {\n\t\t\t\tif(!empty($selectedFields[$i])) {\n\t\t\t\t\t$db->pquery(\"INSERT INTO vtiger_selectcolumn(queryid, columnindex, columnname) VALUES (?,?,?)\",\n\t\t\t\t\t\t\tarray($this->getId(), $i, decode_html($selectedFields[$i])));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function save_selector(){\n\t\t$wfs_details = getUnPass();\n\t\t$project_key = JRequest::getvar( 'project_key' );\n\t\t$fontIdList = array();\n\t\t$selectorIdList = array();\n\t\tforeach($_POST['font_list'] as $key => $fontname)\n\t\t\t{\n\t\t\t$fontidarr = explode(\"@!\",$fontname);\n\t\t\tif($fontidarr[2] != ''){\n\t\t\t\tarray_push($fontIdList,$fontidarr[2]);\n\t\t\t}else{\n\t\t\t\tarray_push($fontIdList,'-1');\n\t\t\t} \n\t\t\t\t$cnt = $key + 1;\n\t\t\t\t$selctor_id = $_POST['selector_'.$cnt];\n\t\t\t\tarray_push($selectorIdList,$selctor_id);\n\t\t\t}\n\t\t$fontids = implode(\",\",$fontIdList);\n\t\t$selectorsids = implode(\",\",$selectorIdList);\n\t\t//Fetching the json data from WFS\n\t\t$apiurl = \"json/Selectors/?wfspid=\".$project_key;\n\t\t$wfs_api = new Services_WFS($wfs_details[1],$wfs_details[2],$apiurl);\n\t\t$jsonUrl = $wfs_api->saveSelector($fontids,$selectorsids);\n\t\t//Creating Json Array\n\t\t$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);\n\t\t$selectorArray = $json->decode($jsonUrl);\t\n\t\t$message = $selectorArray['Selectors']['Message'];\n\t\tif($message == \"Success\"){\n\t\t\t return true;\n\t\t\t}else{\n\t\t\treturn false;\n\t\t\t\t}\n\t\t}", "function alta_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->fecha_alta=date(\"Y-m-d\");\n\t\t$u->estatus_general_id=1;\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function setMultiSelect($multiSelect = true) {}", "function save_minopp($saveSelected) {\n\t\t$savedOpps = \"\";\n\n\t\t// first add all existing saved ones\n\t\tif (!t3lib_div::_GP('showing_saved') && $this->savedMinOpps) { // if not showing saved, then add onto existing list\n\t\t\tforeach ($this->savedMinOpps as $curSaveItem)\n\t\t\t\t$savedOpps .= (!strlen($savedOpps)) ? $curSaveItem : '-'.$curSaveItem;\n\t\t}\n\n\t\t// build a string with all saved minopps\n\t\tif (is_array($saveSelected)) {\n\t\t\tforeach ($saveSelected as $thisItemUID)\n\t\t\t\t$savedOpps .= (!strlen($savedOpps)) ? $thisItemUID : '-'.$thisItemUID;\n\t\t}\n\n\t\t$saveUserData[0] = $savedOpps;\n\t\t$this->savedMinOpps = $savedOpps;\n\t\t$this->setWECcookie($GLOBALS['TSFE']->id, $saveUserData);\n\t}", "public function onSaveCollection()\n {\n $data = $this->formgrid->getData(); // get datagrid form data\n $this->formgrid->setData($data); // keep the form filled\n \n try\n {\n // open transaction\n TTransaction::open('sicad');\n \n // iterate datagrid form objects\n $objects = array();\n foreach ($this->formgrid->getFields() as $name => $field)\n {\n if ($field instanceof TEntry)\n {\n $parts = explode('-', $name);\n $id = end($parts);\n switch ($parts[0])\n {\n case 'valor_base':\n $objects[$id]['valor_base'] = str_replace(',', '', $field->getValue());\n break;\n case 'valor_km':\n $objects[$id]['valor_km'] = str_replace(',', '', $field->getValue());\n break;\n case 'valor_pm':\n $objects[$id]['valor_pm'] = str_replace(',', '', $field->getValue());\n break;\n case 'valor_diaria':\n $objects[$id]['valor_diaria'] = str_replace(',', '', $field->getValue());\n break;\n case 'oculto':\n $objects[$id]['oculto'] = ($field->getValue()) ? 't' : 'f';\n break;\n }\n }\n }\n foreach ($objects as $key=> $object)\n {\n $dado = servico::find($key);\n if ($dado)\n {\n $dado->fromArray( (array) $object);\n $dado->store();\n }\n }\n \n new TMessage('info', AdiantiCoreTranslator::translate('Records updated'));\n \n // close transaction\n TTransaction::close();\n }\n catch (Exception $e)\n {\n // show the exception message\n new TMessage('error', $e->getMessage());\n }\n }", "function insertMunicipality() {\n\t\t$result = $this->conn->insertMunicipality ();\n\t\tdie ( \"{success : $result}\" );\n\t}", "public function saveAction()\n {\n $post = $this->getRequest()->getPost('data');\n\n\n /** @var Oggetto_GeoDetection_Model_Location_Relation_Fetcher $relationModel */\n $relationModel = Mage::getModel('oggetto_geodetection/location_relation_fetcher');\n\n $relationModel->clearByCountryCode($post['country_code']);\n\n $data = [];\n unset($post['country_code']);\n\n foreach ($post as $regionId => $iplocationRegions) {\n foreach ($iplocationRegions as $iplocationRegionName) {\n $data[] = ['directory_region_id' => $regionId, 'iplocation_region' => $iplocationRegionName];\n }\n }\n\n try {\n $relationModel->insertMultiple($data);\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n return $this->_redirect('*/*/');\n }", "abstract function readMultiSelect();", "private static function doSaveMotocatalogueItems() {\n\t\t$save = array();\n\t\t$save['name'] = wgPost::getValue('name');\n\t\t$save['pretext'] = wgPost::getValue('pretext');\n\t\t$save['description'] = wgPost::getValue('description');\n\t\t$save['cubature'] = wgPost::getValue('cubature');\n\t\t$save['power'] = wgPost::getValue('power');\n\t\t$save['kilometers'] = (int) wgPost::getValue('kilometers');\n\t\t$save['price'] = (int) wgPost::getValue('price');\n\t\t$save['discounted_price'] = (int) wgPost::getValue('discounted_price');\n\t\t$save['vintage'] = wgPost::getValue('vintage').'-01-01';\n\t\t$save['technical_approve'] = wgPost::getValue('technical_approve');\n\t\t$save['origin'] = wgPost::getValue('origin');\n\t\t$save['leasing'] = wgPost::getValue('leasing');\n\t\t$save['tax'] = (int) wgPost::getValue('tax');\n\t\t$save['brand'] = wgPost::getValue('brand');\n\t\t$save['type'] = wgPost::getValue('type');\n\t\t$save['promo'] = (int) wgPost::getValue('promo');\n\t\t$save['state'] = wgPost::getValue('state');\n\t\t$save['avail'] = wgPost::getValue('avail');\n\t\tif (!(bool) wgPost::getValue('edit')) $save['added'] = 'NOW()';\n\t\t$save['changed'] = 'NOW()';\n\t\t\n\t\tif ((bool) wgPost::getValue('edit')) {\n\t\t\t$save['where'] = wgPost::getValue('edit');\n\t\t\t$id = (int) $save['where'];\n\t\t\tself::$_par['edit'] = $id;\n\t\t\t$ok = (bool) MotocatalogueItemsModel::doUpdate($save);\n\t\t}\n\t\telse {\n\t\t\t$id = (int) MotocatalogueItemsModel::doInsert($save);\n\t\t\tself::$_par['edit'] = $id;\n\t\t\t$ok = (bool) $id;\n\t\t}\n\t\tif ($ok) {\n\t\t\t//if (isset($_FILES['mainImage']['name'])) moduleMotocatalogue::resizeMainPicture($id, $_FILES['image']);\n\t\t\t//if ((bool) wgPost::getValue('deleteimg')) moduleMotocatalogue::dele($id);\n\t\t\t$startId = MotocatalogueImagesModel::getLastFreeId();\n\t\t\t$arr = backendHelper::saveMultipleFiles('motocatalogue', 'images-original', $id, 'image', backendHelper::$IMAGES_EXTENSIONS, $startId);\n\t\t\tif (!empty($arr) && is_array($arr)) {\n\t\t\t\tforeach ($arr as $file=>$v) {\n\t\t\t\t\t$info = moduleMotocatalogue::resizePicture($file);\n\t\t\t\t\t$info['original'] = $v['original'];\n\t\t\t\t\t$info['size'] = $v['size'];\n\t\t\t\t\t$info['mime'] = $v['mime'];\n\t\t\t\t\t$iid = MotocatalogueImagesModel::insertNewImageFromFile($info, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ok;\n\t}", "public function tiendasEditSelection()\n\t{\n// print_r($_POST);\n \n $codigos_inicio = $_POST['item_row'];\n $estado = $_POST['edit_type'];\n \n require_once 'models/TiendasModel.php';\n $model = new TiendasModel();\n \n foreach ($codigos_inicio as $codes) {\n// print($codes.\"<br>\");\n \n $codes = explode(\"--\", $codes);\n// print_r($codes[0]);\n// print(\"<br>\");\n \n $model->editTiendaEstado($codes[0], $codes[1], $estado);\n }\n\t}", "function save_selector(){\n\t\t$model = $this->getModel('webfontsconfigure');\n\t\t$link = 'index.php?option=com_webfonts&controller=webfontsconfigure&task=edit_stylesheet&cid[]='.$_POST['project_id'];\n\t\tif ($model->save_selector($post)) {\n\t\t\t$msg = JText::_( 'Selector Saved Succesfully!' );\n\t\t\t$this->setRedirect($link, $msg);\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Selector' );\n\t\t\t$this->setRedirect($link, $msg, 'error');\n\t\t}\n\t}", "function act_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han actualizado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function saveSelector()\r\n\t{\r\n\t\t// Prepare\r\n\t\t$success = true;\r\n\t\t$availableLanguages = Language::getAvailableLanguages();\r\n\t\t$metaModel = BluApplication::getModel('meta');\r\n\t\t$selectorId = Request::getInt('selectorId');\r\n\t\t\r\n\t\t// Get request, and validation.\r\n\t\tif (!$internalName = Request::getString('internal')) {\r\n\t\t\tMessages::addMessage('Please fill in the internal name.', 'error');\r\n\t\t\t$success = false;\r\n\t\t}\r\n\t\tif (($languages = Request::getArray('languages')) && !empty($languages)) {\r\n\t\t\tforeach ($languages as $index => &$language) {\r\n\t\t\t\t\r\n\t\t\t\t// If all except \"language code\" are empty, just ignore.\r\n\t\t\t\t$empty = true;\r\n\t\t\t\tforeach ($language as $key => $languageField) {\r\n\t\t\t\t\tif ($key == 'code') {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!empty($languageField)) {\r\n\t\t\t\t\t\t$empty = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($empty) {\r\n\t\t\t\t\tunset($languages[$index]);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Check if has name\r\n\t\t\t\tif (empty($language['name'])) {\r\n\t\t\t\t\tMessages::addMessage('Please fill in the '.$availableLanguages[$language['code']].' name.', 'error');\r\n\t\t\t\t\t$success = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Check if slug in use\r\n\t\t\t\tif (empty($language['slug'])) {\r\n\t\t\t\t\t$language['slug'] = Utility::slugify($language['name']);\r\n\t\t\t\t}\r\n\t\t\t\tif (!$metaModel->metaSelectorSlugAvailable($language['slug'], $language['code'], $selectorId)) {\r\n\t\t\t\t\tMessages::addMessage('The slug <code>'.$language['slug'].'</code> ('.$internalName.' - '.$availableLanguages[$language['code']].') is already in use.', 'error');\r\n\t\t\t\t\t$success = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tunset($language);\r\n\t\t} else {\r\n\t\t\tMessages::addMessage('Please enter at least one group of language-specific information.', 'error');\r\n\t\t\t$success = false;\r\n\t\t}\r\n\t\tif ((!$values = Request::getArray('values')) || empty($values)) {\r\n\t\t\tMessages::addMessage('Please enter at least one meta value.', 'error');\r\n\t\t\t$success = false;\r\n\t\t}\r\n\t\tif (!$success) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$hidden = Request::getBool('hidden');\r\n\t\t$order = Request::getInt('order');\r\n\t\t$images = Request::getFiles('images');\r\n\t\t$groups = Request::getArray('groups');\r\n\t\t\r\n\t\t// Save images, if any\r\n\t\t$uploadedImages = array();\r\n\t\tif (!empty($images)) {\r\n\t\t\tforeach ($images as $key => $image) {\r\n\t\t\t\tif (!Upload::isValid($image)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (!$hashedImageName = Upload::saveFile($image, BLUPATH_ASSETS.'/metaimages/')) {\r\n\t\t\t\t\tMessages::addMessage('Could not upload file <code>'.$image['name'].'</code>. Please try again.', 'error');\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$uploadedImages[$key] = $hashedImageName;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Do we update existing...?\r\n\t\tif ($selectorId) {\r\n\t\t\tif (!$metaModel->updateMetaSelector($selectorId, array(\r\n\t\t\t\t'internalName' => $internalName,\r\n\t\t\t\t'display' => !$hidden,\r\n\t\t\t\t'images' => $uploadedImages,\r\n\t\t\t\t'sequence' => $order\r\n\t\t\t), true)) {\r\n\t\t\t\t$success = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Remove languages, we are adding them back later\r\n\t\t\tif (!$metaModel->deleteLanguageMetaSelectors($selectorId)) {\r\n\t\t\t\t$success = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Remove value assignments, we are adding them back later\r\n\t\t\tif (!$metaModel->deleteMetaSelectorValues($selectorId, true)) {\r\n\t\t\t\t$success = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Remove group assignments, we are adding them back later\r\n\t\t\tif (!$metaModel->deleteMetaSelectorGroups($selectorId, true)) {\r\n\t\t\t\t$success = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t// ...or add new?\r\n\t\t} else {\r\n\t\t\t$selectorId = $metaModel->addMetaSelector($internalName, array(\r\n\t\t\t\t'display' => !$hidden,\r\n\t\t\t\t'images' => $uploadedImages,\r\n\t\t\t\t'sequence' => $order\r\n\t\t\t), true);\r\n\t\t}\r\n\t\t\r\n\t\tif ($selectorId && $success) {\r\n\t\t\t\r\n\t\t\t// Languages\r\n\t\t\tforeach ($languages as $language) {\r\n\t\t\t\tif (!$metaModel->addLanguageMetaSelector($selectorId, $language['code'], $language['name'], $language['description'], $language['keywords'], $language['pageTitle'], $language['listingTitle'], $language['slug'], $language['pageDescription'])) {\r\n\t\t\t\t\t$success = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Values\r\n\t\t\tforeach ($values as $groupId => $groupValues) {\r\n\t\t\t\tforeach ($groupValues as $value) {\r\n\t\t\t\t\tif (!$metaModel->addMetaSelectorValue($selectorId, $groupId, $value, true)) {\r\n\t\t\t\t\t\t$success = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Groups\r\n\t\t\tif (!empty($groups)) {\r\n\t\t\t\tforeach ($groups as $groupId) {\r\n\t\t\t\t\tif (!$metaModel->addMetaSelectorGroup($selectorId, $groupId, 'selector_replace', true)) {\r\n\t\t\t\t\t\t$success = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$success = false;\r\n\t\t}\r\n\t\t\r\n\t\t// Flush cache\r\n\t\t$metaModel->clearMetaSelectorCache($selectorId);\r\n\t\t//$metaModel->rebuildHierarchy(); // we do this in the GBoD already.\r\n\t\t\r\n\t\t// Back to value listing\r\n\t\tif ($success) {\r\n\t\t\tMessages::addMessage('Meta selector <code>'.$internalName.'</code> saved', 'info');\r\n\t\t}\r\n\t\treturn $this->selectors();\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the src of the first image from post
function catch_the_first_image( $post_id = null ) { if ( empty( $post_id ) ) { return; } $post = get_post( $post_id ); $first_img = ''; $output = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches ); $first_img = isset( $matches[1][0] ) ? $matches[1][0] : ''; return $first_img; }
[ "function okfn_get_first_image_url_from_post_content() {\n\t global $post;\n\n\t$first_img_url = '';\n\t$is_image_file = false;\n\n\t// Match <img> tags within post content.\n\t$image_urls = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches );\n\n\tif ( $image_urls ) :\n\n\t\t$first_img_url = $matches[1][0];\n\n\tendif;\n\n\tif ( empty( $first_img_url ) ) :\n\n\t\t// Reset value if no image is available.\n\t\t$first_img_url = false;\n\n\tendif;\n\n\treturn $first_img_url;\n}", "function first_post_image() {\n\tglobal $post, $posts;\n\t$first_img = '';\n\tob_start();\n\tob_end_clean();\n\tif( preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches ) ){\n\t\t$first_img = $matches[1][0];\n\t\treturn $first_img;\n\t}\n}", "function get_first_image ($postID) {\n $post = get_post($postID);\n $first_img = '';\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n $first_img = $matches [1] [0];\n\n // no image found return NULL\n if(empty($first_img))\n return NULL;\n return $first_img;\n}", "function hedmark_first_post_image() {\n\tglobal $post, $posts;\n\t$first_img = '';\n\tob_start();\n\tob_end_clean();\n\tif( preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches ) ){\n\t\t$first_img = $matches[1][0];\n\t\treturn $first_img;\n\t}\n}", "function s_get_first_image(){\n\tglobal $post, $posts;\n\t$first_img = '';\n\tob_start();\n\tob_end_clean();\n\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\n\t$first_img=\"\";\n\n\tif(isset($matches[1][0]))\n\t\t$first_img = $matches[1][0];\n\n\treturn $first_img;\n}", "function post_image_src() {\r\n\tif ( !$post_id )\r\n\t\tglobal $post;\r\n\tpreg_match_all( '|<img.*?src=[\\'\"](.*?)[\\'\"].*?>|i', $post->post_content, $matches );\r\n\tif ( isset( $matches ) )\r\n\t\t$image = $matches[1][0];\r\n\tif ( $matches[1][0] ) {\r\n\t\treturn $matches[1][0];\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}", "public function getFirstImageUrl();", "function flo_catch_first_content_image($post, $return_falback_img = true) {\n\n \t$first_img = '';\n \tob_start();\n \tob_end_clean();\n\n \t$output = preg_match('/< *img[^>]*src *= *[\"\\']?([^\"\\']*)/i', $post->post_content, $matches);\n\n \tif(isset($matches[1]) ){\n \t\t$first_img = $matches[1];\n \t}\n\n \tif($return_falback_img && empty($first_img)){ //Defines a default image\n \t$first_img = \"/images/default.jpg\";\n \t}\n \treturn $first_img;\n}", "function get_first_image($html){\n if (!empty($html)) {\n\t\t\n\trequire_once('simple_html_dom.php');\n $post_dom = str_get_html($html);\n $first_img = $post_dom->find('img', 0);\n if($first_img !== null) {\n\t$image = $first_img->src;\n\tif (strtok($image, '?') != '') {\n\t$image = strtok($image, '?');\n\t} else {\n\t$image = $image;\n\t}\n return $image;\n }\n return null;\n\t} else {\n\treturn null;\n\t}\n}", "public function getImage(){\n\t\tif($primary = Model_Media_Base::find_most_voted_tag($this,'image',1))\n\t\t{\n\t\t\treturn $primary->original_url;\n\t\t}\n\t\treturn null;\n\t}", "function wpgrade_get_first_gallery_image_src($post_ID,$image_size) {\n\t$post_type = get_post_type($post_ID);\n\n\tswitch ($post_type) {\n\t\tcase wpgrade::shortname().'_portfolio':\n\t\t\t$gallery_ids = get_post_meta( $post_ID, wpgrade::prefix() . 'project_gallery', true );\n\t\t\tbreak;\n\t\tcase wpgrade::shortname().'_gallery':\n\t\t\t$gallery_ids = get_post_meta( $post_ID, wpgrade::prefix() . 'main_gallery', true );\n\t\t\tbreak;\n\t}\n\n\tif (!empty($gallery_ids)) {\n\t\t$gallery_ids = explode(',',$gallery_ids);\n\t} else {\n\t\t$gallery_ids = array();\n\t}\n\n\tif ( !empty($gallery_ids[0]) ) {\n\t\treturn wp_get_attachment_image_src($gallery_ids[0], $image_size);\n\t} else {\n\t\treturn null;\n\t}\n}", "function first_img_details( $post_content ) {\n\t$found_img = false;\n\t$dom = new \\DOMDocument;\n\t$dom->loadHTML( $post_content );\n\t$imgs = $dom->getElementsByTagName( 'img' );\n\n\tif ( 0 === $imgs->length ) {\n\t\t$found_img = false;\n\t} else {\n\t\t$src = $imgs->item( 0 )->getAttribute( 'src' );\n\t\tpreg_match( '/[^\\?]+\\.(jpg|jpe|jpeg|gif|png)/i', $src, $matches );\n\t\t$class = $imgs->item( 0 )->getAttribute( 'class' );\n\t\t$alt = $imgs->item( 0 )->getAttribute( 'alt' ) ?: __( 'Featured Image', 'bestof' );\n\t\t$name = basename( $matches[0] );\n\n\t\t$found_img = array(\n\t\t\t'src' => $src,\n\t\t\t'class' => $class,\n\t\t\t'alt' => $alt,\n\t\t\t'name' => basename( $matches[0] ),\n\t\t\t);\n\n\t\tif ( $id = get_attachment_id_from_url( $src ) ) {\n\t\t\t$found_img['id'] = $id;\n\t\t}\n\n\t\treturn $found_img;\n\t}\n}", "public function getFirstImage() {\n\t\tforeach($this->images as $image){\n\t\t\treturn $image;\n\t\t}\t\t\n\t}", "public function getContentFirstImage()\n {\n if (!empty($this->content)) {\n $doc = new \\DOMDocument();\n $doc->loadHTML($this->content);\n\n foreach ($doc->getElementsByTagName('img') as $image) {\n return Html::img($image->getAttribute('src'), [\n 'class' => $image->getAttribute('class'),\n 'width' => $image->getAttribute('width'),\n 'height' => $image->getAttribute('height'),\n 'alt' => $image->getAttribute('alt'),\n ]);\n }\n }\n\n return null;\n }", "public function getFirstImage() {\n\t\t$images = $this->getImage()->toArray();\n\t\treturn $images[0];\n\t}", "public function getFirstImage() {\n $image = $this->getImage()->toArray();\n return $image[0];\n }", "function ContentImage() {\n\t\t// Check for image\n\t\t$img = $this->owner->obj('FeaturedImage');\n\t\tif ($img && $img->exists()) return $img;\n\t\t// else try to get first image tag from article.\n\t\t$matches = array();\n\t\tif (preg_match('#<img [^>]*src=\"([^\">]+)\"#smi', $this->owner->Content, $matches)) {\n\t\t\tif (isset($matches[1])) {\n\t\t\t\t$filename = preg_replace('#_resampled/resizedimage[0-9a-z]+/#smi', '', $matches[1]);\n\t\t\t\t$file = DataObject::get_one('File', 'Filename=\\''.Convert::Raw2SQL($filename).'\\'');\n\t\t\t\tif ($file) return $file;\n\t\t\t}\n\t\t}\n\t}", "function su_get_post_image( $post_id = false ) {\n\n\t\tglobal $post;\n\n\t\t$id = ( $post_id ) ? $post_id : $post->ID;\n\t\t$default = su_plugin_url() . '/images/thumbnail.png';\n\t\t$timthumb = su_plugin_url() . '/lib/timthumb.php';\n\t\t$meta = 'thumbnail';\n\n\t\t// Check post-thumbnails theme support\n\t\tif ( !current_theme_supports( 'post-thumbnails' ) )\n\t\t\tadd_theme_support( 'post-thumbnails' );\n\n\t\t// Get post attachments\n\t\t$attachments = get_posts( array(\n\t\t\t'post_type' => 'attachment',\n\t\t\t'numberposts' => 1,\n\t\t\t'order' => 'ASC',\n\t\t\t'post_status' => null,\n\t\t\t'post_parent' => $id\n\t\t\t) );\n\n\t\t### Post thumbnail ###\n\t\tif ( has_post_thumbnail( $id ) ) {\n\t\t\t$image = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'full' );\n\t\t\t$src = $image[0];\n\t\t}\n\n\t\t### Meta field ###\n\t\telseif ( get_post_meta( $id, $meta, true ) ) {\n\t\t\t$src = get_post_meta( $id, $meta, true );\n\t\t}\n\n\t\t### First post attachment ###\n\t\telseif ( $attachments ) {\n\t\t\t$vars = get_object_vars( $attachments[0] );\n\t\t\t$src = $vars['guid'];\n\t\t}\n\n\t\t### First post_content image ###\n\t\telse {\n\t\t\tob_start();\n\t\t\tob_end_clean();\n\t\t\t$output = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches );\n\t\t\t$src = $matches[1][0];\n\t\t}\n\n\t\t### Default image ###\n\t\tif ( empty( $src ) ) {\n\t\t\t$src = $default;\n\t\t}\n\n\t\treturn $src;\n\t}", "function ccImj_getFirstImg( $content )\n\t{\n\t\t$numOfImages = preg_match_all(\"/<img[^<>]+>/\", $content, $img_array);\n\t\t\n\t\tif($numOfImages >= 1) {\n\t\t\n\t\t\t$image_url = $img_array[0][0];\n\t\t\tpreg_match('@<(img|image)[^>]*src=\"([^\"]*)\"[^>]*>@Usi', $image_url, $matches);\n\t\t\t$image_filepath = $matches[2];\n\t\t\tif (! ccImj_isLocal( $image_filepath )) { // check if file is hosted on same server\n\t\t\t\t$image_filepath = DEFAULT_IMAGE;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$image_filepath = DEFAULT_IMAGE;\n\t\t}\n\n\t\treturn $image_filepath;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saca permisos de un usuario en un modulo
function getPermisosUsuarioModulo($idUsuario, $idModulo){ $this->db->select("*"); $this->db->from("usuarioModulo"); $this->db->where("idUsuario", $idUsuario); $this->db->where("idModulo", $idModulo); return $this->db->get()->row_array(); }
[ "public function permisos() \n {\n $this->_permisos->validaPermiso($this->_claseActual);\n }", "public function comprobarUser(){\n $usuario = JFactory::getUser();\n \n // Comprobamos que sea administrador y creamos en User la\n // propiedad de permisoLoteria .\n if (array_search('7',$usuario->getAuthorisedGroups())>0 || array_search('8',$usuario->getAuthorisedGroups())>0 ){\n // Indicamos que tienes permiso ver loteria.\n JFactory::getUser()->set('permisoLoteria','OK');\n \n } else {\n // No deberíamos continuar, debería indicar que no tiene permisos.\n JFactory::getUser()->set('permisoLoteria','KO');\n\n }\n \n return ;\n }", "public function permisos();", "public function permisos_id_usuario_modulo($usuario_id,$modulo){\n\n $permisos = array();\n $conexion = abrir_conexion();\n if ($conexion !== null) {\n try {\n $modulo=$modulo.\"%\";\n $sql = \"SELECT distinct u.id,p.id,p.nombre,p.admin\n FROM usuario u INNER JOIN usuario_tiene_rol utr ON (u.id=utr.usuario_id)\n INNER JOIN rol r ON (utr.rol_id=r.id)\n INNER JOIN rol_tiene_permiso rtp ON (r.id=rtp.rol_id)\n INNER JOIN permiso p ON (rtp.permiso_id=p.id)\n WHERE u.id=:usuario_id AND p.nombre LIKE :modulo AND utr.eliminado=0\n ORDER BY p.id\" ;\n $sentencia = $conexion->prepare($sql);\n $sentencia->bindParam(\":usuario_id\", $usuario_id);\n $sentencia->bindParam(\":modulo\",$modulo);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll();\n if (count($resultado)) {\n foreach ($resultado as $r) {\n $acciones=explode(\"_\",$r['nombre']);\n $permisos[] = $acciones[1];\n }\n }\n } catch (PDOException $ex) {\n throw new Exception(\"error consulta repositorioPermiso->permisos_id_usuario_modulo \" . $ex->getMessage());\n }\n }\n $conexion = null;\n return $permisos;\n }", "private function verificarPermisos() {\n if (empty($this->session->get_userdata('usuario'))) {\n $this->session->set_flashdata('mensaje', \n array(\n 'exito' => false,\n 'mensaje' => 'Debe iniciar sesión para realizar esta acción.'\n )\n );\n\n redirect('inicio');\n }\n }", "function get_permissoes_usuario($usuario, $session = false) {\n\n\t\t//Coleta as permissoes\n\t\t$permissoes = $this->CI->System_model->get_permissoes_usuario($usuario);\n\n\t\t//Faz o loop pra colocar no array $perm\n\t\t$perm = array();\n\t\tforeach($permissoes as $perm_modulo) {\n\t\t\t$perm[] = $perm_modulo->submodulo;\n\t\t}\n\n\t\t//Coloca na sessao, se for verdadeiro o parametro $session\n\t\tif($session) {\n\t\t\t$this->CI->session->set_userdata('permissoes', $perm);\n\t\t}\n\n\t\t//Retorna as permissoes\n\t\treturn $perm;\n\t}", "private function getPermisosSuperUsuario(){\n return [\n [\n 'ruta'=>'/*',\n 'descripcion'=>'acceso total a todos los modulos'\n ],\n [\n 'ruta'=>'/gii/*',\n 'descripcion'=>'acceso a generador de codigo'\n ],\n ];\n }", "function editar_permisos($usuarios_permisos,$id_usuario)\n {\n $permisos_editados=$this->comparar_permisos($id_usuario,$usuarios_permisos);\n //var_dump($permisos_editados);\n //Si es mayor a 0 se llama la funcion recursiva y verifica si se edito al menos 1 permiso.\n if (count($permisos_editados)>0) {\n $this->recursiva($id_usuario,$permisos_editados);\n }\n $query = sprintf(\"DELETE from users_permisos WHERE id_usuario = %d\", $id_usuario);\n $result = $this->db->execute($query);\n\n $this->guardar_permisos_usuario($usuarios_permisos,$id_usuario);\n\n\n\n return $result;\n }", "function buscarPermisos($archivo_id=null, $usuario_id=null){\r\n\t\tif($archivo_id!=null && $usuario_id!=null){\r\n\t\t\t$sql = \"SELECT Usuario.id, Usuario.nombre_c, Permiso.id, Permiso.read, Permiso.write\r\n\t\t\tFROM usuarios Usuario LEFT JOIN permisos Permiso\r\n\t\t\tON (Usuario.id=Permiso.usuario_id AND Permiso.archivo_id='$archivo_id')\r\n\t\t\tWHERE Usuario.id<>'$usuario_id'\r\n\t\t\tORDER BY Usuario.nombre_c\";\r\n\t\t\t\r\n\t\t\treturn $this->query($sql);\r\n\t\t}\r\n\t}", "public function getPermissoesUsuario() {\n try {\n $query = Doctrine_Query::create()\n ->select('cod_permissaoGeral')\n ->from($this->table_alias)\n ->where('pu.cod_usuario = ?', $_SESSION['UserId']);\n\n //Resultado da Query\n return $query->execute();\n } catch (Doctrine_Exception $e) {\n echo $e->getMessage();\n }\n }", "private function validarPermisos(){\n if(!Sistema::app()->acceso()->puedeConfigurar()){\n Sistema::app()->paginaError(404,\"Solo los administradores pueden acceder\");\n exit;\n }\n \n \n \n }", "public function acl_usuario($idusuario) {\n // Sumo Pontifice, Redactor, Editor o Disabled (3, 2, 1, 0)\n\n }", "public function allowed($usuario){\n\n $usuario_model = UsuarioRol::find()->where(['usuario' => $usuario])->all();\n $permisos = array();\n\n foreach ($usuario_model as $key) {\n\n /*Obtener Permisos Rol*/\n $permiso_rol = PermisoRol::find()->where(['rol_id' => $key->rol_id])->all();\n\n foreach ($permiso_rol as $key2) {\n\n $permisos [] = strtolower( rtrim($key2->permiso->nombre) );\n\n }\n }\n\n\n return $permisos;\n\n\n }", "private function getPermisosBotonera()\n\t{\n\t\t$auth = new Zend_Session_Namespace('veoliaZend_Auth');\n\t\t$rol = Zend_Registry::get('role');\n\t\t$permisos = array();\n\t\t$permisos[\"edit\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"edit\"))? true : false;\n\t\t$permisos[\"add\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"add\"))? true : false;\n\t\t$permisos[\"delete\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"delete\"))? true : false;\n\t\t$permisos[\"password\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"password\"))? true : false;\n\t\t$permisos[\"estado\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"estado\"))? true : false;\n\t\t$permisos[\"detail\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"detail\"))? true : false;\n\t\treturn $permisos;\n\t}", "public function seleccionarPermisos($id_usuario){\r\n\t\t$this->setIdUsuario($id_usuario);\r\n\t\ttry{\r\n\t\t\t$sql=\"SELECT id_opcion from acceso where id_usuario=?\";\r\n\t\t\t$parametros=array($this->getIdUsuario());\r\n\t\t\t$rst= $this->bd->ejecutar($sql,$parametros);\r\n\t\t\tif($this->bd->myException->getEstado()==0){\r\n\t\t\t\twhile($rs=$rst->fetch()){\r\n\t\t\t\t\t$campos[]=array(\"opcion1\"=>$rs[\"id_opcion\"]);\r\n\t\t\t\t};\r\n\t\t\t\treturn $campos;\r\n\t\t\t}else{\r\n\t\t\t\t$this->myException->setEstado(1);\r\n\t\t\t\tforeach($this->bd->myException->getMensaje() as $er){\r\n\t\t\t\t\t$this->myException->addError(array('user'=>$er['user'],'admin'=>$er['admin'].\" METODO seleccionarPermisos \".$this->__toString()));\r\n\t\t\t\t}//fin del for each que me informa del error \r\n\t\t\t}\r\n\t\t}catch(Exception $e){\r\n\t\t\t$this->myException->setEstado(1);\r\n\t\t\t$error=array(\r\n\t\t\t 'user'=>'SE PRODUJO UN ERROR. COMUNICARSE CON EL ADMINISTRADOR DEL SISTEMA.',\r\n\t\t\t\t'admin'=>$e->getMessage().\"<br>codigo: \".$e->getCode().\"<br>linea: \".$e->getLine().\"<br>archivo: \".$e->getFile()\r\n\t\t\t);\r\n\t\t\t$this->myException->addError($error);\r\n\t\t}\r\n\t}", "public function usuarios(){\n \t$info_config=Model::getInstance()->iniciarDatos();\n \t$this->comprobarSesion();\n \tif( in_array(\"administrador\", $_SESSION[\"roles\"]) && in_array(\"usuario_index\", $_SESSION[\"permisos\"]) ){ //linea permiso en array\n\t \t$pagina;\n\t \tif (!isset($_GET[\"pagina\"])){\n\t \t\t$pagina=\"\";\n\t \t}else{\n\t \t\t$pagina=$_GET[\"pagina\"];\n\t \t}\n\t \t$data=Model::getInstance()->listadoUsuarios($pagina, $info_config['cantidad_pagina']);\n\t \t\n if (isset($_GET['msj'])){\n $msj = $_GET['msj'];\n }else{\n $msj = '';\n }\n $view = new Usuarios();\n if (count($data) > 0){\n $view->show($data['items'], $data['totalPaginas'], $data['paginaActual'], $_SESSION['nombre_usuario'], $info_config['titulo'], $info_config['mail'], $_SESSION[\"roles\"], $_SESSION[\"permisos\"], $msj);\n }else{\n $view->show([], 0, 0, $_SESSION['nombre_usuario'], $info_config['titulo'], $info_config['mail'], $_SESSION[\"roles\"], $_SESSION[\"permisos\"], $msj);\n }\n\t }\n }", "private function getPermisosBotonera()\n\t{\n\t\t$auth = new Zend_Session_Namespace('veoliaZend_Auth');\t\n\t\t$rol = Zend_Registry::get('role');\n\t\t$permisos = array();\n\t\t$permisos[\"edit\"] = ($auth->_acl->isAllowed($rol,\"default:agrupacion\",\"edit\"))? true : false;\n\t\t$permisos[\"add\"] = ($auth->_acl->isAllowed($rol,\"default:agrupacion\",\"add\"))? true : false;\n\t\t$permisos[\"delete\"] = ($auth->_acl->isAllowed($rol,\"default:agrupacion\",\"delete\"))? true : false;\n\t\t$permisos[\"detail\"] = ($auth->_acl->isAllowed($rol,\"default:agrupacion\",\"detail\"))? true : false;\n\t\treturn $permisos;\n\t}", "private function getPermisosBotonera()\n\t{\n\t\t$auth = new Zend_Session_Namespace('veoliaZend_Auth');\t\n\t\t$rol = Zend_Registry::get('role');\n\t\t$permisos = array();\n\t\t$permisos[\"edit\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"edit\"))? true : false;\n\t\t$permisos[\"add\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"add\"))? true : false;\n\t\t$permisos[\"delete\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"delete\"))? true : false;\n\t\t$permisos[\"menulateral\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"menulateral\"))? true : false;\n\t\t$permisos[\"detail\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"detail\"))? true : false;\n\t\treturn $permisos;\n\t}", "function realizarModificacion(){\r\n\t$user = new User();\r\n\tif($user->modifyUser($_POST['usuario_id'],$_POST['name'],$_POST['username'],$_POST['password'],$_POST['role'],$_POST['phone'])){\r\n\t\taddNotificacion(\"Usuario modificado\",\"succcess\");\r\n\t\tredirecionarWithParams($GLOBALS['CONTROLLER_URL'].'adminController.php',array(array('action','gestionarUsuario')));\r\n\t}\r\n\telse{\r\n\t\taddNotificacion(\"Usuario no modificado\",\"danger\");\r\n\t\tredirecionarWithParams($GLOBALS['CONTROLLER_URL'].'adminController.php',array(array('action','gestionarUsuario')));\r\n\t}\t\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns value of '_midas' property
public function getMidas() { return $this->get(self::_MIDAS); }
[ "public function getMID() { \n return $this->getConfigData(\"MID\");\n }", "public function getMid()\n\n {\n\n return $this->mid;\n\n }", "public function getMid()\n {\n return $this->mid;\n }", "function getAmaraSubtitlesID($mid) {\n\tif (!isset($mid) || !is_numeric($mid) || $mid * 1 == 0) {\n\t\treturn false;\n\t}\n\t$mid = (int) $mid * 1;\n\t$info = getMediaInfo($mid);\n\tif (isset($info['amara']) && trim($info['amara']) != '') {\n\t\treturn $info['amara'];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getMidasReply()\n {\n return $this->get(self::_MIDAS_REPLY);\n }", "public function getMedicina()\n {\n return $this->medicina;\n }", "public function getMangaByIDPublic(){\n return JSON::encode($this->getManga(),true);\n }", "public function getId_manga()\n {\n return $this->id_manga;\n }", "public function getManzana()\r\n\t{\r\n\t\treturn($this->manzana);\r\n\t}", "public function getMed_apellido()\n {\n return $this->med_apellido;\n }", "public function getManhaquinta()\r\n {\r\n return $this->manhaquinta;\r\n }", "public static function _lookupObjIdsByMID($a_mid)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = \"SELECT * FROM remote_course_settings \".\n\t\t\t\"WHERE mid = \".$ilDB->quote($a_mid ,'integer').\" \";\n\t\t\t\n\t\t$res = $ilDB->query($query);\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\n\t\t{\n\t\t\t$obj_ids[] = $row->obj_id;\n\t\t}\n\t\treturn $obj_ids ? $obj_ids : array();\n\t}", "public function masculino()\n {\n \treturn self::MASCULINO;\n }", "public function get_data_masjid()\n {\n $query = $this->db->get('masjid');\n return $query->result();\n }", "public function getManhasexta()\r\n {\r\n return $this->manhasexta;\r\n }", "function get_post_meta_by_id( $mid ) {\n\treturn get_metadata_by_mid( 'post', $mid );\n}", "function get_metadatum_id() {\n return $this->get_mapped_property('metadatum_id');\n }", "public function getMedida() {\n return $this->iMedida;\n }", "public function setMidas(Up_Midas $value)\n {\n return $this->set(self::_MIDAS, $value);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a JOIN clause to the query using the Letters relation
public function joinLetters($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Letters'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if ($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'Letters'); } return $this; }
[ "private function join()\n {\n $a = $this->prefix($this->pk(), $this->table());\n $b = $this->prefix($this->pk(), $this->ee_table);\n\n ee()->db->join($this->ee_table, $a . ' = ' . $b, 'inner');\n }", "public function useLettersQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinLetters($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Letters', '\\LettersQuery');\n }", "protected abstract function getJoinStatement();", "function search_authors_join( $join ) {\n\t\t\n\t\tif ($this->is_inner_query) {\n\t\t\treturn $join;\n\t\t}\n\t\t\n\t\tglobal $wpdb;\n\n\t\tif ( $this->is_tainacan_search ) {\n\t\t\t$join .= \" LEFT JOIN $wpdb->users AS u ON ($wpdb->posts.post_author = u.ID) \";\n\t\t}\n\t\treturn $join;\n\t}", "abstract function appendJoin(AbstractQuery &$query, $sourceAlias, $targetAlias, $left_join = false);", "public function add_lang_join($sql)\n {\n // Inject the additional relationship query\n $sql = str_replace('FROM exp_channel_titles', 'FROM exp_channel_titles LEFT JOIN exp_transcribe_entries_languages tel ON tel.entry_id = exp_channel_titles.entry_id', $sql);\n return $sql;\n }", "#[@arg]\n public function setJoin() {\n $this->criteria->setFetchmode(Fetchmode::join('Person'));\n }", "function join($column,$filter,$foreign_column, $kind='inner', $filter_in_join=false)\n \t{\n \t\t$this->joins[]=new Join($column,$filter,$foreign_column,$kind, $filter_in_join);\n \t}", "public function addJoin(JoinQueryComponent $component) { $this->joins[] = $component; }", "public function join($tableName, $expression = '', $alias = '', $args = []);", "public function getJoin()\n {\n return $this->get(self::_JOIN);\n }", "public function addJoin($tables, $direction='INNER') {\r\n\t\t// Allow for :alias at the end of the specification\r\n\t\t@list($tables, $alias) = explode(\":\", $tables, 2);\r\n\t\t$alias_ = $alias ? \" AS $alias \" : \"\";\r\n\t\t\r\n\t\t// Expects table1.field1=table2.field2 or table.field\r\n\t\t@list($part1, $part2) \t\t= array_reverse(explode(\"=\", $tables, 2));\r\n\t\t@list($field1, $table1) \t= array_reverse(explode(\".\", $part1, 2));\r\n\t\t@list($field2, $table2) \t= array_reverse(explode(\".\", $part2, 2));\r\n\t\t$field2 = @$field2 ? $field2 : $field1 ;\r\n\t\t$table2 = @$table2 ? $table2 : $this->query[$this->query_id][\"table\"] ;\r\n\t\tif (!@$this->query[$this->query_id][\"tables\"][$table1]) {\r\n\t\t\tif($alias_) $tables = \"$direction JOIN $table1 $alias_ ON $table1.$field1=$alias.$field2\"; \r\n\t\t\telse $tables = \"$direction JOIN $table1 ON $table1.$field1=$table2.$field2\";\r\n\t\t\t$this->query[$this->query_id][\"tables\"][$table1] = \"JOIN\";\r\n\t\t} else {\r\n\t\t\tif($alias_) $tables = \"$direction JOIN $table2 $alias_ ON $alias.$field2=$table1.$field1\";\r\n\t\t\telse $tables = \"$direction JOIN $table2 ON $table2.$field2=$table1.$field1\";\r\n\t\t\t$this->query[$this->query_id][\"tables\"][$table2] = \"JOIN\";\r\n\t\t}\r\n\t\t$this->query[$this->query_id][\"join\"][] = $tables;\r\n\t\treturn $this;\r\n\t}", "public function InnerJoin()\n\t\t{\n\t\t\treturn $this->AddSubComponent(ExtensionsHandler()->ExtendableObject('\\DaFramework\\Model\\Abstraction\\InnerJoin'));\n\t\t}", "private function injectJoin(&$query, $table, $first, $second)\n {\n $joins = [];\n\n foreach ((array) $query->joins as $join)\n $joins[] = $join->table;\n\n if (!in_array($table, $joins))\n $query->join($table, $first, '=', $second, 'left');\n }", "private function getJoinClause() : string\n {\n $sql = '';\n foreach ($this->join as $j) {\n $sql .= sprintf(' %s %s %s', $j['type'], $j['table'], $j['alias']);\n if ($j['keyCol'] && $j['refCol']) {\n $sql .= sprintf(' ON %s=%s.%s', $j['keyCol'], $j['alias'], $j['refCol']);\n }\n }\n\n return $sql;\n }", "private function join_associations_table( $join ) {\n\t\t$association_table = $this->get_table_names()->association_table();\n\t\t$posts_table_name = $this->wpdb->posts;\n\t\t$target_element_column = $this->target_role->get_name() . '_id';\n\t\t$for_element_column = $this->target_role->other() . '_id';\n\n\t\t$join .= $this->wpdb->prepare(\n\t\t\t\" LEFT JOIN {$association_table} AS toolset_associations ON ( \n\t\t\t\ttoolset_associations.relationship_id = %d\n\t\t\t\tAND toolset_associations.{$target_element_column} = {$posts_table_name}.ID\n\t\t\t\tAND toolset_associations.{$for_element_column} = %d\n\t\t\t) \",\n\t\t\t$this->relationship->get_row_id(),\n\t\t\t$this->for_element->get_default_language_id()\n\t\t);\n\n\t\treturn $join;\n\t}", "public function join()\n\t{\n\t\t// We do a left outer join here because we're not trying to limit the primary table's results\n\t\t// This function is primarily used when needing to sort by a field in the joined table\n\t\t$this->model->select($this->model->getQualifiedFieldName('*'))\n\t\t ->select($this->related->getQualifiedFieldName('*'))\n\t\t ->join($this->associativeTable,\n\t\t $this->model->getQualifiedFieldName($this->localKey),\n\t\t $this->associativeLocal,\n\t\t 'LEFT OUTER')\n\t\t ->join($this->related->getTableName(),\n\t\t $this->associativeRelated,\n\t\t $this->related->getQualifiedFieldName($this->relatedKey),\n\t\t 'LEFT OUTER');\n\n\t\treturn $this;\n\t}", "public function getJoin()\n\t{\n\t\treturn isset($this->_query['join']) ? $this->_query['join'] : '';\n\t}", "public function get_join_clause()\n {\n return $this->condition->get_join_clause();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true when defaultNamespaces are set
public static function hasDefaultNamespaces() { return (!empty(self::$_defaultNamespaces)); }
[ "public function areNamespacesEnabled();", "private function useNamespace(): bool\n {\n return empty($this->_ns) == false;\n }", "public function inNamespace()\n {\n return false;\n }", "public function hasNamespace() {\n return ($this->namespace !== '');\n }", "public function inNamespace()\n\t{\n\t\treturn '' !== $this->getNamespaceName();\n\t}", "public function isDefaultNamespace ($namespaceURI) {}", "public function hasNamespace();", "public function hasNamespace(): bool\n {\n return $this->namespaceAttr !== NULL;\n }", "public function hasNamespace()\n {\n $this->_load();\n return isset($this->_data[self::NAME_SPACE]);\n }", "public function isNamespace()\n\t{\n\t\treturn $this->_type == T_NAMESPACE;\n\t}", "function isDefaultNamespace ($ns)\n\t{\n\t\tswitch ($this->nodeType) {\n\t\t\tcase 1:\n\t\t\t\tif (!$this->prefix) {\n\t\t\t\t\treturn $this->namespaceURI === $ns;\n\t\t\t\t}\n\t\t\t\tif ($this->attributes->length) {\n\t\t\t\t\t$xmlns = $this->attributes->getNamedItem(\"xmlns\");\n\t\t\t\t\tif ($xmlns !== null) {\n\t\t\t\t\t\treturn $xmlns === $ns;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($this->parentNode) {\n\t\t\t\t\treturn $this->parentNode->isDefaultNamespace($ns);\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tif ($this->documentElement) {\n\t\t\t\t\treturn $this->documentElement->isDefaultNamespace($ns);\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif ($this->ownerElement) {\n\t\t\t\t\treturn $this->ownerElement->isDefaultNamespace($ns);\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\tcase 5:\n\t\t\tcase 7:\n\t\t\tcase 8:\n\t\t\t\tif ($this->parentNode) {\n\t\t\t\t\treturn $this->parentNode->isDefaultNamespace($ns);\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\treturn false;\n\t}", "public function inNamespace(): bool\n {\n return false !== strpos($this->name, '\\\\');\n }", "private function loadNamespace()\n {\n if (array_key_exists('namespace', $this->manifest)) {\n if (empty($this->manifest['namespace'])) {\n return false;\n }\n\n // set namespace into this object\n $this->namespace = $this->manifest['namespace'];\n\n // set a global var for this namespace\n global $namespace;\n $namespace = $this->namespace;\n\n define('THEME_NAMESPACE', $namespace);\n\n return true;\n }\n }", "public function getDefaultNamespaces()\n {\n return $this->defaultNamespaces;\n }", "public function canSetLocalNamespace()\n {\n return $this->canSetLocalNamespace;\n }", "abstract protected function getDefaultNamespace();", "public function getSupportedNamespaces(): array;", "public static function getDefaultNamespaces()\n {\n return self::$_defaultNamespaces;\n }", "protected function isNamespace() {\n\t return $this->value === '';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HookHandler for BS hook BsAdapterAjaxPingResult
public function onBsAdapterAjaxPingResult( $sRef, $aData, $iArticleId, $sTitle, $iNamespace, $iRevision, &$aSingleResult ) { if ( $sRef !== 'WhoIsOnline') return true; $oTitle = Title::newFromText( $sTitle, $iNamespace ); if ( is_null($oTitle) || !$oTitle->userCan('read') ) return true; $aWhoIsOnline = $this->getWhoIsOnline(); $aSingleResult['count'] = count( $aWhoIsOnline ); $aSingleResult['portletItems'] = array(); foreach ( $aWhoIsOnline as $oWhoIsOnline ) { $oUser = User::newFromId( $oWhoIsOnline->wo_user_id ); $oWhoIsOnlineItemWidgetView = new ViewWhoIsOnlineItemWidget(); $oWhoIsOnlineItemWidgetView->setUser( $oUser ); $oWhoIsOnlineItemWidgetView->setUserDisplayName( $this->mCore->getUserDisplayName( $oUser ) ); $aSingleResult['portletItems'][] = $oWhoIsOnlineItemWidgetView->execute(); } $aSingleResult['success'] = true; return true; }
[ "function ping_bing() {\r\n Configure::write('debug', 0);\r\n $url = 'http://www.bing.com/webmaster/ping.aspx';\r\n $params = '&siteMap=' . urlencode(FULL_BASE_URL . $this->sitemap_url);\r\n echo $this->__ajaxresponse($this->__check_ok_bing( $this->__ping_site($url, $params) ));\r\n exit();\r\n }", "public function admin_ping_bing() {\n\t\t Configure::write('debug', 0);\n\t\t$url = 'http://www.bing.com/webmaster/ping.aspx';\n\t\t$params = '&siteMap=' . urlencode(FULL_BASE_URL . $this->sitemap_url);\n\t\techo $this->__ajaxresponse($this->admin_check_ok_bing( $this->__ping_site($url, $params) ));\n\t\texit();\n\t}", "public function getAjaxStatus() {}", "protected function _process_ajax() {}", "function bbp_is_ajax()\n{\n}", "public function mp_hook_abo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('abo');\n\t\t}", "function wp_ajax_nopriv_heartbeat() {}", "public function startAjaxHaltingHook() {\n\t\treturn array( $this, 'haltAjax' );\n\t}", "protected function onUpdateAjax() {}", "abstract protected function getTransactionAjaxResponseCallback();", "function wp_ajax_heartbeat()\n {\n }", "protected function send_ajax_failure_response()\n {\n }", "private function display_ajaxresponse(){\r\n print('<u style=\"cursor:pointer\" onclick=\"$(\\'#_'. $this->jq_gridName .'_debug_ajaxresponse\\').toggle(\\'fast\\');\">AJAX RESPONSE</u><br />');\r\n print(\"<pre id='_\". $this->jq_gridName .\"_debug_ajaxresponse' style='border:1pt dotted black;padding:5pt;background:yellow;color:black;display:block'>\");\r\n print(\"</pre>\");\r\n }", "public static function handle_ajax() {\n\t\tHelpers::ajax_wrapper( array( self::class, 'ajax_handler_body' ) );\n\t}", "public function action_ajax_status()\n {\n $task = $this->request->param('task');\n if ($task != '')\n {\n $widget = $this->widget_status($task);\n $widget->to_response($this->request);\n }\n\n $this->_action_ajax();\n }", "function verify_ajax()\n {\n }", "public function ajaxProcess()\n\t{\n\t}", "public function ajaxStatusAction(){\r\n\t\t\t$result = $this->_model->changeStatus($this->arrParams, array(\"task\" => \"change-ajax-status\"));\r\n\t\t\techo json_encode($result);\r\n\r\n\t\t}", "public function initAjaxHooks();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds (current) password element and validators for user/profile
public function addCurrentPasswordElement() { $fs = $this->get('user'); $fs->add([ 'type' => 'password','name' => 'current-password', 'attributes' => ['class' => 'form-control','id' => 'current-password'] ]); $inputFilter = $this->getInputFilter(); $input = new Input('current-password'); $input->getFilterChain()->attachByName('StringTrim'); $chain = $input->getValidatorChain(); $hash = $fs->getObject()->getPassword(); $chain->attachByName('NotEmpty', [ 'required' => true, 'allow_empty' => false, 'break_chain_on_failure' => true, 'messages' => ['isEmpty' => 'current password is required',] ]) ->attachByName('Callback', [ 'callback' => function ($password) use ($hash) { /** @todo trigger a failed-authentication/security event? */ return password_verify($password, $hash); }, 'messages' => [ Callback::INVALID_VALUE => 'Authentication failed: invalid password.' ] ]); $inputFilter->get('user')->add($input); return $this; }
[ "private function password()\n {\n $element = new Password('password');\n $element->setLabel('Password');\n $element->setAttribute('class', 'form-control');\n $element->setAttribute('placeholder', 'Password');\n $element->addValidators(array(\n new PresenceOf(array('message' => 'Password is required'))\n ));\n $this->add($element);\n }", "protected function password() {\n $element = new Password('passwordTxt');\n $element->setLabel('Password');\n $element->setAttribute('class', 'form-control');\n $validators = array( new PresenceOf(array('message' => 'Password is required')) );\n if($this->request->isPost() && $this->request->getPost('passwordTxt')){\n $validators[] = new StringLength(array(\n \"min\" => 8,\n \"max\" => 16,\n \"messageMaximum\" => \"Password must not be greater than 16 characters\",\n \"messageMinimum\" => \"Password must be between 8-16 characters\",\n ));\n }\n $element->addValidators($validators);\n $element->setUserOption('lblRequired', true);\n $this->add($element); \n }", "private function AddPasswordField()\n {\n $name = 'Password';\n \n $this->AddField(Input::Password($name));\n //Password needs contain lower case letter, upper case letter, and a digit\n //$validator = new RegExp('/((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]))/');\n //$this->AddValidator($name, $validator);\n $this->AddValidator($name, new StringLength(6, 20));\n if (Request::PostData('PasswordRepeat') || !$this->user->Exists())\n {\n $this->SetRequired($name);\n }\n }", "public function getPasswordElement()\n {\n $element = $this->getElement($this->passwordFieldName);\n\n if (! $element) {\n // Veld password\n $element = $this->createElement('password', $this->passwordFieldName);\n $element->setLabel($this->translate->_('Password'));\n $element->setAttrib('size', 40);\n $element->setRequired(true);\n\n if ($this->getOrganizationElement() instanceof \\Zend_Form_Element_Hidden) {\n $explain = $this->translate->_('Combination of user and password not found.');\n } else {\n $explain = $this->translate->_('Combination of user and password not found for this organization.');\n }\n $element->addValidator(new \\Gems_User_Validate_GetUserPasswordValidator($this, $explain));\n\n $this->addElement($element);\n }\n\n return $element;\n }", "protected function _password()\n {\n $element = new Zend_Form_Element_Text('password');\n $element->setLabel('Password')\n ->addDecorators($this->_inputDecorators)\n ->setRequired(true)\n ->addValidator(\n 'StringLength',\n false,\n array('min' => Users_Model_User::MIN_PASSWORD_LENGTH)\n );\n\n return $element;\n }", "function form_process_password_confirm($element) {\n $element['pass1'] = array(\n '#type' => 'password',\n '#title' => t('Password'),\n '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],\n '#required' => $element['#required'],\n '#attributes' => array('class' => array('password-field')),\n );\n $element['pass2'] = array(\n '#type' => 'password',\n '#title' => t('Confirm password'),\n '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],\n '#required' => $element['#required'],\n '#attributes' => array('class' => array('password-confirm')),\n );\n $element['#element_validate'] = array('password_confirm_validate');\n $element['#tree'] = TRUE;\n\n if (isset($element['#size'])) {\n $element['pass1']['#size'] = $element['pass2']['#size'] = $element['#size'];\n }\n\n return $element;\n}", "public function password_fields() {\n\t\t$template = Theme_My_Login::get_object()->get_active_instance();\n\t\t?>\n\t\t<p class=\"tml-user-pass1-wrap\">\n\t\t\t<label for=\"pass1<?php $template->the_instance(); ?>\"><?php _e( 'Password', 'theme-my-login' ); ?></label>\n\t\t\t<input autocomplete=\"off\" name=\"pass1\" id=\"pass1<?php $template->the_instance(); ?>\" class=\"input\" size=\"20\" value=\"\" type=\"password\" />\n\t\t</p>\n\t\t<p class=\"tml-user-pass2-wrap\">\n\t\t\t<label for=\"pass2<?php $template->the_instance(); ?>\"><?php _e( 'Confirm Password', 'theme-my-login' ); ?></label>\n\t\t\t<input autocomplete=\"off\" name=\"pass2\" id=\"pass2<?php $template->the_instance(); ?>\" class=\"input\" size=\"20\" value=\"\" type=\"password\" />\n\t\t</p>\n\t\t<?php\n\t}", "public function setValidPassword() {\n //check if we have a password\n if ($this->getUserPassword()) {\n //hash the password\n $this->setPassword($this->hashPassword($this->getUserPassword()));\n } else {\n //check if the object is new\n if ($this->getId() === NULL) {\n //new object set a random password\n $this->setRandomPassword();\n //hash the password\n $this->setPassword($this->hashPassword($this->getUserPassword()));\n }\n }\n }", "function theme_field_password($name, $value, $label, $error, $input_id, $options = NULL)\n{\n return _theme_field_input_password($name, $value, $label, $error, $input_id, $options, 'password');\n}", "function visitFormPassword(T_Form_Password $node)\n {\n $attributes = $node->getAllAttributes();\n $attributes += array('type' => 'password',\n 'name' => $node->getFieldname(),\n 'id' => $this->getNodeId($node),\n 'value' => $node->getDefault()\n );\n $xhtml = $this->createLabel($node).\n $this->createInput($node,$attributes);\n $this->addXhtml($xhtml);\n }", "public function signup_password_init() {\n\t\t\t$value = $this->get_value( 'form', 'signup_password', 'off' );\n\t\t\tif ( 'on' != $value ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$file = ub_files_dir( 'modules/custom-login-screen/signup-password.php' );\n\t\t\tinclude_once $file;\n\t\t\tnew ub_signup_password();\n\t\t}", "function expand_password_confirm($element) {\n $element['pass1'] = array(\n '#type' => 'password',\n '#title' => t('Password'),\n '#value' => $element['#value']['pass1'],\n '#required' => $element['#required'],\n );\n $element['pass2'] = array(\n '#type' => 'password',\n '#title' => t('Confirm password'),\n '#value' => $element['#value']['pass2'],\n '#required' => $element['#required'],\n );\n $element['#validate'] = array('password_confirm_validate' => array());\n $element['#tree'] = TRUE;\n\n if (isset($element['#size'])) {\n $element['pass1']['#size'] = $element['pass2']['#size'] = $element['#size'];\n }\n\n return $element;\n}", "function add_password($name, $rules='', $class='', $style='', $id='')\n\t{\n\t\t$this->add_input('password', $name, '', $id, $class, $style);\n\t\tif($rules != '')\n\t\t{\n\t\t\t$this->label($rules, $this->rules_class);\n\t\t}\n\t}", "private function updatePassword()\n {\n $db = \\phpws2\\Database::getDB();\n $tbl = $db->addTable('prop_contacts');\n $newdt = new \\phpws2\\Database\\Datatype\\Varchar($tbl, 'password', 255);\n $tbl->alter($tbl->getDataType('password'), $newdt);\n }", "public function settings_field_api_password()\n\t\t{\n\t\t\t$setting = isset($this->settings['bullhorn_api_password']) ? $this->settings['bullhorn_api_password'] : '';\n\t\t\techo '<input type=\"password\" size=\"40\" name=\"bullpen_settings[bullhorn_api_password]\" value=\"' . esc_attr($setting) . '\" />';\n\t\t\t// echo '<input type=\"text\" size=\"40\" name=\"bullpen_settings[bullhorn_api_password]\" value=\"' . esc_attr( $setting ) . '\" />';\n\t\t}", "public function addPasswords()\n\t{\n\t\t// loop fields\n\t\tforeach(func_get_args() as $argument)\n\t\t{\n\t\t\t// not an array\n\t\t\tif(!is_array($argument)) $this->add(new SpoonFormPassword($argument));\n\n\t\t\t// array\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($argument as $name => $defaultValue) $this->add(new SpoonFormPassword($name, $defaultValue));\n\t\t\t}\n\t\t}\n\t}", "function password_field($name, $value = null, $attributes = null) {\n if(is_array($attributes)) {\n $attributes['type'] = 'password';\n } else {\n $attributes = array('type' => 'password');\n } // if\n \n return text_field($name, $value, $attributes);\n }", "function password($name,$value,$info,$size=20,$open_fn=\"open_row\",$close_fn=\"close_row\") {\n global $theme;\n \n $name=$this->item($name);\n \n $this->$open_fn($info);\n print \"\\t<input type=password name=$name value='$value' size=$size>\\n<BR>\";\n $theme->form_error($this->my_name);\n $this->$close_fn($info);\n \n return(0);\n }", "public static function inputPassword($model,$attribute,$properties=array()) {\n// $attr = self::getNameValueID($model, $attribute);\n// $input_attributes = self::getInputAttributes($attr,$properties);\n// return '<input type=\"password\" ' . $input_attributes . ' />';\n return self::inputTag('password', $model, $attribute,$properties); \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create table for trace
public function create_table_trace($trace) { $result = mysqli_query($this->dblink, "CREATE TABLE IF NOT EXISTS `notifications_trace".$trace."` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_twt` bigint(20) NOT NULL, `idnxt_twt` bigint(20) NOT NULL, `id_trace` int(11) NOT NULL, `size` int(11) NOT NULL, `time_to_next` bigint(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;") or die(mysqli_error($this->dblink)); return $result; }
[ "function create_table()\n {\n }", "private function createDummyTable() {}", "private function newTrackingTable () {\n\t\t//set timezone for timestamps\n\t\tdate_default_timezone_set('America/Toronto');\n\t\t$query = \n\t\t\t\"CREATE TABLE IF NOT EXISTS a2_tracking (id INTEGER AUTO_INCREMENT, hostname VARCHAR(100), url VARCHAR(100), timestamp VARCHAR(20), sequence INTEGER, increment INTEGER, count INTEGER, PRIMARY KEY (id))\";\n\t\t$this->sendQuery($query);\n\t}", "private function make_table() {\n $result = $this->query(\n \"CREATE TABLE IF NOT EXISTS events(\n data BLOB\n );\"\n );\n if ($result === false) {\n cli_error_log(\"EventsDatabase: could not make table. Reason: \"\n .$this->lastErrorMsg());\n }\n }", "public function createTables();", "protected function createDbTable()\n\t{\n\t\t$db = $this->getDbConnection();\n\t\t$driver = $db->getDriverName();\n\t\t$autoidAttributes = '';\n\t\tif ($driver === 'mysql') {\n\t\t\t$autoidAttributes = 'AUTO_INCREMENT';\n\t\t}\n\t\tif ($driver === 'pgsql') {\n\t\t\t$param = 'SERIAL';\n\t\t} else {\n\t\t\t$param = 'INTEGER NOT NULL';\n\t\t}\n\n\t\t$sql = 'CREATE TABLE ' . $this->_logTable . ' (\n\t\t\tlog_id ' . $param . ' PRIMARY KEY ' . $autoidAttributes . ',\n\t\t\tlevel INTEGER,\n\t\t\tcategory VARCHAR(128),\n\t\t\tprefix VARCHAR(128),\n\t\t\tlogtime VARCHAR(20),\n\t\t\tmessage VARCHAR(255))';\n\t\t$db->createCommand($sql)->execute();\n\t}", "public function createTable()\n {\n $table = self::$table_name;\n $table_extra_type = FRAMEWORK_TABLE_PREFIX.'event_extra_type';\n $table_group = FRAMEWORK_TABLE_PREFIX.'event_group';\n $SQL = <<<EOD\n CREATE TABLE IF NOT EXISTS `$table` (\n `id` INT(11) NOT NULL AUTO_INCREMENT,\n `extra_type_id` INT(11) DEFAULT NULL,\n `group_id` INT(11) DEFAULT NULL,\n `timestamp` TIMESTAMP,\n PRIMARY KEY (`id`),\n CONSTRAINT\n FOREIGN KEY (`extra_type_id`)\n REFERENCES $table_extra_type(`extra_type_id`)\n ON DELETE CASCADE,\n CONSTRAINT\n FOREIGN KEY (`group_id`)\n REFERENCES $table_group (`group_id`)\n ON DELETE CASCADE\n )\n COMMENT='The table to assign extra fields to event groups'\n ENGINE=InnoDB\n AUTO_INCREMENT=1\n DEFAULT CHARSET=utf8\n COLLATE='utf8_general_ci'\nEOD;\n try {\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Created table 'event_extra_group'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "private function createLogsTable()\n {\n $this->db->raw(\"\n CREATE TABLE IF NOT EXISTS logs (\n id INTEGER PRIMARY KEY,\n task_id VARCHAR(20) NOT NULL,\n group_id INTEGER NULL,\n description VARCHAR(255) NULL,\n started_at TIMESTAMP CURRENT_TIMESTAMP NOT NULL,\n ended_at TIMESTAMP NULL,\n log VARCHAR(10) NULL,\n synced TINYINT DEFAULT 0\n );\n \");\n }", "abstract protected function createTable();", "public static function createTable()\r\n\t{\r\n\t\t$EE =& get_instance();\r\n\t\t$EE->load->dbforge();\r\n\t\t$EE->dbforge->add_field(self::$table_fields);\r\n\t\t$EE->dbforge->add_key('id', TRUE);\r\n\r\n\t\tif (!$EE->dbforge->create_table(self::$table_name, TRUE))\r\n\t\t{\r\n\t\t\tshow_error(\"Unable to create table in \".__CLASS__.\": \" . $EE->config->item('db_prefix') . self::$table_name);\r\n\t\t\tlog_message('error', \"Unable to create settings table for \".__CLASS__.\": \" . $EE->config->item('db_prefix') . self::$table_name);\r\n\t\t}\r\n\t}", "private function create_tables() {\n global $wpdb;\n\n include_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\n $collate = $wpdb->get_charset_collate();\n\n $table = \"CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}dokan_delivery_time` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `order_id` int(11) NOT NULL,\n `vendor_id` int(11) NOT NULL,\n `date` varchar(25) NOT NULL DEFAULT '',\n `slot` varchar(25) NOT NULL DEFAULT '',\n `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`),\n KEY `key_vendor_id_date` (`vendor_id`,`date`),\n KEY `key_slot` (`slot`)\n ) ENGINE=InnoDB {$collate}\";\n\n dbDelta( $table );\n }", "private function createCallVerificationTable(): void\n {\n $call_verification_table = \"\n CREATE TABLE \".$this->callVerificationTable.\" (\n uuid CHAR(16) NOT NULL,\n mobile VARCHAR(16) NOT NULL,\n call_received INT(1) NOT NULL DEFAULT 0,\n completed INT NOT NULL DEFAULT 0,\n created DATETIME NOT NULL,\n modified DATETIME NOT NULL\n )\";\n\n printf(\"Creating table %s\\n\", $this->callVerificationTable);\n $this->pdo->query($call_verification_table);\n }", "public function build_tables ( ) {\n\n // Pull the event names\n $sql = \"SELECT name FROM tracked_events WHERE active = 1\";\n\n $tracked_events = $this->query( $sql );\n\n // Iterate over the tracked events\n foreach ($tracked_events as $event) {\n\n // Create a new table for each event\n $sql = \"CREATE TABLE IF NOT EXISTS `\" . $event['name'] . \"` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `date` datetime NOT NULL,\n `value` int(11) NOT NULL,\n `active` int(11) NOT NULL,\n UNIQUE KEY `id` (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8\";\n\n $this->query( $sql );\n\n }\n\n }", "function createWorkAtTable() {\n global $db_conn;\n \n executePlainSQL(\"DROP TABLE Work_At\");\n\n echo \"<br> creating Work_At table <br>\";\n\n executePlainSQL(\"CREATE TABLE Work_At(\n AddressID\tint,\n CourierID\tint,\n CONSTRAINT Work_At_pk PRIMARY KEY (AddressID, CourierID))\");\n \n OCICommit($db_conn);\n }", "public function createTable()\n {\n $sql = new Sql($this->adapter);\n\n try {\n $select = $sql->select(self::TABLE);\n $queryString = $sql->getSqlStringForSqlObject($select);\n $this->adapter->query($queryString, Adapter::QUERY_MODE_EXECUTE);\n } catch (\\Exception $err) {\n $table = new Ddl\\CreateTable(self::TABLE);\n $table->addColumn(new Ddl\\Column\\Char('migration', 255));\n $table->addColumn(new Ddl\\Column\\Text('up'));\n $table->addColumn(new Ddl\\Column\\Text('down'));\n\n $queryString = $sql->getSqlStringForSqlObject($table);\n $this->adapter->query($queryString, Adapter::QUERY_MODE_EXECUTE);\n }\n }", "public function createTable() {\n\t\t$dbw = wfGetDB( DB_MASTER );\n\n\t\t$tableName = $dbw->tableName( self::tableName );\n\t\t$indexName = $dbw->tableName( self::indexName );\n\n\t\t$tablesql = \"CREATE TABLE $tableName ( article_id INT, kvcategory VARCHAR(255), kvkey VARCHAR(255), kvvalue TEXT)\";\n\t\t$indexsql = \"CREATE INDEX $indexName on $tableName (article_id, kvcategory)\";\n\n\t\t$dbw->begin();\n\t\t$dbw->query( $tablesql );\n\t\t$dbw->query( $indexsql );\n\t\t$dbw->commit();\n\t}", "public function createTable() {\n\n $sql = \"CREATE TABLE IF NOT EXISTS `bk_color_codes` (\n\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t`name` varchar(30) NOT NULL DEFAULT '',\n\t\t`color` varchar(7) NOT NULL DEFAULT '',\n\t\t`text` varchar(7) NOT NULL DEFAULT '',\t\t\n\t\t`display_order` int(11) NOT NULL DEFAULT 0,\n `id_space` int(11) NOT NULL DEFAULT 1,\n `who_can_use` int(11) NOT NULL DEFAULT 1,\n\t\tPRIMARY KEY (`id`)\n\t\t);\";\n\n $this->runRequest($sql);\n\n $this->addColumn(\"bk_color_codes\", \"who_can_use\", \"int(11)\", 1);\n }", "public function createTable()\n {\n $table = self::$table_name;\n $SQL = <<<EOD\n CREATE TABLE IF NOT EXISTS `$table` (\n `identifier_id` INT(11) NOT NULL AUTO_INCREMENT,\n `identifier_type_name` VARCHAR(255) NOT NULL DEFAULT 'PAGE',\n `identifier_type_id` FLOAT NOT NULL DEFAULT '-1',\n `identifier_mode` ENUM('IP', 'EMAIL') NOT NULL DEFAULT 'IP',\n `identifier_timestamp` TIMESTAMP,\n PRIMARY KEY (`identifier_id`),\n INDEX (`identifier_type_name`, `identifier_type_id`)\n )\n COMMENT='The RatingIdentifier table'\n ENGINE=InnoDB\n AUTO_INCREMENT=1\n DEFAULT CHARSET=utf8\n COLLATE='utf8_general_ci'\nEOD;\n try {\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Created table 'collection_rating_identifier'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "protected function createLogTable($db,$tableName)\n\t{\n\t\t$db->createCommand()->createTable($tableName, array(\n\t\t\t'id'=>'pk',\n\t\t\t'level'=>'varchar(128)',\n\t\t\t'category'=>'varchar(128)',\n\t\t\t'logtime'=>'integer',\n\t\t\t'message'=>'text',\n\t\t));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns TRUE if a younger patch level release exists in version matrix that may be a development release.
public function isYoungerPatchDevelopmentReleaseAvailable() {}
[ "public function isYoungerPatchReleaseAvailable() : bool {}", "public function isYoungerPatchReleaseAvailable() {}", "public static function is_development_version() {\n\t\treturn ! preg_match( '/^\\d+(\\.\\d+)+$/', JETPACK__VERSION );\n\t}", "public function isOnCorrectMinorReleaseBranch(): bool\n {\n if (!preg_match('#^([0-9]{1,2}\\.[0-9]{1,2})\\.[0-9]{1,2}#', $this->version, $matches)) {\n return false;\n }\n return $matches[1] == $this->getLibrary()->getBranch();\n }", "public function hasMinor(): bool {\n\t\treturn $this->minor !== null;\n\t}", "function is_update_version() {\n return $this->version['stage'] <= self::latest_stage;\n }", "public function hasMinor()\n {\n return $this->minor !== null;\n }", "public function isStable()\n {\n return empty($this->preRelease) && 0 !== $this->major;\n }", "public function isBetaRelease(){\n\t\treturn Mage::getStoreConfigFlag('modulecreator/release/beta');\n\t}", "public function getYoungestPatchDevelopmentRelease() {}", "public function isMinor(): bool\n {\n if ($this->hasPreReleaseSuffix()) {\n return false;\n }\n\n if (!isset($this->versionNumber[1]) || $this->versionNumber[1] === 0) {\n return false;\n }\n\n $length = count($this->versionNumber);\n for ($index = 2; $index < $length; $index++) {\n if ($this->versionNumber[$index] > 0) {\n return false;\n }\n }\n\n return true;\n }", "public function isStable(): bool\n {\n return $this->major > 0 && !$this->isPreRelease();\n }", "private static function _checkProjectVersion() {\n $composer_openfed = json_decode(file_get_contents('composer.openfed.json'), TRUE);\n $current_version = $composer_openfed['require']['openfed/openfed8'];\n preg_match('/(?:[\\d+\\.?]+[a-zA-Z0-9-]*)/', $current_version, $matches);\n // If current version is dev, we should ignore version check.\n if (strpos($current_version, 'dev') !== FALSE) {\n return FALSE;\n }\n\n return version_compare($matches[0], '10.0', '>=');\n }", "public function is_jedi_version()\n {\n try\n {\n $l_dao = $this->get_connection();\n $l_result_set = $l_dao->query('SELECT * FROM installationinfo');\n $l_arr = $l_dao->fetch_row_assoc($l_result_set);\n if (isset($l_arr['edition']))\n {\n return (strtolower($l_arr['edition']) == 'essential') ? true : false;\n }\n else\n {\n // old version\n return false;\n } // if\n }\n catch (Exception $e)\n {\n return false;\n } // try\n }", "public function getIsNewRelease()\n {\n $tags = $this->getLibrary()->getTags();\n return !array_key_exists($this->getVersion()->getValue(), $tags);\n }", "static public function isStable(){\n\t\t$last = substr(self::VERSION, -1);\n\t\tif ($last == 'a' || $last == 'b')return false;\n\t\t\n\t\treturn true;\n\t}", "function is_beta() {\n return $this->version['stage'] === self::release_stage &&\n $this->version['release_stage'] === self::release_stage_beta;\n }", "public function has_versions()\n {\n return ($this->get_current() != 1);\n }", "public function isStableRelease($package_name)\n {\n return $this->getReleaseType($package_name) === 'stable';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Split strings by regexp
public function split($regexp) { $items = new StringCollection(); foreach ($this->items as $item) { $data = preg_split($regexp, $item); foreach ($data as $string) { $items[] = $string; } } return $items; }
[ "function getPregSplitArray($pattern, $str)\n\t{\n\t\treturn preg_split($pattern, $str, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t}", "function preg_split($pattern, $subject, $max_splits = null, $mode = null)\n{\n return array();\n}", "function preg_split ($pattern, $subject, $limit = null, $flags = null) {}", "public function testSplitWithManyPatterns()\n {\n $tok = new RegexTokenizer(array(\n WhitespaceTokenizer::PATTERN, \t// split on whitespace\n array(\"/([^\\.])\\.$/\",'$1 .'),\t// replace <word>. with <word><space>.\n \"/ /\"\t\t\t\t\t\t\t// split on <space>\n ));\n\n // example text stolen from NLTK :-)\n $str = \"Good muffins cost $3.88\\nin New York. Please buy me\\ntwo of them.\\n\\nThanks.\";\n\n $tokens = $tok->tokenize($str);\n $this->assertCount(17, $tokens);\n $this->assertEquals($tokens[3], \"$3.88\");\n $this->assertEquals($tokens[7], \".\");\n $this->assertEquals($tokens[14], \".\");\n $this->assertEquals($tokens[16], \".\");\n }", "static function split($string, $what){\n\t\t\n\t\tif(!self::test_regex($what)){\n\t\t\treturn explode($what, $string);\n\t\t}\n\t\t\n\t\treturn preg_split($what, $string);\n\t\t\n\t}", "abstract public function split();", "function split($regex, $limit = -1)\n {\n return preg_split($regex, $this->inner, $limit);\n }", "function mb_str_split($string) {\n // and not before the end: $\n return preg_split('/(?<!^)(?!$)/u', $string);\n}", "function splitPattern(string $pattern): Closure\n{\n /**\n * @param string $name\n * @return string[]\n */\n return function (string $string) use ($pattern): ?array {\n return \\preg_split($pattern, $string) ?: null;\n };\n}", "function mb_str_split( $string ) {\n # and not before the end: $ \n return preg_split('/(?<!^)(?!$)/u', $string ); \n}", "function split($str) {\n\t\treturn array_map('trim',\n\t\t\tpreg_split('/[,;|]/',$str,0,PREG_SPLIT_NO_EMPTY));\n\t}", "public static function splitSplitCase($str) {\n $output = preg_split('/_+/', $str);\n $output = array_merge(array_filter($output, function ($a) {\n return $a !== '';\n }));\n if (!count($output)) $output = array('');\n return $output;\n }", "function mb_str_split( $string ) {\r\n\t# and not before the end: $\r\n\treturn preg_split('/(?<!^)(?!$)/u', $string );\r\n}", "function lstring_split($string, $split_by)\n\t{\n\t\treturn split($split_by, $string);\n\t}", "private function splitOnRegex($pattern, $subject, $matchCallback, $notMatchedCallback = null) {\n $parts = [];\n\n preg_match_all($pattern, $subject, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $start = mb_strpos($subject, $match[0]);\n if ($start > 0) {\n $before = mb_substr($subject, 0, $start);\n if ($notMatchedCallback) {\n $parts = array_merge($parts, $notMatchedCallback($before));\n } else {\n $parts[] = $before;\n }\n $subject = mb_substr($subject, $start);\n }\n $parts[] = $matchCallback($match);\n $subject = mb_substr($subject, mb_strlen($match[0]));\n }\n if ($notMatchedCallback) {\n $parts = array_merge($parts, $notMatchedCallback($subject));\n } else {\n $parts[] = $subject;\n }\n\n return $parts;\n }", "function explodePhrases( $str, $operators=NULL ) {\r\n\t$regex = \"/[\\s]*([$operators]?\\\"[^\\\"]*\\\")[\\s]*/\";\r\n\t$quotesplit = preg_split($regex, $str, NULL, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\r\n\t$phraselist = array();\r\n\tforeach ($quotesplit as $value) {\r\n\t\tif ( preg_match($regex, $value) ) {\r\n\t\t\t$phraselist[] = $value;\r\n\t\t} else {\r\n\t\t\t$phraselist = array_merge($phraselist, preg_split(\"/\\s+/\", $value, NULL, PREG_SPLIT_NO_EMPTY));\r\n\t\t}\r\n\t}\r\n\treturn $phraselist;\r\n}", "public static function splitOnCommonBoundaries(string $str = \"\"):array {\r\n //splits on a space, comma, backslash, forward slash, and dash\r\n $result = preg_split(\"/[&\\s,\\/-]+/\", $str);\r\n return ($result === false) ? [] : $result;\r\n }", "abstract public function splitText(string $text): array;", "function splitString($strings){\r\n \r\n $splitString = str_split($strings);\r\n \r\n return $splitString;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }