query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Set mssg value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object
public function setMssg($mssg = null) { // validation for constraint: string if (!is_null($mssg) && !is_string($mssg)) { throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mssg, true), gettype($mssg)), __LINE__); } if (is_null($mssg) || (is_array($mssg) && empty($mssg))) { unset($this->mssg); } else { $this->mssg = $mssg; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __set($name, $value) { \n $this->setAzureProperty($name, $value, null);\n }", "public function unset(): void\n\t{\n\t\t$this->_value = $this->_allowNull ? null : self::setType('', gettype($this->_value));\n\t}", "public function setMinistryAttribute($value)\n {\n $this->attributes['ministry'] = $value ? $value : null;\n }", "public function set($value = null);", "public function setValue($value)\n {\n $value = arr::get($value, 'value', NULL);\n\n if ($value !== NULL)\n {\n //pokud prisla prazdna hodnota, tak do modelu ukladam NULL\n if (empty($value))\n {\n $value = NULL;\n }\n\n parent::setValue($value);\n }\n }", "public function getMssg()\n {\n return isset($this->mssg) ? $this->mssg : null;\n }", "public function setMessServer ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->mess_server !== $v || $v === '' )\n {\n $this->mess_server = $v;\n }\n }", "public function setScmsRestriction($value)\n {\n $this->_scmsRestriction = $value;\n }", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function set($value = null)\r\n {\r\n return parent::set((float)$value);\r\n }", "public function setValue($value){\n $this->_value = $value;\n }", "public function __set( $name, $value )\n {\n\t\t\tif( property_exists( \"UserSVC\", $name ) )\n\t\t\t\t$this->$name = $value;\n }", "public function unsetSmsNumber()\n {\n $this->init();\n if ($this->data->contact_info->phone) {\n foreach ($this->data->contact_info->phone as $phone) {\n if ($phone->preferred_sms) {\n $phone->preferred_sms = false;\n }\n }\n }\n }", "public function set($mName, $sValue = null): void\n {\n if (is_array($mName)) {\n foreach ($mName as $sName => $sVal) {\n $this->set($sName, $sVal);\n }\n } else {\n $_SESSION[Config::getInstance()->values['session']['prefix'] . $mName] = $sValue;\n }\n }", "protected function setMesto_id($value)\n\t{\n\t\tif (isInt($value) || is_null($value)) { $this->mesto_id = $value; }\n\t}", "function setRemoved( $value )\n {\n $this->Removed = $value;\n }", "public function setValue($value)\n {\n $this->_value = new Zend_Memory_Value($value, $this);\n }", "public function set($sName, $mValue, $iLifetime = null);", "public function unsetStringValue(): void\n {\n $this->stringValue = [];\n }", "public function __set ($psProperty, $pmValue)\n\t{\n\t\t$this->set($psProperty, $pmValue);\n\t}", "public function set( $name, $value = NULL );", "public function __set($_name,$_value) {\n\t\tif (array_key_exists($_name,$this->fields)) {\n\t\t\t$this->fields[$_name]=is_string($_value)?\n\t\t\t\tF3::resolve($_value):$_value;\n\t\t\tif (!is_null($_value))\n\t\t\t\t// Axon is now hydrated\n\t\t\t\t$this->empty=FALSE;\n\t\t\treturn;\n\t\t}\n\t\tif (array_key_exists($_name,$this->virtual)) {\n\t\t\ttrigger_error(self::TEXT_AxonReadOnly);\n\t\t\treturn;\n\t\t}\n\t\tF3::$global['CONTEXT']=$_name;\n\t\ttrigger_error(self::TEXT_AxonNotMapped);\n\t}", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "public function __set($name, $value) {\r\n if (is_scalar($value)) {\r\n // store the property's value\r\n $this->properties[$name] = $value;\r\n }\r\n }", "public function setMdeDeviceId(?string $value): void {\n $this->getBackingStore()->set('mdeDeviceId', $value);\n }", "public function setTypeValue()\n {\n if($this->getType() === null){\n $this->setType(self::TYPE_SIMPLE);\n }\n }", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "public function setMixed(bool $value): void\n {\n $this->mixedAttr = $value;\n }", "public function setMixed(bool $value): void\n {\n $this->mixedAttr = $value;\n }", "public function __set($name, $value)\n {\n if (in_array($name, $this->properties)) {\n $this->data[$name] = $value;\n $this->syncSessionProperty($name, $value);\n }\n }", "function setValue($m)\n\t{\n\t\t$this->value = $m;\n\t\treturn $this;\n\t}", "public function unset()\n {\n unset($this->value);\n }", "function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }", "public function setMessPort ($v)\n {\n // Since the native PHP type for this column is integer,\n // we will cast the input value to an int (if it is not).\n if ( $v !== null && !is_int ($v) && is_numeric ($v) )\n {\n $v = (int) $v;\n }\n if ( $this->mess_port !== $v || $v === 0 )\n {\n $this->mess_port = $v;\n }\n }", "public function setMessUid ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->mess_uid !== $v || $v === '' )\n {\n $this->mess_uid = $v;\n }\n }", "private function setSingularConstraint($value)\n {\n if ($this->isPermitted(self::MODE_SINGULAR)) {\n $this->constraints = $value;\n } else {\n throw new \\RuntimeException(\"You cannot use a a property in both compound and singular modes\");\n }\n }", "public function setValue($v){\n $this->value = $v;\n }", "private function setCustomerGroupValue()\n {\n $value = $this->getData(self::$groupAttributeCode);\n try {\n $group = $this->groupRepository->getById($value);\n $this->setCustomAttribute(self::$groupAttributeCode, $group->getCode());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$groupAttributeCode, 'N/A');\n }\n }", "public function testSeteWsMdp() {\n\n $obj = new Collaborateurs();\n\n $obj->seteWsMdp(\"eWsMdp\");\n $this->assertEquals(\"eWsMdp\", $obj->geteWsMdp());\n }", "public function set(string $name, mixed $value): void;", "public function SetValue($value)\n\t{\n\t\t$this->value = $value;\n\t}", "public function setMessTrySendInmediatly ($v)\n {\n // Since the native PHP type for this column is integer,\n // we will cast the input value to an int (if it is not).\n if ( $v !== null && !is_int ($v) && is_numeric ($v) )\n {\n $v = (int) $v;\n }\n if ( $this->mess_try_send_inmediatly !== $v || $v === 0 )\n {\n $this->mess_try_send_inmediatly = $v;\n }\n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {\n $this->value = $value->value;\n }", "public function __set($sName, $xValue)\n {\n }", "function setValue($value) {\n $this->value = $value;\n }", "public function __set($sProperty, $mValue)\n {\n $this->oDb->{$sProperty} = $mValue;\n }", "function __set($name, $value)\n\t{\n\t\t$this->checkValid();\n\t\tif(isset($this->data->{$name})) {\n\t\t\t$this->data->{$name} = DataType::assign($name, $this->data->{$name}, $value);\t\n\t\t} else {\n\t\t\tthrow new \\RuntimeException($name.\" is not the property of struct:\".get_called_class());\n\t\t}\n\t}", "public function __set(string $name, $value)\n {\n if (empty($this->newProperties)) {\n $this->fillProperties();\n }\n\n if ($this->isAllowed($name)) {\n $this->newProperties[$name] = $value;\n } else {\n return null;\n }\n\n if ($name == 'id') {\n $this->newProperties['id'] = $this->currentProperties['id'] ?? null;\n }\n }", "function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}", "public function setSenderShiftId(?string $value): void {\n $this->getBackingStore()->set('senderShiftId', $value);\n }", "public function set($name, $value = '')\n {\n }", "final function set($value){\n if(is_object($value) and get_class($value)===get_class($this)){\n $this->value = $value->get();\n $this->isset = TRUE;\n return $this->_ok();\n }\n\n // use accept for type-check\n $this->isset = FALSE;\n $typ = $this->get_type($value,FALSE,FALSE);\n if($this->accept($value,$typ)!==TRUE) \n return $this->_err(array(3,strval($value)),FALSE);\n\n // get method responisble for this type\n $mth = 'set_' . (method_exists($this,'set_' . $typ)?$typ:'default');\n $res = $this->$mth($value);\n $this->isset = $this->isok();\n return $res;\n }", "public function setVal($val){\n\t\t\t$this->_val = $val;\n\t\t}", "public function __set($name, $value)\n\t{\n\t\t$method = 'set' . $name;\n\t\tif (!method_exists($this, $method)) \n\t{\n\t\tthrow new \\Exception('Class Entity: Trmsus Invalid specified property: set'.$name);\n\t}\n\t$this->$method($value);\n\t}", "public function __set($name, $value)\n\t{\n\t\tswitch($name) {\n\t\t\tcase 'APPLICANTS_FAMILY_DATA_SIBLINGS_ID':\n\t\t\t\t//if the id isn't null, you shouldn't update it!\n\t\t\t\tif( !is_null($this->APPLICANTS_FAMILY_DATA_SIBLINGS_ID) ) {\n\t\t\t\t\tthrow new Exception('Cannot update APPLICANTS_FAMILY_DATA_SIBLINGS_ID!');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\t//set the attribute with the value\n\t\t$this->$name = $value;\n\t}", "public function setMessDefault ($v)\n {\n // Since the native PHP type for this column is integer,\n // we will cast the input value to an int (if it is not).\n if ( $v !== null && !is_int ($v) && is_numeric ($v) )\n {\n $v = (int) $v;\n }\n if ( $this->mess_default !== $v || $v === 0 )\n {\n $this->mess_default = $v;\n }\n }", "public function setMessFromName ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->mess_from_name !== $v || $v === '' )\n {\n $this->mess_from_name = $v;\n }\n }", "public function setMensagem($value,$options=array('required'=>true)){ \n $this->_data['mensagem'] = new ZendT_Type_String($value,array('mask'=>''\n ,'charMask'=>''\n ,'filterDb'=>array (\n 0 => '',\n)\n ,'filter'=>array('trim', )));\n if ($options['db'])\n $this->_data['mensagem']->setValueFromDb($value);\n \n if (!$options['db']){\n \n if ($options['required'])\n $this->isRequired($value,'mensagem');\n \n $valid = new Zend_Validate_StringLength(array ( 'max' => 1000, ) );\n $valueValid = $this->_data['mensagem']->getValueToDb();\n if ($valueValid && !$valid->isValid($valueValid)){\n throw new ZendT_Exception_Business(implode(\"\\n\",$valid->getMessages()));\n }\n \n }\n return $this;\n }", "public function __set($name,$value)\r\n {\r\n $this->set($name,$value);\r\n }", "public function set_value( $value ) {\n $this->value = $value;\n }", "public function resetShopifyProperty($propertyName, $value) {\n if (is_null($value)) {\n $this->unsetShopifyProperty($propertyName);\n } else if ($this->existsShopifyProperty($propertyName)) {\n $this->setShopifyProperty($propertyName, $value);\n }\n }", "public function __set($name, $value)\n {\n $this->m_ddl->$name = $value;\n }", "public function __set($_name, $_value);", "public function __set( $name, $value ) {\n $this->_checkValid();\n $this->_magicError( debug_backtrace(), 'Attempt to set read-only property: ' . $name );\n return null;\n }", "public function setSize($value) {\r\n $this->iSize = $this->setIntegerProperty($this->iSize, $value);\r\n }", "public function __set($name, $value)\n {\n throw new DirectPropertySetException($name, $value, $this);\n }", "public function __set($name, $value) {\n if (ctype_alnum($name) && (ctype_digit($name[0]) == FALSE)) {\n $this->$name = $this->db->quote($value);\n $this->properties[$name] = $value;\n }\n }", "function set($name = '', $value = \\null)\n {\n }", "public function setDeclaredValueAttribute($value)\n {\n $this->attributes['declared_value'] = Utils::numbersOnly($value);\n }", "function __set($name, $value) {\r\n if ($name == 'mr') {\r\n $this->max_rating = intval($value);\r\n } else if ($name == 'st') {\r\n $this->step = intval($value);\r\n } else if ($name == 'vis') {\r\n $this->visible = $value == '1';\r\n } else if ($name == 'seq') {\r\n $this->sequence = intval($value);\r\n } else if ($name == 'cr') {\r\n $this->created = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'upd') {\r\n $this->updated = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'num') {\r\n $this->num_ratings = intval($value);\r\n } else if ($name == 'total') {\r\n $this->tot_ratings = floatval($value);\r\n }\r\n\r\n }", "public function setBillingSubscriptionDiscountsAttribute($value)\n {\n $this->attributes['billing_subscription_discounts'] = empty($value) ? null : json_encode($value);\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function __set($name, $value)\n {\n if ($name == 'values' && $value !== null) {\n return $this->set_value($value);\n }\n return parent::__set($name, $value);\n }", "public function __set($name, $value){\r\n echo \"You are trying to direct set property \".$name.\" to value \".$value.\" and thats not possible use set\".$name.\"(\\$value) method.\";\r\n echo \"<br/> At line \".__LINE__.\" in file \".__FILE__;\r\n }", "public function setClassification(?WindowsQualityUpdateClassification $value): void {\n $this->getBackingStore()->set('classification', $value);\n }", "public function __set($name, $value)\n\t{\n\t\tif ($field = $this->_meta->field($name))\n\t\t{\n\t\t\t$this->set(array($name => $value));\n\t\t}\n\t}", "protected function _setStringValue($name, $value, $encoding) {}", "public function unsetProperty()\n\t{\n\t\t$this -> tableName = '';\n\t\t$this -> databaseName = '';\n\t\t$this -> arrNewData = array();\n\t\t$this -> arrOldData = array();\n\t}" ]
[ "0.5515903", "0.5477287", "0.53691727", "0.5331852", "0.5268125", "0.5203547", "0.5137498", "0.5083558", "0.48934042", "0.4865043", "0.486061", "0.48243806", "0.48203662", "0.4818728", "0.48186877", "0.4813408", "0.47685966", "0.47604775", "0.4759557", "0.47482854", "0.47407284", "0.47385347", "0.47360927", "0.47285587", "0.47284502", "0.47013074", "0.46856567", "0.4685068", "0.4685068", "0.46830416", "0.4680651", "0.4678032", "0.4676367", "0.46699443", "0.46692654", "0.46558037", "0.4644979", "0.46419492", "0.46366626", "0.46336666", "0.46327066", "0.46282512", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46184298", "0.46181557", "0.46181557", "0.46170935", "0.46123603", "0.4601396", "0.45977318", "0.45931852", "0.4593006", "0.45898855", "0.45888734", "0.45844615", "0.4584277", "0.45822904", "0.45758143", "0.45715505", "0.45631367", "0.45605183", "0.45567167", "0.45519298", "0.45461702", "0.4543478", "0.45352778", "0.45325845", "0.45324135", "0.45229736", "0.45219684", "0.4513281", "0.45103467", "0.45098233", "0.4504182", "0.45033455", "0.44972956", "0.44972956", "0.44972956", "0.44972956", "0.44972956", "0.44972956", "0.44972956", "0.44972956", "0.44972956", "0.44972956", "0.44965655", "0.44961125", "0.44935057", "0.44918972", "0.44880563", "0.44865566" ]
0.65202385
0
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { $declarations = DB::table('scn_admission_app_form_declartion') ->join('scn_program', 'scn_program.PROGRAM_ID', 'scn_admission_app_form_declartion.PROGRAM_ID') ->join('scn_session', 'scn_session.SESSION_ID', 'scn_admission_app_form_declartion.SESSION_ID') ->select('scn_admission_app_form_declartion.*','scn_program.PROGRAM_NAME','scn_session.SESSION_NAME') ->where('scn_admission_app_form_declartion.DECLARATION_TITLE', 'LIKE', '%'.$request->get('declartion_title').'%') ->where('scn_program.PROGRAM_NAME', 'LIKE', '%'.$request->get('program_name').'%') ->orderBy('ADMISSION_APP_FORM_DECLARATION_ID', 'DESC') ->paginate(10); // return view('admin.declaration.declaration_list')->with('declarations', $declarations); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "function listing() {\r\n\r\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446838", "0.7361646", "0.7299749", "0.7246801", "0.7163394", "0.7148201", "0.71318537", "0.7104601", "0.7101873", "0.709985", "0.70487136", "0.69936216", "0.6988242", "0.69347453", "0.68989795", "0.68988764", "0.68909055", "0.68874204", "0.68650436", "0.6848891", "0.6829478", "0.6801521", "0.67970383", "0.6794992", "0.678622", "0.67595136", "0.67416173", "0.6730242", "0.67248064", "0.6724347", "0.6724347", "0.6724347", "0.6717754", "0.67069757", "0.67046493", "0.67045283", "0.66652155", "0.6662764", "0.6659929", "0.6659647", "0.665744", "0.6653796", "0.66483474", "0.6620148", "0.6619058", "0.66164845", "0.6606442", "0.66005665", "0.65998816", "0.6593891", "0.6587057", "0.6584887", "0.65822107", "0.65806025", "0.6576035", "0.65731865", "0.6571651", "0.65702003", "0.6569641", "0.6564336", "0.65618914", "0.65526754", "0.6552204", "0.6545456", "0.653638", "0.65332466", "0.65329266", "0.65268785", "0.6525191", "0.652505", "0.65196913", "0.6517856", "0.6517691", "0.65152586", "0.6515112", "0.6507232", "0.65038383", "0.65013176", "0.64949673", "0.6491598", "0.6486873", "0.64857864", "0.6484881", "0.6483896", "0.64777964", "0.6476692", "0.64711976", "0.6469358", "0.64685416", "0.64659655", "0.6462483", "0.6461606", "0.6459046", "0.6457556", "0.6454214", "0.6453915", "0.64524966", "0.64499927", "0.6448528", "0.6447461", "0.6445687" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // $programs = DB::table('scn_program') ->select('scn_program.*') ->where('ACTIVE_STATUS', '1') ->get(); // $sessions = DB::table('scn_session') ->select('scn_session.*') ->where('ACTIVE_STATUS', '1') ->get(); // return view('admin.declaration.declaration_create')->with('programs', $programs)->with('sessions', $sessions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.7594873", "0.7594873", "0.75862724", "0.7577369", "0.75727355", "0.7500874", "0.74348205", "0.74339336", "0.7389178", "0.73531044", "0.73364365", "0.73124814", "0.7296061", "0.72818893", "0.7274119", "0.72423935", "0.72292763", "0.72266877", "0.7187332", "0.717915", "0.7174258", "0.7150343", "0.7144378", "0.7144238", "0.7134942", "0.7128289", "0.71236694", "0.7115823", "0.7115823", "0.7115823", "0.7112145", "0.70943975", "0.70857024", "0.70802104", "0.70800203", "0.7057187", "0.7057187", "0.7055648", "0.7039616", "0.7039533", "0.7036246", "0.70346695", "0.70305556", "0.7027626", "0.7026509", "0.70199776", "0.7017972", "0.70049554", "0.7003876", "0.7000925", "0.69973546", "0.6994639", "0.69937307", "0.69898754", "0.6986977", "0.69664884", "0.6965616", "0.69563985", "0.6951776", "0.69510984", "0.69472855", "0.69444585", "0.6942343", "0.69411284", "0.69378203", "0.69378203", "0.6936664", "0.69344825", "0.69317704", "0.69282645", "0.69263744", "0.6924216", "0.6918314", "0.6915855", "0.69128567", "0.6911424", "0.6910289", "0.69085616", "0.6903973", "0.6901382", "0.6901172", "0.6900354", "0.6895054", "0.6893486", "0.6893189", "0.68918854", "0.6891604", "0.6891604", "0.6889186", "0.6888053", "0.6887076", "0.6884677", "0.68822217", "0.6880916", "0.6875967", "0.68739045", "0.6873874", "0.6870332", "0.6869766", "0.68696475", "0.6868746" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // $request->validate([ 'program_name' => 'required', 'session_name' => 'required', 'declaration_title' => 'required', 'content' => 'required', ]); // Primary Key Generator $primary_key = DB::table('scn_admission_app_form_declartion') ->select('scn_admission_app_form_declartion.ADMISSION_APP_FORM_DECLARATION_ID') ->max('ADMISSION_APP_FORM_DECLARATION_ID'); if (isset($primary_key)) { $declartion_id = $primary_key + '1'; } else { $declartion_id = '20190001'; } $insert = DB::table('scn_admission_app_form_declartion') ->insert([ 'ADMISSION_APP_FORM_DECLARATION_ID' => $declartion_id, 'PROGRAM_ID' => $request->get('program_name'), 'SESSION_ID' => $request->get('session_name'), 'DECLARATION_TITLE' => $request->get('declaration_title'), 'DECLARATION' => $request->get('content'), 'ACTIVE_STATUS' => '1', 'ENTERED_BY' => Auth::user()->id, 'ENTRY_TIMESTAMP' => Carbon::now() ]); Session::flash('success', 'Declaration Created Successfully!'); // return redirect()->route('declaration.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // $declarations = DB::table('scn_admission_app_form_declartion') ->join('scn_program', 'scn_program.PROGRAM_ID', 'scn_admission_app_form_declartion.PROGRAM_ID') ->join('scn_session', 'scn_session.SESSION_ID', 'scn_admission_app_form_declartion.SESSION_ID') ->select('scn_admission_app_form_declartion.*','scn_program.PROGRAM_NAME','scn_session.SESSION_NAME') ->where('scn_admission_app_form_declartion.ADMISSION_APP_FORM_DECLARATION_ID', $id) ->get(); // return view('admin.declaration.declaration_view')->with('declarations', $declarations); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // $declarations = DB::table('scn_admission_app_form_declartion') ->select('scn_admission_app_form_declartion.*') ->where('ADMISSION_APP_FORM_DECLARATION_ID', $id) ->get(); // $programs = DB::table('scn_program') ->select('scn_program.*') ->where('ACTIVE_STATUS', '1') ->get(); // $sessions = DB::table('scn_session') ->select('scn_session.*') ->where('ACTIVE_STATUS', '1') ->get(); // return view('admin.declaration.declaration_edit') ->with('declarations', $declarations) ->with('programs', $programs) ->with('sessions', $sessions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78561044", "0.7695814", "0.72755414", "0.72429216", "0.71737534", "0.7064628", "0.7056257", "0.69859976", "0.6949863", "0.6948435", "0.6942811", "0.69298875", "0.69032556", "0.6900465", "0.6900465", "0.6880163", "0.6865618", "0.68620205", "0.6859499", "0.6847944", "0.6837563", "0.6812879", "0.68089813", "0.6808603", "0.68049484", "0.67966837", "0.6795056", "0.6795056", "0.67909557", "0.6787095", "0.67825735", "0.67783386", "0.6771208", "0.67658216", "0.67488056", "0.67488056", "0.67481846", "0.67474896", "0.67430425", "0.6737776", "0.67283165", "0.6715326", "0.66959506", "0.66939133", "0.6690822", "0.6690126", "0.66885006", "0.6687302", "0.6685716", "0.6672116", "0.6671334", "0.6667436", "0.6667436", "0.6664605", "0.6663487", "0.6662144", "0.6659632", "0.6658028", "0.66556853", "0.6645572", "0.66350394", "0.66338056", "0.6630717", "0.6630717", "0.66214246", "0.66212183", "0.661855", "0.6617633", "0.6612846", "0.66112465", "0.66079855", "0.65980226", "0.6597105", "0.6596064", "0.6593222", "0.65920717", "0.6589676", "0.6582856", "0.65828097", "0.6582112", "0.6578338", "0.65776545", "0.65774703", "0.6572131", "0.65708333", "0.65703875", "0.6569249", "0.6564464", "0.6564464", "0.65628386", "0.6560576", "0.6559898", "0.65583706", "0.6558308", "0.6557277", "0.65571105", "0.6557092", "0.6556115", "0.655001", "0.6549598", "0.6547666" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // $request->validate([ 'program_name' => 'required', 'session_name' => 'required', 'declaration_title' => 'required', 'content' => 'required', ]); $update = DB::table('scn_admission_app_form_declartion') ->where('ADMISSION_APP_FORM_DECLARATION_ID', $id) ->update([ 'PROGRAM_ID' => $request->get('program_name'), 'SESSION_ID' => $request->get('session_name'), 'DECLARATION_TITLE' => $request->get('declaration_title'), 'DECLARATION' => $request->get('content'), 'UPDATED_BY' => Auth::user()->id, 'UPDATE_TIMESTAMP' => Carbon::now() ]); Session::flash('success', 'Declaration Updated Successfully!'); // return redirect()->route('declaration.edit', [$id]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", "0.58618903", "0.5855116", "0.5855116", "0.58517504", "0.5816175", "0.5807103", "0.5753658", "0.5753658", "0.57354003", "0.5724066", "0.5714874", "0.56957984", "0.5692136", "0.5688278", "0.5670771", "0.5656715", "0.5651525", "0.5647887", "0.563695", "0.5635239", "0.5633743", "0.5633203", "0.56296664", "0.5622203", "0.56089646", "0.5602395", "0.55937296", "0.55837464", "0.5582684", "0.55814886", "0.5575469", "0.5572433", "0.55668694", "0.556366", "0.5562336", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.5560869", "0.55574787", "0.55562645", "0.5554329", "0.5553793", "0.5553788", "0.55448633", "0.55448294", "0.5541889", "0.55402213", "0.5537772", "0.55359083", "0.55358595", "0.55248064", "0.5520229", "0.5517453", "0.5513332", "0.5511126", "0.55085385", "0.5508433", "0.5503835", "0.5502763", "0.5501662", "0.5500294", "0.5498694", "0.5496697", "0.5496697", "0.5495247", "0.5494445", "0.5494331", "0.549349", "0.5492967", "0.5484066", "0.5480196", "0.5479421", "0.54788667", "0.546669", "0.5464114", "0.54621613", "0.5458347" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Display a listing of the resource.
public function index() { $categories = Category::collect(); return $this->response->paginator($categories, new Transformer()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Display the specified resource.
public function show(Category $category) { return $this->response->item($category, new Transformer()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $category = Category::create($request->all()); return $this->response->created(url('api/categories/'.$category->id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72857565", "0.714571", "0.71328056", "0.66390204", "0.6620437", "0.6567189", "0.6526738", "0.65074694", "0.64491314", "0.63734114", "0.6370837", "0.63628685", "0.63628685", "0.63628685", "0.6342026", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964" ]
0.0
-1
Update the specified resource in storage.
public function update(Category $category, Request $request) { $category->update($request->all()); return $this->response->item($category->fresh(), new Transformer()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Category $category) { $category->delete(); return $this->response->noContent(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Some code from the wild
public function testFileSizeFormatter() { $formatter = function ($bytes, $precision = 2) { $units = array('B', 'KB', 'MB', 'GB', 'TB'); $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); // Uncomment one of the following alternatives // $bytes /= pow(1024, $pow); // $bytes /= (1 << (10 * $pow)); return round($bytes, $precision) . ' ' . $units[$pow]; }; $valueSet = [[0], [1000], [500050], [323241234], [5000000]]; $this->assertRecompilesCorrectly($formatter, $valueSet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "private function __() {\n }", "public function helper()\n\t{\n\t\n\t}", "private function __construct()\t{}", "protected function __init__() { }", "final private function __construct() {}", "final private function __construct() {}", "protected function fixSelf() {}", "protected function fixSelf() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "abstract protected function _preProcess();", "private final function __construct() {}", "final private function __construct(){\r\r\n\t}", "protected function _getNextCode() {}", "private function __construct () {}", "protected function _refine() {\n\n\t}", "private function __construct() {}", "private function __construct( )\n {\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function j() {\n }", "protected final function __construct() {}", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function extract()\n {\n }", "function yy_r72(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "abstract protected function external();", "function fix() ;", "function yy_r68(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "function yy_r74(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.'::$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "private function __construct() {\r\n\t\r\n\t}", "function __construct() ;", "private function __construct()\r\n {}", "final private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function init()\n\t{\n\t\treturn;\n\t}", "protected function init()\n\t{\n\t\t\n\t}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}" ]
[ "0.59387374", "0.56076014", "0.554445", "0.5491001", "0.5482247", "0.54737955", "0.54737955", "0.53951246", "0.53951246", "0.53697556", "0.53697556", "0.53697556", "0.5361708", "0.5357866", "0.534", "0.533172", "0.52745575", "0.5264885", "0.5247856", "0.52468264", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52464324", "0.52441317", "0.52441317", "0.5243614", "0.5237034", "0.52301955", "0.5212946", "0.52039593", "0.51928276", "0.5180607", "0.517441", "0.5148118", "0.5142998", "0.51322657", "0.5131826", "0.51275617", "0.51234454", "0.5123427", "0.51221395", "0.51120025", "0.51094216", "0.5103442", "0.5103442", "0.5103442", "0.5103442", "0.5103442" ]
0.0
-1
Create a new notification instance.
public function __construct($comment, $subscription) { $this->comment = $comment; $this->subscription = $subscription; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function create($notification){\n }", "public static function createNotification($type, $eventid){\n\t\t$notification = new Notification; \n\t\t$notification->type = $type;\n\t\t$notification->eventid = $eventid;\n\t\t$notification->time = date('Y-m-d H:i:s');\n\t\t$notification->save();\n\t\treturn $notification;\n\t}", "public function create($payload)\n {\n return $this->notification->create($payload);\n }", "public static function create( array $info ) {\n\t\t$obj = new Notification();\n\t\tstatic $validFields = [ 'event', 'user' ];\n\n\t\tforeach ( $validFields as $field ) {\n\t\t\tif ( isset( $info[$field] ) ) {\n\t\t\t\t$obj->$field = $info[$field];\n\t\t\t} else {\n\t\t\t\tthrow new InvalidArgumentException( \"Field $field is required\" );\n\t\t\t}\n\t\t}\n\n\t\tif ( !$obj->user instanceof User ) {\n\t\t\tthrow new InvalidArgumentException( 'Invalid user parameter, expected: User object' );\n\t\t}\n\n\t\tif ( !$obj->event instanceof Event ) {\n\t\t\tthrow new InvalidArgumentException( 'Invalid event parameter, expected: Event object' );\n\t\t}\n\n\t\t// Notification timestamp should be the same as event timestamp\n\t\t$obj->timestamp = $obj->event->getTimestamp();\n\t\t// Safe fallback\n\t\tif ( !$obj->timestamp ) {\n\t\t\t$obj->timestamp = wfTimestampNow();\n\t\t}\n\n\t\t// @Todo - Database insert logic should not be inside the model\n\t\t$obj->insert();\n\n\t\treturn $obj;\n\t}", "private function createNotification($id, $request)\n {\n $count = Notification::max('count');\n\n $notification = Notification::create([\n 'model_id' => $id,\n 'count' => intval($count) + 1,\n 'type' => $request->get('ntype'),\n 'subject' => $request->get('subject'),\n 'message' => $request->get('message'),\n 'sent_at' => Carbon::now(),\n ]);\n }", "public function maybe_create_notification() {\n\t\tif ( ! $this->should_show_notification() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) {\n\t\t\t$notification = $this->notification();\n\t\t\t$this->notification_helper->restore_notification( $notification );\n\t\t\t$this->notification_center->add_notification( $notification );\n\t\t}\n\t}", "public function __construct(Notification $notification)\n {\n $this->notification = $notification;\n }", "public function __construct(Notification $notification)\n {\n $this->notification = $notification;\n }", "public function __construct(Notification $notification)\n {\n $this->notification = $notification;\n }", "protected function createNotificationInstance($data)\n {\n if ($data === false) {\n return null;\n }\n\n /** @var Notification $model */\n $model = Instance::ensure($this->dataClass, Notification::class);\n\n if (!empty($data['id'])) {\n $model->setId($data['id']);\n }\n\n $model->setType($data['type']);\n $model->setData(is_string($data['data']) ? Json::decode($data['data']) : $data['data']);\n $model->setUserId($data['user_id']);\n $model->setTimestamp($data['created_at']);\n $model->setRead((bool)$data['is_read']);\n $model->setOwner($this->owner);\n\n return $model;\n }", "public function create()\n\t{\n\t\tlog::info('inside create method of user-notifications controller');\n\t}", "public function created(Notification $notification)\n {\n $this->sendBroadcast($notification);\n }", "public function newNotification($event)\n {\n return new ExampleNotification($event);\n }", "public function create()\n {\n $this->authorize('create', Notification::class);\n\n return view('rb28dett_notifications::create');\n }", "public function actionCreate()\n {\n $model = new Notification();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->notification_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "private function createMessageObject(string $type, string $message): Notification\n {\n $msg = new Notification();\n\n $msg->setType($type);\n $msg->setMessage($message);\n\n $this->handler->add($msg);\n\n return $msg;\n }", "public function create() {\n return View::make('notifications.create');\n }", "protected function create_notification_email_object()\n\t{\n\t\t$category = $this->category();\n\n\t\t$email = new Charcoal_Email;\n\t\t$email->to = $this->get_notified_email_address();\n\t\t$email->reply_to = $this->get_lead_email_address();\n\n\t\tif ( $category ) {\n\t\t\t$email->subject = $category->p('confirmation_email_subject')->text();\n\t\t\t$email->from = $category->p('confirmation_email_from')->text();\n\t\t\t$email->cc = $category->v('confirmation_email_cc');\n\t\t\t$email->bcc = $category->v('confirmation_email_bcc');\n\t\t}\n\n\t\treturn $email;\n\t}", "public function create()\n {\n return view ('notifications.create');\n }", "protected function emitNotificationCreated(Notification $notification) {}", "public function __construct($new_postNotification)\n {\n //\n $this->postNotification = $new_postNotification;\n\n }", "public static function createFromArray($fields) \n\t{\n\t\t$notification = new Notification();\n\t\tself::populate($notification,$fields);\n\t\treturn $notification;\n\t}", "public function create()\n {\n return view('admin.notifications.create');\n }", "public function create()\n {\n return view('admin.notifications.create');\n }", "function notify($user_id, $message)\n{\n return (new Notification([\n 'user_id' => $user_id,\n 'message' => $message\n ]))->save();\n}", "public function actionCreate() {\n\t\t$model = new Notification();\n\t\t$model->created_by = Yii::$app->user->identity->id;\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\n\t\t\tif ($model->send_to != '') {\n\t\t\t\t$model->send_to = implode(',', $model['send_to']);\n\t\t\t}\n\t\t\t$model->sent_time = date('Y-m-d H:i:s');\n\t\t\t$model->save();\n\t\t\t/*if ($model->save()) {\n\t\t\t\t$send_to = explode(',', $model['send_to']);\n\t\t\t\tforeach ($send_to as $key => $value) {\n\t\t\t\t\tif ($value == 'all') {\n\t\t\t\t\t\t$userId = 'allUser';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$user = User::find()->where(['id' => $value])->one();\n\t\t\t\t\t\t$userId = $user['phone'];\n\t\t\t\t\t}\n\t\t\t\t\tYii::$app->Utility->pushNotification($userId, $model['notification_name'], $model['content']);\n\t\t\t\t}\n\t\t\t}*/\n\t\t\tYii::$app->getSession()->setFlash('successStatus', 'Data saved successfully!');\n\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t}\n\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function notification(Notification $notification, array $parameters = []);", "public function create()\n {\n return view('notifications.create');\n }", "public function __construct($notification)\n {\n parent::__construct($notification);\n }", "public function notification();", "public function notification();", "public function notificationsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $notification = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if ($notification['from'] instanceof Users) {\n $this->di->setShared('userData', $notification['from']);\n }\n\n if (!$notification['to'] instanceof Users) {\n echo 'Attribute TO has to be a User' . PHP_EOL;\n return;\n }\n\n if (!class_exists($notification['notification'])) {\n echo 'Attribute notification has to be a Notificatoin' . PHP_EOL;\n return;\n }\n $notificationClass = $notification['notification'];\n\n if (!$notification['entity'] instanceof Model) {\n echo 'Attribute entity has to be a Model' . PHP_EOL;\n return;\n }\n\n $user = $notification['to'];\n\n //instance notification and pass the entity\n $notification = new $notification['notification']($notification['entity']);\n //disable the queue so we process it now\n $notification->disableQueue();\n\n //run notify for the specifiy user\n $user->notify($notification);\n\n $this->log->info(\n \"Notification ({$notificationClass}) sent to {$user->email} - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::NOTIFICATIONS, $callback);\n }", "public function create()\n {\n return view('Admin.Notification_Management.notifications');\n }", "public static function fake()\n {\n static::swap($fake = new NotificationFake);\n\n return $fake;\n }", "public function new_notification_is_created ($notification) {\n $user = $this->get_session_user();\n $eventdata = new \\core\\message\\message();\n $eventdata->courseid = 1;\n $eventdata->name = 'fake_notification';\n $eventdata->component = 'block_culactivity_stream';\n $eventdata->userfrom = $user;\n $eventdata->subject = $notification;\n $eventdata->fullmessage = $notification;\n $eventdata->fullmessageformat = FORMAT_PLAIN;\n $eventdata->fullmessagehtml = $notification;\n $eventdata->smallmessage = $notification;\n $eventdata->notification = 1;\n $eventdata->userto = $user;\n $messageid = message_send($eventdata);\n\n if (!$messageid) {\n throw new Exception(get_string('messageerror', 'block_culactivity_stream'));\n }\n }", "public function push($notification, $notifiable);", "public function __construct() {\r\n $this->setEntity('mst_notification');\r\n }", "public function create($type, $data, $userId)\n {\n $data = [\n 'type' => $type,\n 'data' => Json::encode($data),\n 'user_id' => $userId,\n 'created_at' => time(),\n 'is_read' => 0\n ];\n\n $notification = $this->createNotificationInstance($data);\n $this->saveNotification($notification);\n return $notification;\n }", "public function Create()\n {\n parent::Create();\n\n //Properties\n $this->RegisterPropertyInteger('InputTriggerID', 0);\n $this->RegisterPropertyString('NotificationLevels', '[]');\n $this->RegisterPropertyBoolean('TriggerOnChangeOnly', false);\n $this->RegisterPropertyBoolean('AdvancedResponse', false);\n $this->RegisterPropertyString('AdvancedResponseActions', '[]');\n\n //Profiles\n if (!IPS_VariableProfileExists('BN.Actions')) {\n IPS_CreateVariableProfile('BN.Actions', 1);\n IPS_SetVariableProfileIcon('BN.Actions', 'Information');\n IPS_SetVariableProfileValues('BN.Actions', 0, 0, 0);\n }\n\n //Variables\n $this->RegisterVariableInteger('NotificationLevel', $this->Translate('Notification Level'), '');\n $this->RegisterVariableBoolean('Active', $this->Translate('Notifications active'), '~Switch');\n $this->RegisterVariableInteger('ResponseAction', $this->Translate('Response Action'), 'BN.Actions');\n\n //Actions\n $this->EnableAction('ResponseAction');\n\n //Timer\n $this->RegisterTimer('IncreaseTimer', 0, 'BN_IncreaseLevel($_IPS[\\'TARGET\\']);');\n\n $this->EnableAction('Active');\n }", "public function register_notifications();", "public function create()\n {\n $notification = DB::table('notifications')\n ->get(); \n return view ('admin/assignBadgeToUser')->with('notification', $notification);\n }", "public function __construct(protected NotificationRepository $notificationRepository)\n {\n }", "protected function createNotification($responseData)\n {\n $socketMock = $this->getMock(\n 'RequestStream\\\\Stream\\\\Socket\\\\SocketClient',\n array('create', 'write', 'read', 'selectRead', 'setBlocking', 'is', 'close')\n );\n\n $socketMock->expects($this->once())\n ->method('selectRead')\n ->will($this->returnValue(true));\n\n $socketMock->expects($this->once())\n ->method('read')\n ->with(6)\n ->will($this->returnValue($responseData));\n\n $notification = new Notification;\n $payload = new PayloadFactory;\n $connection = new Connection(__FILE__);\n\n $notification->setConnection($connection);\n $notification->setPayloadFactory($payload);\n\n $ref = new \\ReflectionProperty($connection, 'socketConnection');\n $ref->setAccessible(true);\n $ref->setValue($connection, $socketMock);\n\n return $notification;\n }", "protected function notification() {\n\t\t$reason = $this->indexing_helper->get_reason();\n\n\t\t$presenter = $this->get_presenter( $reason );\n\n\t\treturn new Yoast_Notification(\n\t\t\t$presenter,\n\t\t\t[\n\t\t\t\t'type' => Yoast_Notification::WARNING,\n\t\t\t\t'id' => self::NOTIFICATION_ID,\n\t\t\t\t'capabilities' => 'wpseo_manage_options',\n\t\t\t\t'priority' => 0.8,\n\t\t\t]\n\t\t);\n\t}", "function custom_node_create_notification($uid, $title, $message) {\n $creator_uid = 1; // Admin user.\n $node = custom_new_node_create($creator_uid, 'notification', $title, 1);\n \n $node->set('field_user', $uid);\n $node->set('body', $message);\n $node->save();\n \n if (!$node->id()) {\n \\Drupal::logger('custom')->error(t('Notification FAILED to store.'));\n }\n \n return $node;\n}", "public function store(Request $request)\n {\n return Notification::create($request->input());\n }", "public static function createFromDiscriminatorValue(ParseNode $parseNode): TrainingReminderNotification {\n return new TrainingReminderNotification();\n }", "public function __construct(NotificationTrigger $notification_trigger)\n {\n $this->notification_trigger = $notification_trigger;\n }", "public function setResource($notification)\n {\n return new NotificationResource($notification);\n }", "public function __construct($notification_id)\n {\n $this->notification_id = $notification_id;\n }", "public function create()\n {\n return view('Notifications/create');\n }", "public function getNotification(MessageInstanceInterface $message)\n {\n return new DefaultNotification($message, $this->formatterRegistry->get($message->getType()));\n }", "public function sendPostCreateNewNotifications(ApiTester $I)\n {\n $data = [\n 'entityClass' => 'user',\n 'entityId' => 1,\n 'category' => 'info',\n 'message' => fake::create()->text(20),\n 'userId' => 1\n ];\n $I->saveNotifications([\n $data['entityClass'], ' ',\n $data['entityId'], ' ',\n $data['category'], ' ',\n $data['message'], ' ',\n $data['userId'], ' '\n ], 'notifications.txt');\n $I->sendPOST($this->route, $data);\n $this->userID = $I->grabDataFromResponseByJsonPath('$.id');\n $I->seeResponseCodeIs(201);\n }", "public static function createFromArray($fields) \n\t{\n\t\t$notificationType = new NotificationType();\n\t\tself::populate($notificationType,$fields);\n\t\treturn $notificationType;\n\t}", "public function create()\n\t{\n\t\t$searchTerm = Input::get('searchTerm');\n\n $createNotification = new CreateNotificationCommand($searchTerm);\n\n $result = $createNotification->execute();\n\n $result = $result ? \"You're Signed Up!\" : \"You're Already Signed Up for This Term!\";\n\n return $result;\n\t}", "#[Route('/notification/create', name: 'create_notification')]\n public function create(NotifierInterface $notifier, EntityManagerInterface $entityManager, Request $request): Response\n {\n $notification = (new Notification('Notification from Duck Tales'))\n ->content('You got some contributions to review. Please look at the Quack #' . $request->get('warned_id'))\n ->importance(Notification::IMPORTANCE_HIGH);\n\n\n $admins = [];\n $admins = array_map(fn ($duck) => $duck->hasRoleAdmin() ? $duck->getEmail() : NULL, $entityManager->getRepository(Duck::class)->findAll());\n\n // foreach ($admins as $admin) {\n // $recipient = new Recipient(\n // $admin\n // );\n // $notifier->send($notification, $recipient);\n // }\n $recipient = new Recipient(\n 'badawiraphael@posteo.net'\n );\n $notifier->send($notification, $recipient);\n\n\n // Send the notification to the recipient\n\n\n return $this->redirectToRoute('quacks');\n }", "function wd_notification() {\n return WeDevs_Notification::init();\n}", "public function notificationsOnCreate(NotificationBuilder $builder)\n {\n $notification = new Notification();\n $notification\n ->setTitle('Nouvelle Reclamation')\n ->setDescription(' A été crée')\n ->setRoute('#')\n // ->setParameters(array('id' => $this->userToClaim))\n ;\n //$notification->setIcon($this->getUserr()->getUsername());\n $notification->setUser1($this->getUser()->getUsername());\n $notification->setUser2($this->getUserToClaim());\n $builder->addNotification($notification);\n\n return $builder;\n }", "public function create()\n {\n\n $email_id = date('Y-m-d_H-i-s') . '.' . $this->template;\n $email_data = [\n 'title' => $this->template, \n 'data' => serialize($this->data), \n 'email' => $this->to,\n 'id' => $email_id,\n 'date' => date('Y-m-d H:i:s')\n ];\n\n Storage::putYAML('statamify/emails/' . $email_id, $email_data);\n\n }", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "public function create()\n {}", "public function create() {}", "public function create() {\n\t\t\t//\n\t\t}", "public static function invalidNotificationType()\n {\n return new static('Notification Type provided is invalid.');\n }", "public function createNotification($type, $text, $destination)\r\n {\r\n \t$data = $this->call(array(\"notification\"=>array(\"type\"=>$type, \"text\"=>$text, \"destination\"=>$destination)), \"POST\", \"notifications.json\");\r\n \treturn $data;\r\n }", "public function __construct($title, $sender, $notification)\n {\n $this->title = $title;\n $this->sender = $sender;\n $this->notification = $notification;\n }", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public function create(){}", "static function get_notificationById($id) {\r\n global $db;\r\n \r\n $id = $db->escape_string($id);\r\n \r\n $query = \"SELECT * FROM `notification` WHERE Notification_id = ?\";\r\n \r\n $statement = $db->prepare($query);\r\n\t\t\r\n\t\tif ($statement == FALSE) {\r\n\t\t\tdisplay_db_error($db->error);\r\n\t\t}\r\n \r\n $statement->bind_param(\"i\", $id);\r\n \r\n $statement->execute();\r\n \r\n $statement->bind_result($id, $message, $objectReference, $objectId, $seen, $timeStamp);\r\n \r\n $statement->fetch();\r\n \r\n $notification = new notification($id, $message, $objectReference, $objectId, $seen, $timeStamp);\r\n \r\n $statement->close();\r\n \r\n return $notification;\r\n }", "public function __construct(PushNotification $push)\n {\n $this->push = $push;\n }", "public function addNotification($id, $message, $type = 'status');", "public function create( $arrayNotifikasi )\n {\n // return $arrayNotifikasi;\n $notif = new Notifikasi;\n $notif->id_pembuat = $arrayNotifikasi[0];\n $notif->id_penerima = $arrayNotifikasi[1];\n $notif->jenis = $arrayNotifikasi[2];\n $notif->msg = $arrayNotifikasi[3];\n $notif->icon = $arrayNotifikasi[4];\n $notif->bg = $arrayNotifikasi[5];\n $notif->tgl_dibuat = $arrayNotifikasi[6];\n $notif->link = $arrayNotifikasi [7];\n $notif->save();\n }", "public static function createInstance()\n {\n return new MailMessage('serializable@serializable.com');\n }", "public function testPushNotification(){\n $noti=new Notification();\n $data=' {\n\t \"to\": \"/topics/important\",\n\t \"notification\": {\n\t \t\"title\": \"Hola Mundo\",\n\t\t \"body\": \"Mensaje de prueba\",\n\t\t \"icon\":\"http://www.alabamapublica.com/wp-content/uploads/sites/43/2017/06/cntx170619019-150x150.jpg\"\n\t\t \"click_action\": \"https://critica-xarkamx.c9users.io\"\n\t }\n }';\n $this->assertArrayHasKey(\"message_id\",$noti->sendPushNotification($data));\n }", "public static function notify($member) {\n $notification = Model_Notification::factory('notification');\n\n if(is_numeric($member)) {\n $notification->to = $member;\n } else if(is_object($member) && $member instanceof Model_Member) {\n $notification->to = $member->id;\n } else if(is_object($member) && $member instanceof Model_Blab) {\n\t\t\t$notification->to = $member->getCommentees();\n\t\t}\n\n\t\t$notification->from = Session::instance()->get('user_id');\n \n $notification->unread = 1;\n\n\t\t$notification->created = date('Y-m-d h:i:s');\n\n return $notification;\n }", "public function insert(int $toUserID, string $subject, string $message, int $typeId, array $data = [])\n {\n return Notification::create([\n 'user_id' => $toUserID,\n 'subject' => $subject,\n 'message' => $message,\n 'notification_type_id' => $typeId,\n 'data' => $data,\n ]);\n }", "public function create()\n {\n //TODO\n }", "public function __construct($notifiable)\n {\n $this->notifiable = $notifiable;\n }", "public function create()\n {\n //\n return view('admin/notifacation/create');\n }", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function __construct(AppNotification $notification, User $user)\n {\n $this->notification = $notification;\n $this->user = $user;\n }", "public function create() {\r\n }", "public function __construct($data)\n {\n \n\n $usuario_reserva = User::find($data->id_user);\n $coordinador = User::find($usuario_reserva->departamento->coordinador->id);\n\n $mensaje = new \\stdClass();\n $mensaje->user = $usuario_reserva->name.' '.$usuario_reserva->last_name;\n $mensaje->userid = $usuario_reserva->id;\n $mensaje->recipient = $coordinador->name.' '.$coordinador->last_name;\n $mensaje->recipientid = $coordinador->id;\n $mensaje->reservaid = $data->id;\n $mensaje->datereserva = date('Y-m-d H:i:s');\n $mensaje->text = 'ah generado una reserva';\n $notificacion = new Notificaciontest($mensaje);\n \n $coordinador->notify($notificacion);\n $this->notif = $mensaje;\n }", "public function createDefaultNotificationRule();", "protected function getNotification_Type_PostService()\n {\n $instance = new \\phpbb\\notification\\type\\post(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});\n $instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});\n\n return $instance;\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}" ]
[ "0.8276063", "0.72309536", "0.7192113", "0.71250874", "0.7123231", "0.70414555", "0.6982398", "0.6982398", "0.6982398", "0.69165224", "0.6844303", "0.68205667", "0.6801263", "0.6776018", "0.6589725", "0.6531073", "0.6507233", "0.65047646", "0.6503655", "0.64437956", "0.6413495", "0.63943607", "0.63801765", "0.63801765", "0.63660526", "0.6356052", "0.63232195", "0.6300968", "0.6284887", "0.6273382", "0.6273382", "0.6221624", "0.62077844", "0.619149", "0.61460197", "0.6113097", "0.6109519", "0.61056155", "0.6096373", "0.6080448", "0.6076801", "0.6062714", "0.6056816", "0.60528165", "0.6042198", "0.6041384", "0.6038984", "0.5998163", "0.5980277", "0.5966818", "0.5965131", "0.59510165", "0.5944954", "0.5924184", "0.59172565", "0.5905665", "0.5863749", "0.5857545", "0.5847215", "0.58452827", "0.5823396", "0.5817765", "0.5809837", "0.5806915", "0.58051187", "0.57956886", "0.5786479", "0.5761696", "0.5759299", "0.57588416", "0.57455844", "0.5729732", "0.57241285", "0.5722245", "0.571779", "0.57008874", "0.56909657", "0.5688866", "0.56850773", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.5680636", "0.56795263", "0.567875", "0.5671056", "0.56691873", "0.56688094", "0.5668", "0.5668", "0.5666241", "0.5666241", "0.5666241" ]
0.0
-1
Get the notification's delivery channels.
public function via($notifiable) { if ($notifiable->modified) { return []; } return ['mail']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNotificationChannels()\n {\n if (array_key_exists(\"notificationChannels\", $this->_propDict)) {\n return $this->_propDict[\"notificationChannels\"];\n } else {\n return null;\n }\n }", "public function getDistributionChannels();", "public function getDeliveryChannel() {\n return $this->params[\"original\"][\"delivery_channel\"];\n }", "public function getChannels()\n {\n return $this->channels;\n }", "public function getChannels();", "public function getDistributionChannels()\n {\n return $this->distributionChannels;\n }", "public function getChannels()\n {\n return $this->Channels;\n }", "public function getAllChannels()\n {\n return $this->_channel;\n }", "public function via($notifiable)\n {\n $channels = [];\n if ($notifiable->setting->is_bid_cancelled_notification_enabled) {\n $channels = ['database']; // note: no Messenger yet like the other one's. App is still not approved, and there's the business registration requirement so..\n \n if ($notifiable->fcm_token) {\n $channels[] = FcmChannel::class;\n }\n }\n return $channels;\n }", "public function viaNotificationChannels()\n {\n return UserNotificationChannel::with('notification_channel')->get()->filter(function ($item) {\n return $item->muted_at == null;\n })->pluck('notification_channel.name');\n }", "public function channels()\n {\n return $this->send('channels');\n }", "public function getOrderChannels()\n\t{\n\t\t$request = $this->request('order_channels');\n\n\t\tif (!$request) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$decoded = $request->asArray();\n\t\treturn $decoded['data'];\n\t}", "public function channels()\n {\n $payloads = [\n 'code' => $this->channelCode,\n ];\n\n return $this->request('get', 'merchant/payment-channel', $payloads);\n }", "public function all(): array\n {\n return $this->channels;\n }", "public function getActiveNotificationChannelsOptions()\n {\n \treturn $this->getChannelOptions();\n }", "public function getAllChannels()\n {\n return Channel::all();\n }", "public function getSupplyChannels();", "public function getChannels()\n\t{\n\t\t$channels = App::make('ChannelRepository')->getChannels();\n\t\t\n\t\treturn App::make('Apiv1\\Transformers\\ChannelTransformer')->transformCollection($channels, $this->user);\n\t}", "public function via($notifiable)\n {\n $channel = ($this->channel == 'sms') ? 'nexmo' : $this->channel;\n return [$channel];\n }", "public function get_channels()\n {\n }", "public function getDeliveryChannel($i = 0)\n {\n if (isset($this->destinationList[$i]['DeliveryChannel'])) {\n return $this->destinationList[$i]['DeliveryChannel'];\n } else {\n return false;\n }\n }", "public function getDeliveries()\n {\n return $this->deliveries;\n }", "public function channels(){\n return $this->channelCollection->map(function ($item, $key) {\n return ['channel' => $item['channel']];\n });\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function via($notifiable)\n\t{\n\t\tif (!isset($this->notifitable)) {\n\t\t\t$this->notifitable = $notifiable;\n\t\t}\n\t\t$channels = ['db'];\n\t\tif (in_array('esms', $this->data['types'])) {\n\t\t\t$channels[] = 'esms';\n\t\t}\n\t\tif (in_array('email', $this->data['types'])) {\n\t\t\t$channels[] = 'mail';\n\t\t}\n\n\t\treturn $channels;\n\t}", "public function getChannel()\n {\n return $this->getData(self::CHANNEL);\n }", "public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }", "public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }", "public function via($notifiable)\n {\n return [FcmChannel::class];\n }", "public function broadcastOn() {\n return [\n new Channel('messages.' . $this->userReceiver->id . '.' . $this->currentUser->email),\n new Channel('messages.' . $this->currentUser->id . '.' . $this->userReceiver->email),\n ];\n }", "public function broadcastOn()\n {\n return [config('messenger.redis_channel', 'notification')];\n }", "public function via($notifiable): array\n {\n return [DiscordChannel::class];\n }", "public function via($notifiable)\n {\n return [WhatsappChannel::class, SmsChannel::class];\n }", "public function getSupplyChannels()\n {\n return $this->supplyChannels;\n }", "public function getChannel();", "public function getAllChannels()\n {\n return Channel::with('subChannel.display')->active()->alive()->get()->toArray();\n }", "public function setNotificationChannels($val)\n {\n $this->_propDict[\"notificationChannels\"] = $val;\n return $this;\n }", "public function getIncludeChannels()\n {\n return $this->include_channels;\n }", "public function getDelivery()\n {\n return $this->delivery;\n }", "public static function getChannels($aspect)\n {\n return self::getMetaProperty($aspect, 'channel');\n }", "public function broadcastOn()\n {\n return new Channel('notifications');\n }", "public function getAll(){\n\t\t$Channels = \\Channel::all();\n\t\treturn $Channels;\n\t}", "public function via( $notifiable )\n\t{\n\t\treturn [ OneSignalChannel::class ];\n\t}", "public function via($notifiable)\n {\n return [PushNotificationChannel::class];\n }", "public function channels(): ChannelsService;", "public function getNotificationTypes()\n {\n return $this->notifications;\n }", "public function getChannelList()\n {\n return Channel::with('subChannel.display')->get();\n }", "public function list_channels($exclude_archived=true) {\n\n $method=\"channels.list\";\n $payload['exclude_archived'] = $exclude_archived;\n\n $result = $this->apicall($method, $payload);\n if (isset($result['channels'])) {\n return $result['channels'];\n } else {\n return false;\n }\n }", "public function getChannel()\n {\n \treturn $this->_channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "function channelInfo()\n\t{\n\t\treturn $this->_channel;\n\t}", "public function broadcastOn()\n {\n return ['my-channel'];\n }", "public function via($notifiable)\n {\n return [SendGridChannel::class];\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel()\n {\n if (! $this->channel) {\n $this->set();\n }\n\n return $this->channel;\n }", "public function broadcastOn()\n {\n return ['channel-status'];\n }", "public function broadcastOn()\n {\n return [\n new Channel('sanityDeployment.' . $this->sanityDeployment->id),\n new Channel('sanityMainRepo.' . $this->sanityDeployment->sanityMainRepo->id),\n ];\n }", "public function via($notifiable)\n {\n return [DiscordChannel::class];\n }", "public static function getChannels() {\n\t\t$channels = [];\n\t\ttry {\n\t\t\t$mapper = new ObjectMapper();\n\t\t\t$response = self::getResponse();\n\t\t\t$data = json_decode( $response, true );\n\t\t\tif ( count( $data['Channels'] ) > 0 ) {\n\t\t\t\tforeach ( $data['Channels'] as $dataProject ) {\n $channels[] = $mapper->mapJson( json_encode( $dataProject ), Channel::class );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\treturn $channels;\n\t}", "public function getListDeliveryStatus()\n {\n return $this->client->makeRequest('deliverystatus', 'GET');\n }", "public function onChannels(): ?array\n {\n return null;\n }", "public function getChannel()\n\t{\n\t\treturn $this->channel;\n\t}", "public function via($notifiable): array\n {\n return [TelegramChannel::class];\n }", "public function getChannel() {\n return $this->channel;\n }", "public function getChannels()\n {\n return Channel::with('subChannel.category', 'subChannel.display')->whereNull('parent_channel')->active()->get()->toArray();\n }", "public function getDestinationChannel();", "public function getJoinDefaultChannels()\n {\n return $this->joinDefaultChannels;\n }", "function hpm_channels( $mutations ) {\n $mutation = $mutations[0];\n $object = $mutation->action == 'create' ?\n $mutation->property_value :\n hpm_object( $mutation->object_type, $mutation->object_id );\n $channels = [];\n switch ($mutation->object_type) {\n case 'message':\n case 'resource':\n if ( $object->project_id === NULL ) {\n $channels = ['members'];\n } else {\n $channels[] = 'private-managers';\n $project = hpm_object( 'project', $object->project_id );\n if ( $project->contractor_id !== NULL ) {\n $channels[] = 'private-contractor-' . $project->contractor_id;\n }\n }\n break;\n case 'package':\n $channels = ['private-managers'];\n break;\n case 'person':\n case 'project':\n $channels = ['members'];\n break;\n case 'time':\n $channels = ['private-managers'];\n $worker = hpm_object( 'person', $object->worker_id );\n if ( $worker->role == 'contractor' ) {\n $channels[] = 'private-contractor-' . $object->worker_id;\n }\n break;\n default: break;\n }\n return $channels;\n}", "public function getDistributionChannel()\n {\n return $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel;\n }", "private function getChannels()\r\n {\r\n static $channels;\r\n\r\n if (empty($channels)) {\r\n // Store the cache forever.\r\n $cache_key = 'categoryFirst';\r\n $channels = \\SCache::sear($cache_key, function () {\r\n $categories = $this->all();\r\n $channels = [];\r\n foreach ($categories as $category) {\r\n if ($category['bclassid'] == 0) {\r\n $channels[] = $category;\r\n }\r\n }\r\n return $channels;\r\n });\r\n }\r\n\r\n return $channels;\r\n }", "public function via($notifiable)\n {\n return [NetgsmChannel::class];\n }", "public function getChannels()\n {\n $size = $this->getImageSize();\n\n return $size['channels'];\n }", "public function get($name, $optParams = [])\n {\n $params = ['name' => $name];\n $params = array_merge($params, $optParams);\n return $this->call('get', [$params], NotificationChannel::class);\n }", "public function notifications()\n {\n $notifications = $this->get(\"/api/v1/conversations?as_user_id=sis_user_id:mtm49\");\n return $notifications;\n }", "public function via($notifiable)\n {\n return [WebPushChannel::class];\n }", "public function via($notifiable)\n {\n return [WebPushChannel::class];\n }", "public function getActiveChannels(string $format = 'xml'): array\n {\n $response = $this->prepareHttpClient('/mailer/channel/list', ['format' => $format])\n ->send();\n\n if ($format === 'csv') {\n return $this->parseResponse($response);\n }\n\n $xml = new SimpleXMLElement($this->parseResponse($response));\n\n $channels = [];\n foreach ($xml->children() as $channel) {\n $channels[] = [\n 'date' => new DateTime((string) $channel->attributes()->date),\n 'name' => (string) $channel->attributes()->name,\n 'info' => (string) $channel->attributes()->info,\n ];\n }\n\n return $channels;\n }", "public function via($notifiable)\n {\n $array = ['database', 'fcm'];\n\n if (setting('twilio_disabled') != true &&\n !blank(setting('twilio_from')) &&\n !blank(setting('twilio_account_sid')) &&\n !blank(setting('twilio_account_sid'))\n ) {\n array_push($array, TwilioChannel::class);\n }\n\n if (setting('mail_disabled') != true &&\n !blank(setting('mail_host')) &&\n !blank(setting('mail_username')) &&\n !blank(setting('mail_password')) &&\n !blank(setting('mail_port')) &&\n !blank(setting('mail_from_name')) &&\n !blank(setting('mail_from_address'))\n ) {\n array_push($array, 'mail');\n }\n\n return $array;\n }", "public function getChannel(): Channel\n {\n return $this->channel;\n }", "public function via($notifiable) {\n return [OneSignalChannel::class];\n }", "public function getChannelNames()\n {\n $array = [];\n\n foreach ($this->channels as $channel) {\n $array[$channel->name] = $channel->name;\n }\n\n return $array;\n }", "public function getNotifications()\n {\n return $this->_notifications;\n }", "public function getChannels(){\n\t\t//TODO: Change query\n\t\t$query = sprintf(\"SELECT idChannel FROM Channels limit 1\");\n\n\t\t$this->dbObj->Query($query);\n\n\t\tif ($this->dbObj->numErr) {\n\t\t\t$this->parent->SetError(5);\n\t\t}\n\n\t\t$out = NULL;\n\t\twhile (!$this->dbObj->EOF) {\n\t \t\t$out[] = $this->dbObj->GetValue(\"idChannel\");\n\t\t\t$this->dbObj->Next();\n\t\t}\n\n\t \treturn $out;\n\t}", "public function via($notifiable)\n {\n $via = [];\n\n foreach ($this->sendibleTraits() as $trait) {\n $viaNameFromTrait = $this->getViaNameFromTrait($trait);\n\n if ($this->shouldBeSentVia($viaNameFromTrait, $notifiable)) {\n $via[] = $this->{$viaNameFromTrait . 'Channel'}();\n }\n }\n\n return $via;\n }", "public function via($notifiable)\n {\n return [CustomDbChannel::class, 'mail'];\n }", "public function via($notifiable)\n {\n return [FacebookChannel::class];\n }", "public function getChannels()\n {\n $channels = $this->channels->getAll();\n $channelList = [];\n\n // Cycle through all of the channels and setup data for them\n foreach ($channels as $channel) {\n $message = $this->chat->getLatestByChannel($channel->id);\n\n $channelList[] = [\n 'name' => $channel->name_trim,\n 'messages' => $channel->messages,\n 'last_message' => strtotime($message['created_at']),\n ];\n }\n\n return json_encode(array_reverse($channelList));\n }", "public function getChannel()\n {\n return $this->_access->getChannel();\n }", "public function getChannel(): string {\n\t\t\treturn $this->channel;\n\t\t}", "public function getChannel($storeId = null);", "public function channels()\n {\n return $this->belongsToMany('App\\Channel');\n }", "public function broadcastOn()\n {\n return ['whatcanido-channel'];\n }", "public function getNotificationgroups()\n {\n return isset($this->notificationgroups) ? $this->notificationgroups : null;\n }", "public function via($notifiable)\n {\n $now = Carbon::now();\n $createdAt = Carbon::parse($notifiable->created_at);\n $dayFive = $createdAt->copy()->addDays(5)->startOfDay();\n $daySix = $createdAt->copy()->addDays(6)->endOfDay();\n if ($now->between($dayFive, $daySix)) {\n $this->isDayFive = $now->between($dayFive, $dayFive->copy()->endOfDay()) ? true : false;\n return [LineBotNotificationChannel::class];\n }\n\n return [];\n }", "public function broadcastOn()\n {\n return new Channel('doctor-notification');\n }", "public function via($notifiable)\n {\n return [OneSignalChannel::class];\n }" ]
[ "0.78077316", "0.7333707", "0.7127785", "0.7089724", "0.7087921", "0.70300424", "0.69931364", "0.6973003", "0.6951073", "0.6927183", "0.68472975", "0.67785895", "0.6697527", "0.6530563", "0.65100604", "0.6496754", "0.6474866", "0.6446399", "0.643471", "0.6423392", "0.64229727", "0.63781494", "0.63726985", "0.6277284", "0.6276724", "0.6276724", "0.6276724", "0.6234952", "0.6203739", "0.6179071", "0.6179071", "0.61232203", "0.61158967", "0.61088634", "0.6020671", "0.5995534", "0.5985168", "0.59301424", "0.5916712", "0.5912588", "0.5911691", "0.5896299", "0.5893216", "0.5889689", "0.5887195", "0.5878091", "0.586549", "0.58512723", "0.5812232", "0.5805207", "0.5800807", "0.57906127", "0.5786768", "0.5786768", "0.57807684", "0.5779888", "0.57715005", "0.57678837", "0.57678837", "0.5766476", "0.5754385", "0.57491064", "0.5742647", "0.5735341", "0.5732727", "0.57325697", "0.5728877", "0.57221526", "0.57207775", "0.57169145", "0.5712525", "0.5694798", "0.5688528", "0.5683845", "0.5683054", "0.5682042", "0.567513", "0.5663718", "0.5659599", "0.5652422", "0.5652422", "0.5630605", "0.5630334", "0.56298393", "0.5625376", "0.5625225", "0.56192815", "0.56115615", "0.5607237", "0.5602894", "0.5584222", "0.55823225", "0.55728054", "0.5566249", "0.5554496", "0.555214", "0.5549145", "0.55454457", "0.5544404", "0.55443466", "0.5544159" ]
0.0
-1
Get the mail representation of the notification.
public function toMail($notifiable) { $this->view = 'emails.notification.comment'; $path = $this->comment->path; $place_name = $this->comment->place->name; $this->subscription->comment_id = $this->comment->id; $this->subscription->save(); $subject = trans( 'gottashit.email.new_comment_add', ['place' => $this->comment->place->name], $notifiable->language ); return (new MailMessage) ->subject($subject) ->markdown('notifications.comment-added-notification', compact('path', 'place_name')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNotificationEmail() {}", "public function toMail($notifiable)\n {\n $mailMessage = (new MailMessage())\n ->error()\n ->subject($this->getMessageText())\n ->line($this->getMessageText());\n\n foreach ($this->getMonitorProperties() as $name => $value) {\n $mailMessage->line($name.': '.$value);\n }\n\n return $mailMessage;\n }", "public function getMail()\n {\n return $this->_transport->getMail();\n }", "function get () {\n $this->_build_mail();\n\n $mail = 'To: '.$this->xheaders['To'].\"\\n\";\n $mail .= 'Subject: '.$this->xheaders['Subject'].\"\\n\";\n $mail .= $this->headers . \"\\n\";\n $mail .= $this->full_body;\n return $mail;\n }", "public function toMail($notifiable)\n {\n $url = $this->getNotificationEndpoint($notifiable);\n return $this->buildMailMessage($url);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('用户举报通知')\n ->line('用户举报了'.$this->report['type'])\n ->line($this->report['reason'].$this->report['other'])\n ->action('查看举报内容', $this->report['link']);\n }", "public function getMail(): string\n {\n return $this->_mail;\n }", "public function getPlainMail()\n {\n return $this->get(self::_PLAIN_MAIL);\n }", "public function getMail()\n {\n return $this->mail;\n }", "public function getMail()\n {\n return $this->mail;\n }", "public function getMail()\n {\n return $this->mail;\n }", "public function getMail()\n {\n return $this->mail;\n }", "public function getFormatMail()\n {\n return $this->get(self::_FORMAT_MAIL);\n }", "public function getMailBodyText(Notification $notification) : string;", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->greeting('Hey '. auth()->user()->username)\n ->line('You Just received a new comment.')\n ->from($this->comment->commenter->email)\n ->action('Notification Action', url('http://dejavu.atmkng.de/'))\n ->line('Check out the discussions on DejaVu')\n ;\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function getMail():string\n {\n return $this->mail;\n }", "public function getMail()\n {\n return $this->_session->getMail();\n }", "public function getMail()\n\t{\n\n\t\treturn $this->mail;\n\t}", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line($this->message)\n ->action('دیدن سفارش', url(asset('/OrderStatus')))\n ->line('گروه مترجمین صفا');\n }", "public function getMailBodyHTML(Notification $notification) : string;", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->from('notification@lacomutc.fr', config('app.name'))\n ->subject('Vos billets sont disponibles')\n ->line('Vos billets sont disponibles !')\n ->action('Télécharger les billets ici ', route('show'))\n ->line('Il n\\'est désormais plus absolument nécessaire de les imprimer, vous pouvez soit télécharger votre place sur votre smartphone, soit l\\'imprimer pour présenter le QR code le jour de la représentation.')\n ->line('Nous vous rappelons qu\\'il est en revanche nécessaire d\\'être **présent 20 minutes avant le début du spectacle** et que **le placement est libre**.')\n ->line('Rendez vous le 14, 15 et 16 Décembre au Théâtre Impérial !');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('Bienvenid@!!')\n ->line('En base a la metodología de selección,')\n ->line('Te felicitamos por ser seleccionado');\n ->line('para presentar tu Pitch..s');\n }", "public function toMail($notifiable)\n {\n $message = new MailMessage;\n $message->greeting('Print On Demand Apparel')->subject('Order: \"'. $this->order->id .'\" updated');\n\n foreach($this->order->getChanges() as $key => $value){\n $message->line($key . \": \" . $value);\n }\n\n $message->action('View', route('front.orders.show', $this->order->id));\n \n return $message;\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->greeting('Hello!')\n ->subject('Someone just got to the checkout page of your website.')\n ->line('To see the order and details, follow the link below:')\n ->action('Dashboard notification', route('notification'))\n ->line('Thank you for using our application!');\n }", "public function routeNotificationForMail()\n {\n return $this->email;\n }", "public function toMail($notifiable)\n {\n return (new MailMessage())\n ->line('The introduction to the notification.')\n ->action('Notification Action', url('/'))\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n $this->data = str_replace(\"\\n\", \"<br>\", $this->data ?? '');\n\n return (new MailMessage)\n ->subject(__('Custom Exception Notification'))\n ->view('notifications.email.system_report', ['data' => $this->data ?? '']);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage())\n ->subject(trans('notifications.we_received_new_order'))\n ->line(trans('notifications.we_received_new_order_description'))\n ->line(trans('notifications.customer_name', ['name' => $this->order->user->username]))\n ->line(trans('notifications.total_price', ['price' => $this->order->formatted_total_price]))\n ->action(trans('notifications.show_order'), novaResourceAction('orders', $this->order->id));\n\n }", "public function notificationEmailAddress()\n {\n $notification_email = $this->getNotificationChannel('mail')['settings']['email'] ?? null;\n\n return $notification_email ?? $this->email;\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->greeting(__('Hello, ').$this->order->owner->name)\n ->subject(__('You Have Some New Attachment About Your Order'))\n ->line(__('For order number #').$this->order->id.__(' some new attachments has been uploaded recently.'))\n ->line(__('You can check the link below to see your files'))\n ->action(__('See attachments'), route('users.orders.show', [app()->getLocale(),\n $this->order->owner, $this->order]));\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->greeting(\"Hello \".$this->userData->name.', ')\n ->line('You have a notification Title '.$this->reminderData->documentTitle)\n ->line('Expire date is '.$this->reminderData->reminderDate)\n ->action('visit website', url('/dvalidator'))\n ->line('Thank you for using Notification validator !');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('[BaabClub]Your Topic Has Been Replied!')\n ->greeting('Hello! '.$notifiable->name.', Your Topic <i>'.$this->reply->communityTopic->title.'</i> has been replied')\n ->line('Replier : '.$this->reply->user->name)\n ->line('Content : '.strip_tags($this->reply->content))\n ->action('VIEW & REPLY', route('showCommunityContent',$this->reply->communityTopic->id).'#reply-'.$this->reply->id)\n ->line('<br>Thank you for your participation in community!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line(\"Olá, {$notifiable->nome},\")\n ->line('')\n ->line([\n 'Você está recebendo este e-mail porque recebemos um pedido de redefinição de senha para a sua conta.',\n 'Clique no botão abaixo para redefinir sua senha:',\n ])\n ->line([\n 'Estes são os dados de onde partiu a solicitação:',\n ])\n ->line(\"Localização: {$this->geo['city']}, {$this->geo['state']}, {$this->geo['country']}.\")\n ->line(\"IP: {$this->geo['ip']}\")\n ->line(\"Dispositivo: {$this->getDevice()}\")\n ->line(\"Plataforma: {$this->agent->platform()} {$this->agent->version($this->agent->platform())}\")\n ->line(\"Navegador: {$this->agent->browser() } {$this->agent->version($this->agent->browser()) }\")\n ->action('Redefinir Senha', panel()->resetPasswordTokenUrl($this->token))\n ->line('Se você não solicitou uma nova senha, não é necessário nenhuma ação. Mas certifique-se de que suas credenciais estejam seguras e atualizadas.');\n }", "public function toMail( $notifiable )\n\t{\n\t\treturn ( new MailMessage )\n\t\t\t->line( 'The introduction to the notification.' )\n\t\t\t->action( 'Notification Action', url( '/' ) )\n\t\t\t->line( 'Thank you for using our application!' );\n\t}", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('You have been added to ' . $this->entityName)\n ->line(sprintf(\n '%s added you to the %s: %s',\n $this->adder->name,\n $this->entityType,\n $this->entityName\n ));\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Você foi atribuído a uma nova solicitação!')\n ->greeting('Olá,')\n ->line('Você foi atribuído a uma nova solicitação: '.$this->ticket->title)\n ->action('Visualizar Solicitação', route('admin.tickets.show', $this->ticket->id))\n ->line('Obrigado!')\n ->line(config('app.name') . ' da Prefeitura de Ibema/PR')\n ->salutation(' ');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n // ->subject(Lang::get('Din ordrestatus er ændret'))\n ->line('Vores konsulent har nu verificeret at alt dokumentation er i orden og underskrevet. Vi er derfor glade for at din ordre nu er aktiv. Order Id #' . $this->order->custom_order_id)\n ->line('Følg med i processen på danpanel.dk. Hvis du har spørgsmål kan vi altid træffes på mail, telefon eller i vores online chat, når du er logget ind på vores hjemmeside.')\n ->action('Gå til profil', url('/login'));\n // ->line('Thank you for using our application!');\n }", "public function getMail()\n {\n return $this->Mail_user;\n }", "public function toMail($notifiable) {\n var_dump('going to send mail');\n\n // return (new MailMessage)\n // ->line('The introduction to the notification.')\n // ->action('Notification Action', url('/'))\n // ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Сообщение с сайта Lidz ' . '[' . date('d.m.Y H:i') . ']')\n ->greeting('Сообщение с сайта Lidz')\n ->line('Имя: ' . $this->name)\n ->line('E-mail: ' . $this->email)\n ->line('Телефон: ' . $this->phone)\n ->line('Сообщение: ' . $this->message)\n ->salutation(' ');\n }", "public function toMail($notifiable)\n\t{\n\t\t$report = $this->notifitable->reports()->create([\n\t\t\t\"user_id\" => $notifiable->id,\n\t\t\t\"scope\" => $this->data['scope'],\n\t\t\t\"channel\" => 'email',\n\t\t\t\"notification_id\" => $this->id,\n\t\t\t\"send_at\" => Carbon::now()\n\t\t]);\n\t\t$mail_message = (new MailMessage)\n\t\t\t->subject($this->data[\"title\"]);\n\t\tif (isset($this->data[\"email_view\"])) {\n\t\t\t$mail_message = $mail_message->view($this->data[\"email_view\"], isset($this->data['custom']) ? $this->data['custom'] : []);\n\t\t} else {\n\t\t\t$mail_message = $mail_message->line($this->data[\"body\"]);\n\t\t}\n\n\t\treturn $mail_message;\n\t}", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Spacheship has launched!')\n ->markdown('mail.spaceship', [\n 'spaceship' => 'foobar'\n ]);\n }", "public function toMail($notifiable)\n {\n if(!$this->message->message) {\n \n $this->message->message = 'Após levar em consideração todos os requisitos da vaga e suas qualificações profissionais, decidimos não dar prosseguimento com a sua candidatura.';\n }\n\n return (new MailMessage)\n ->subject('Atualização sobre sua candidatura para vaga de ' . $this->application->job->position->label)\n ->greeting('Atualização sobre candidatura')\n ->line($this->message->message)\n ->line('Seu cadastro ficará no nosso banco de dados e será levado em consideração quando tivermos outras oportunidades que se encaixem no seu perfil.');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('A ticket assign to ' .$this->group_name. 'TT# '.$this->ticket_id)\n ->line('A ticket assign to ' .$this->group_name. 'TT# '.$this->ticket_id);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->markdown('emails.post_was_updated', [\n 'user' => $notifiable,\n 'post' => $this->post\n ])\n ->subject(\"L'article {$this->post->name} viens d'être mise à ajour!\")\n ->from('contact@larasou.com', 'Larasou')\n ->replyTo('soulouf@larasou.com', 'Soulouf');\n }", "public function toMail($notifiable)\n {\n $healthUpdate = $this->healthUpdate;\n \n $message = new MailMessage;\n $message->subject('[INFOMINA ELS] - Medical Leave Applied');\n $message->greeting('Hi '.$healthUpdate['name'].',');\n $message->line('It seems like you are unwell. Thus, we have submitted a medical leave on behalf of you.');\n $message->line('Date : '.$healthUpdate['date_from'].' to '.$healthUpdate['date_to']);\n $message->line('Total Day(s) : '.$healthUpdate['total_days']);\n $message->line('Please contact the HR for any changes in action.');\n $message->line('Take care!');\n\n return $message;\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->from(config('imap.accounts.default.username'), $this->clientMessage->getFromName())\n ->subject($this->clientMessage->getTitle())\n ->greeting($this->clientMessage->getTitle())\n ->line($this->clientMessage->getText());\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject(\"Invoice from \".$data->user.\" on lancers\")\n ->greeting(\"Hello \".$data->name)\n ->line($data->user.\" has sent you an invoice of the sum of NGN\".$data->amount.\" for the project \".$data->project)\n ->line(\"Use the button below to view the invoice and make payment\")\n ->action(\"View Invoice\", $this->data->invoice_url))\n ->line('Ignore this message if you think it is a mistake');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('The introduction to the notification.')\n ->action('Notification Action', 'https://laravel.com')\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line('New contact us submit')\n ->line('Name: '.$this->data[\"name\"])\n ->line('Email: '.$this->data[\"email\"])\n ->line('Subject: '.$this->data[\"subject\"])\n ->line('Message: '.$this->data[\"message\"]);\n }", "public function getMailSubject(Notification $notification) : string;", "public function getmail() {\n\t\treturn $this->mail;\n\t}", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Your request for ' . $this->ticket->form->template->name . ' (Ticket No. ' . $this->ticket->id . ') has been updated!')\n ->line('')\n ->line('Request has been updated:')\n ->line('Cancelled by ' . $this->update->employee->renderFullname())\n ->line('')\n ->line($this->update->description)\n ->line('')\n ->line('For more details you may also view the request by clicking the button below.')\n ->action('View', route('ticket.show', $this->ticket->id)); \n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->from(config('mail.from.address'), config('mail.from.name'))\n ->subject(__('Customer register'))\n ->markdown('mail.customer', ['customer' => $this->customer]);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->from(env('MAIL_USERNAME'), env('APP_NAME'))\n ->greeting('เรียน '.'คุณ'.$this->name)\n ->subject('การแจ้งเตือนรีเซ็ตรหัสผ่าน')\n ->line('คุณได้รับอีเมลนี้เนื่องจากเราได้รับคำขอรีเซ็ตรหัสผ่านสำหรับบัญชีของคุณ.')\n ->action('รีเซ็ตรหัสผ่าน', url('password/reset', $this->token))\n ->line('หากคุณไม่ได้ร้องขอการรีเซ็ตรหัสผ่านไม่จำเป็นต้องดำเนินการใดๆอีก.');\n }", "public function toMail($notifiable)\n {\n $order = $this->order;\n\n return (new MailMessage)\n ->subject('Orden de Quick Restaurant EXITOSA!')\n ->line(\"Orden codigo: $order->id\")\n ->line(\"Total pagado: $order->total COP\")\n ->line(\"Gracias por tu compra!\");\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Nová požiadavka vo Vašej učebni - ' . $this->ticketObj->area->name . ' - PC' . $this->ticketObj->pc )\n ->greeting('Zdravím ' . $notifiable->name)\n ->line('V učebni ' . $this->ticketObj->area->name . ', ktorú spravujete vytvoril užívateľ ' . $this->ticketObj->user->name . ' novú požiadavku.')\n ->action('Detail požiadavky', action('Tickets\\TicketController@show',[$this->ticketObj->id]))\n ->line('O ďalších zmenách stavu požiadavky budete informovaní emailom.')\n ->line('Ďakujeme za používanie ReFa!')\n ->line('V prípade, že nie ste správcom tejto učebne kontaktujte správcu systému.');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('ثبت ملک')\n ->view('emails.sabt', ['estate' => $this->estate]);\n }", "protected function create_notification_email_object()\n\t{\n\t\t$category = $this->category();\n\n\t\t$email = new Charcoal_Email;\n\t\t$email->to = $this->get_notified_email_address();\n\t\t$email->reply_to = $this->get_lead_email_address();\n\n\t\tif ( $category ) {\n\t\t\t$email->subject = $category->p('confirmation_email_subject')->text();\n\t\t\t$email->from = $category->p('confirmation_email_from')->text();\n\t\t\t$email->cc = $category->v('confirmation_email_cc');\n\t\t\t$email->bcc = $category->v('confirmation_email_bcc');\n\t\t}\n\n\t\treturn $email;\n\t}", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Accept Resignation')\n ->line('Dear '.$this->employee_info->name.',')\n ->line('Your resignation submitted '.date('M. d, Y',strtotime($this->employee_info->upload_date)).' , effective '.date('M. d, Y',strtotime($this->employee_info->last_day)).' was approved by '.auth()->user()->name.'. A copy of this notice shall be given to Human Resources for clearance preparation.')\n // ->action('(click button)', $this->server->server_ip.'/uploaded-letter')\n ->line('An e-mail indicating the next steps shall be sent to you shortly. ')\n ->line('Please check the Offboarding System and your e-mail regularly for updates. ')\n ->line('This is an auto generated email please do not reply')\n ->line('Thank you for using our application!');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->from('suporte@postings.com')\n ->subject($this->subject)\n ->greeting(\"Olá {$this->user->name},\")\n ->line($this->text)\n ->line(new HtmlString(\"<div align='center' style='margin: auto 60px; background-color: #eee; padding: 30px 15px; font-weight: bold; letter-spacing: 5px; font-size: 1.2rem'>\n {$this->user->validation_code}\n </div>\"))\n ->line(new HtmlString(\"<br><br><br>Obrigado por usar nossa aplicação\"))\n ->salutation('Atenciosamente,');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('ยืนยันอีเมล์')\n ->line('โปรดคลิกปุ่มด้านล่างเพื่อยืนยันอีเมล์')\n ->action('ยืนยันอีเมล์',\n $this->verificationUrl($notifiable)\n )\n ->line('หากท่านไม่ได้สมัครสมาชิกต้องขอภัยมา ณ ที่นี้ด้วย');\n /*\n return (new MailMessage)\n ->subject('ยืนยันอีเมล์')\n ->view('emails.user.verify-email',['url' => $this->verificationUrl($notifiable)]);*/\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject(\"Invitación de participación en proyecto de {$this->project->projectType->type} - Ibis\")\n ->greeting(\"¡Hola {$this->user->name}!\")\n ->line(\"El semillero de investigación {$this->researchTeam->name} de la institución educativa {$this->researchTeam->researchGroup->educationalInstitutionFaculty->educationalInstitution->name} quiere invitarlo para que participe en el desarrollo del proyecto {$this->project->title}. Por favor revise el documento adjunto, si esta de acuerdo firme y posteriormente cargue el documento en pdf en la sección 'Enviar respuesta' haciendo clic en 'Más información del proyecto'.\")\n ->action('Más información del proyecto', route('nodes.explorer.searchProjects.showProject', [$this->node, $this->project]))\n ->line('Gracias y esperamos su pronta respuesta')\n ->attach($this->file);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->greeting(' ')\n ->line('Новый комментарий пользователя ' . $this->data['commenter'] . ' к статье \"' . $this->data['title'] . '\" :')\n ->line(' …' . $this->data['body'] . '…')\n ->action('Перейти на страницу статьи', url('/posts/' . $this->data['slug'] ))\n ->salutation('С приветом, Я!');\n }", "public function getNotifyMsg()\n {\n return $this->get(self::_NOTIFY_MSG);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject(\"A new order #\".$this->order->id.\" has been created\")\n ->greeting('Hello '.$notifiable->name.',')\n ->line(\"A new order #\".$this->order->id.\" has been created By \".$this->order->user->name)\n ->line('Thank you for managing your shop in'.setting('site_name'));\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('News on Laramap.com 🗞️')\n ->greeting('Dear '.$this->user->username)\n ->line($this->data['body'])\n ->line('Please note that laramap is still in development. 👷‍')\n ->line('Thank you for using Laramap! 😻');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Reward Checkpoint Reminder')\n ->line('Just a reminder – let us know how frequently you’ve been participating with your students! In exchange for your participation in the survey, you’ll have a chance to win awesome prizes including NBA apparel, tickets to games, and special event experiences. You must complete the form by end-of-day on Friday to qualify!')\n ->action('Share Data', url('/checkpoint'))\n ->line('Thank you!');\n }", "public function toMail($notifiable)\n {\n if ($this->user->type() == 'cso') {\n $type = \"примател\";\n } else {\n $type = \"донатор\";\n }\n $message = (new MailMessage)->subject('[Сите Сити] Променет е профилот на ' . $type . 'от.')\n ->line('Направени се следниве измени:')\n ->line('Тип: ' . $type)\n ->line('Име: ' . $this->user->first_name)\n ->line('Презиме: ' . $this->user->last_name)\n ->line('Емаил: ' . $this->user->email)\n ->line('Организација: ' . $this->user->organization->name)\n ->line('Адреса: ' . $this->user->address)\n ->line('Телефон: ' . $this->user->phone)\n ->line('Локација: ' . $this->user->location->name);\n return $message;\n }", "public function mail()\n\t{\n\t\treturn $this->_mail;\n\t}", "public function toMail($notifiable)\n {\n $link = url(\"/week?id=\" . $this->weekID);\n\n return (new MailMessage)\n ->subject('HSH | Una subasta inscripta ha sido obtenida por un Premium')\n ->greeting('Hola, ' . $notifiable->nombre)\n ->line('Un usuario Premium se ha adjudicado una semana en la que estabas inscripto')\n ->line('Propiedad: ' .$this->propertyName)\n ->line('Semana: ' .$this->date)\n ->action('Ver Semana', $link)\n ->salutation('Home Switch Home - Cadena de Residencias');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->line($this->title)\n ->action('View Achievement', $this->link)\n ->line($this->text);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->greeting('Hola')\n ->subject('Consulta de Reserva')\n ->line('Tienes una nueva consulta de reserva')\n ->line('Nombre: '.$this->name)\n ->line('Email: '.$this->email)\n ->line('Telefono: '.$this->phone)\n ->line('fecha: '.$this->date)\n ->line('Tipo de evento : '.$this->type_event)\n ->line('Asistentes : '.$this->assistants)\n ->line('Detalles del evento : '.$this->comments);\n }", "public function toMail($notifiable)\n {\n $url = url('/invoice/'.$this->invoice->id);\n\n return (new MailMessage)\n ->greeting('Olá usuário.')\n ->line('Esse email é referente a sua solicitação para refazer sua senha.')\n ->action('View Invoice', $url)\n ->line('Este email ira expirar em 1 hora.')\n ->line('Caso você não tenha feito a solicitação, desconsidere esse email.')\n ->line('Equipe CoguMais agradece.');\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject(__('Request Received'))\n ->line(__(\n \"Thanks for getting in touch! This is an automatic email just to let you know that we've received your request and your ticket reference is :ticketId.\",\n ['ticketId' => $this->ticket->id]\n ))\n ->line(__('One of our support agents will get back to you shortly. Please do not submit multiple tickets for the same request, as this will not result in a faster response time.'))\n ->action('View Help Center', url('/help-center'));\n }", "public function toMail($notifiable)\n {\n //$location = $this->vdvk->getProposedLocation;\n return (new MailMessage)\n ->subject('Funds has been released Successfully for VDY ')\n ->line('Dear Sir/Madam,')\n ->line('Greetings!!,')\n ->line($this->messgae)\n ->line('Thanks & Regards')\n ->line('VDY VDIS Admin');\n }", "public function toMail($notifiable)\n {\n $mail = new MailMessage();\n\n $mail->greeting('Hello, '. $notifiable->username . '!');\n $mail->line('There has a new user registred on webiste.');\n $mail->line('Username: ' . $this->data->username);\n $mail->line('Email: ' . $this->data->email);\n $mail->line('Created At: ' . $this->data->created_at);\n $mail->action('Visit admin panel', admin_url());\n\n return $mail;\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Votre topic a été supprimé.')\n ->markdown('mails.topic-deleted', [\n 'topic' => $this->topic,\n 'project' => $this->project,\n 'user' => $notifiable\n\n ]);\n }", "public function getNotification()\n {\n return $this->notification;\n }", "public function getNewMail()\n {\n return $this->get(self::_NEW_MAIL);\n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Event Closed')\n ->line(\"An Event titled: {$this->event->title} dated on {$this->event->event_date->format('M jS, Y')} has been closed\")\n ->line(\"For more information about your ticket sales, click on the link below\")\n ->action(\"Event Page\", route('backend.events.details', $this->event->id));\n }", "public function getMail():string\n { \n return $this->mail;\n }", "public function toMail($notifiable)\n { \n \n return (new MailMessage)\n ->subject('¡Te han agregado al equipo de un objetivo en Participes!')\n ->markdown('mail.objectives.join', ['user' => $notifiable, 'objective' => $this->objective, 'role' => ($this->role == 'manager' ? 'coordinardor/a' : 'reportero/a')]);\n \n }", "public function toMail($notifiable)\n {\n return (new MailMessage)\n ->subject('Pemberitahuan Jadwal Pelaksanaan Ikrar')\n ->line('Jadwal ikrar ditetapkan pada tanggal')\n ->line(date('d-m-Y', strtotime($this->tanggal)) . ' Pukul ' . date('H:i', strtotime($this->tanggal)))\n ->line('Tempat: KUA Pulosari')\n ->line('Dimohon untuk wakif mempersiapkan dan membawa nadzir dan saksi saat akan melaksanakan ikrar wakaf')\n ->action('Lihat Status Pengajuan', route('wakif.pengajuan-wakaf.show', $this->berkasWakif->id))\n ->line('Terimakasih');\n }" ]
[ "0.7329682", "0.73008144", "0.7279281", "0.72447264", "0.7150932", "0.713269", "0.71279645", "0.7124905", "0.70436907", "0.70436907", "0.70436907", "0.70436907", "0.70169747", "0.6981995", "0.6965215", "0.69630843", "0.6962014", "0.69318545", "0.692679", "0.6913696", "0.6901655", "0.6891927", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6882121", "0.6874644", "0.6874644", "0.6874644", "0.6874644", "0.6874644", "0.6873094", "0.68712616", "0.6863366", "0.6861968", "0.68592066", "0.6855583", "0.6834309", "0.68288237", "0.6827025", "0.6818496", "0.6818069", "0.68166715", "0.681161", "0.6810731", "0.6802911", "0.6799005", "0.67923856", "0.679201", "0.67880183", "0.6786402", "0.6784462", "0.67844015", "0.678121", "0.6771769", "0.6767643", "0.6746845", "0.67418754", "0.67416346", "0.67398185", "0.67343414", "0.67270494", "0.6722636", "0.67166543", "0.6715651", "0.6713519", "0.6710188", "0.6708883", "0.6704977", "0.6704099", "0.6702548", "0.6692169", "0.6691404", "0.66834474", "0.6674972", "0.6672788", "0.6670916", "0.6653598", "0.6645107", "0.6644927", "0.6637104", "0.6635857", "0.66354716", "0.6632256", "0.66166365", "0.66161466", "0.6615812", "0.6606413", "0.6602531", "0.6601729", "0.6601182", "0.6600807", "0.6598184", "0.65979403" ]
0.0
-1
Get the array representation of the notification.
public function toArray($notifiable) { return [ // ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray()\n {\n return [\n 'on' => $this->on,\n 'message' => $this->message,\n 'remaining' => $this->remaining\n ];\n }", "public function toArray($notifiable)\n {\n return $this->message;\n }", "public function getAsArray() {\n return $this->message;\n }", "public function toArray()\n {\n $message = [\n 'from' => $this->from,\n 'message' => $this->message,\n ];\n\n return $message;\n }", "public function toArray(): array\n {\n return [\n 'message' => $this->message,\n 'types' => $this->types,\n 'dismissible' => $this->dismissible,\n ];\n }", "public function toArray($notifiable)\n {\n $notification = $this->notification;\n return [\n 'id' => $notification->id,\n 'title' => $notification->title,\n 'description' => $notification->description,\n 'button_text' => $notification->button_text,\n 'is_read' => $notification->is_read,\n 'created_at' => $notification->created_at,\n [\n 'notification_for' => $notification->notifiable\n ]\n ];\n }", "public function toArray(NotifiableInterface $notifiable): array\n {\n return [\n 'message' => 'This is a database notification sent at ' . \\date(DATE_COOKIE),\n ];\n }", "public function toArray()\n {\n return array_filter([\n 'sender' => $this->sender(),\n 'timestamp' => $this->timestamp()->timestamp,\n 'uuid' => $this->uuid(),\n ]);\n }", "public function toArray() {\n\n\t\tif (! $this->isMessagePrepared()) {\n\t\t\t$this->prepareMessage();\n\t\t}\n\n\t\t$values = array(\n\t\t\t'sender' => $this->formatAddresses($this->getSender()),\n\t\t\t'recipient' => $this->formatAddresses($this->getTo()), // @todo change me! recipient has been deprecated in favor of \"to\".\n\t\t\t'to' => $this->formatAddresses($this->getTo()),\n\t\t\t'cc' => $this->formatAddresses($this->getCc()),\n\t\t\t'bcc' => $this->formatAddresses($this->getBcc()),\n\t\t\t'reply_to' => $this->formatAddresses($this->getReplyTo()),\n\t\t\t'subject' => $this->getMailMessage()->getSubject(),\n\t\t\t'body' => $this->getMailMessage()->getBody(),\n\t\t\t'attachment' => count($this->getMailMessage()->getChildren()),\n\t\t\t'context' => (string)GeneralUtility::getApplicationContext(),\n\t\t\t'was_opened' => 0,\n\t\t\t'message_template' => $this->messageTemplate->getUid(),\n\t\t\t'message_layout' => is_object($this->messageLayout) ? $this->messageLayout->getUid() : 0,\n\t\t\t'sent_time' => time(),\n\t\t\t'mailing' => is_object($this->mailing) ? $this->mailing->getUid() : 0,\n\t\t);\n\n\t\treturn $values;\n\t}", "public function toArray($notifiable)\n {\n $this->sendFCMNotification($notifiable);\n \n return [\n 'notifyType' => $this->message['notifyType'],\n 'message' => $this->message['message'],\n 'url' => $this->message['url'],\n 'created_at' => Date('Y-m-d h:i:s')\n ];\n }", "public function toArray($notifiable)\n {\n return $this->chat->toArray();\n }", "public function get()\n {\n $data = array_reverse(array_map('unserialize', file('notification')));\n\n return [\"list\", $data];\n }", "public function toArray()\n {\n $message = [\n 'url' => $this->url,\n 'title' => $this->subject,\n 'message' => $this->body,\n ];\n\n if ($this->icon) {\n $message['image_url'] = $this->icon;\n }\n\n return $message;\n }", "public function toArray($request)\n {\n return self::notification($this);\n }", "public function toDbArray() {\n\t\treturn [\n\t\t\t'notification_event' => $this->event->getId(),\n\t\t\t'notification_user' => $this->user->getId(),\n\t\t\t'notification_timestamp' => $this->timestamp,\n\t\t\t'notification_read_timestamp' => $this->readTimestamp,\n\t\t\t'notification_bundle_hash' => $this->bundleHash,\n\t\t];\n\t}", "public function getMessageData()\n {\n return (array) array();\n }", "public function toArray()\n {\n $data = array(\n 'id' => $this->getId(),\n 'status' => $this->getStatus(),\n 'title' => $this->field ? ($this->field->getAlertDescription() ? $this->field->getAlertDescription() : $this->field->getAlertTitle()) : '',\n 'alert_description' => $this->field ? ($this->field->getAlertDescription() ? $this->field->getAlertDescription() : $this->field->getAlertTitle()) : '',\n 'field' => $this->field ? $this->field->toArray() : null,\n 'vehicle' => $this->getVehicle()->toInfoArray(),\n 'user' => $this->check_list ? $this->check_list->getUser()->toInfoArray() : array(),\n 'description' => $this->getDescription(),\n 'images' => $this->getImages(),\n 'thumbnail' => $this->getThumbnail(),\n 'comments' => $this->getComments(),\n 'creation_date' => $this->getCreationDate()->getTimestamp(),\n 'update_date' => $this->getUpdateDate()->getTimestamp(),\n 'history' => $this->getHistory(),\n 'refreshed_times' => $this->getRefreshedTimes()\n );\n return $data;\n }", "public function toArray() {\n return array(\n 'id' => $this->_id,\n 'queue' => $this->_queue,\n 'payload' => $this->_payload,\n 'attempts' => $this->_attempts,\n 'reserved_at' => $this->_reserved_at,\n 'available_at' => $this->_available_at,\n 'created_at' => $this->_created_at\n );\n }", "public function toArray($notifiable)\n {\n return [\n 'type_name' => 'message',\n 'message' => trans(\n 'notifications.new_message_notification',\n [\n 'user' => $this->message->user->display_name,\n ]\n ),\n 'message_id' => $this->message->id,\n 'user_id' => $this->message->user->id\n ];\n }", "public function toArray()\n {\n return [\n 'code' => ModelsNotification::SCHEDULE_CREATED,\n ];\n }", "public function toArray()\n {\n return [\n 'title' => $this->title,\n 'body' => $this->body,\n 'sound' => $this->sound,\n 'badge' => $this->badge,\n 'ttl' => $this->ttl,\n 'channelId' => $this->channelId,\n 'data' => empty($this->jsonData) ? '{}' : json_encode($this->jsonData),\n ];\n }", "public static function notifications(): array\n {\n return [];\n }", "public function toMessage(): array;", "public function toArray($notifiable)\n {\n $user = App\\User::find(1);\n\n foreach ($user->notifications as $notification) {\n echo $notification->type;\n }\n return [\n 'invoice_id' => $this->invoice->id,\n 'amount' => $this->invoice->amount,\n ];\n }", "public function toArray($request)\n {\n return [\n 'id' => $this->id,\n 'title' => $this->target()->getNotificationTitle($this->resource),\n 'body' => $this->target()->getNotificationBody($this->resource),\n 'image' => $this->target()->getNotificationImage($this->resource),\n 'dashboard_url' => $this->target()->getNotificationDashboardUrl($this->resource),\n 'type' => $this->data['type'] ?? null,\n 'data' => $this->target()->getNotificationData($this->resource),\n 'read' => (bool) $this->read_at,\n 'created_at' => $this->created_at->diffForHumans(),\n ];\n }", "public function toArray() {\n\t\treturn array(\n\t\t\tself::FIELD_ID_CHAT=>$this->getIdChat(),\n\t\t\tself::FIELD_ID_JOUEUR=>$this->getIdJoueur(),\n\t\t\tself::FIELD_PSEUDO=>$this->getPseudo(),\n\t\t\tself::FIELD_QUAND=>$this->getQuand(),\n\t\t\tself::FIELD_MESSAGE=>$this->getMessage());\n\t}", "public function toArray($notifiable)\n {\n return [\n 'message' => $this->getMessage(),\n 'href' => $this->getHref(),\n ];\n }", "public function toArray($notifiable)\n {\n return [\n 'notification_id' => $this->id,\n 'todo_id' => $this->todo->id,\n 'title' => $this->todo->title,\n 'text' => $this->todo->text,\n ];\n }", "public function toArray()\n\t{\n\t\treturn array(\n\t\t\t'name' => $this->name,\n\t\t\t'title' => $this->title,\n\t\t\t'hasPermission' => $this->hasPermission,\n\t\t\t'messages' => $this->messages,\n\t\t\t'confirmation' => $this->confirmation,\n\t\t);\n\t}", "public function jsonSerialize()\n {\n return [\n 'id' => $this->getId(),\n 'textNotification' => $this->getTextNotification(),\n 'createdAt' => $this->getCreatedAt()\n ];\n }", "public function toArray()\n {\n return [\n 'timestamp' => $this->timestamp,\n 'type' => $this->type,\n 'content' => $this->content\n ];\n }", "public function toArray() {\n\t\t$ret = array(\n\t\t\t\"contactDetails\" => array(\n\t\t\t\t\"contactName\" => Client::clean($this->name),\n\t\t\t\t\"telephone\" => Client::clean($this->phoneNumber),\n\t\t\t),\n\t\t\t\"address\" => $this->address->toArray(),\n\t\t);\n\t\tif ($this->emailAddress || $this->mobileNumber) {\n\t\t\t$ret['notificationDetails'] = array();\n\t\t}\n\t\tif ($this->emailAddress) {\n\t\t\t$ret['notificationDetails']['email'] = Client::clean($this->emailAddress);\n\t\t}\n\t\tif ($this->mobileNumber) {\n\t\t\t$ret['notificationDetails']['mobile'] = Client::clean($this->mobileNumber);\n\t\t}\n\t\treturn $ret;\n\t}", "public function toArray()\n {\n $result = array(\n Epicom_MHub_Helper_Data::API_SHIPMENT_EVENT_CREATED => Mage::helper ('mhub')->__('Created'),\n Epicom_MHub_Helper_Data::API_SHIPMENT_EVENT_NF => Mage::helper ('mhub')->__('NF'),\n Epicom_MHub_Helper_Data::API_SHIPMENT_EVENT_SENT => Mage::helper ('mhub')->__('Sent'),\n Epicom_MHub_Helper_Data::API_SHIPMENT_EVENT_DELIVERED => Mage::helper ('mhub')->__('Delivered'),\n Epicom_MHub_Helper_Data::API_SHIPMENT_EVENT_FAILED => Mage::helper ('mhub')->__('Failed'),\n Epicom_MHub_Helper_Data::API_SHIPMENT_EVENT_PARCIAL => Mage::helper ('mhub')->__('Parcial'),\n Epicom_MHub_Helper_Data::API_SHIPMENT_EVENT_CANCELED => Mage::helper ('mhub')->__('Canceled'),\n );\n\n return $result;\n }", "public function toArray(): array\n {\n return [\n 'currency' => $this->currency,\n 'amount' => $this->amount,\n 'message' => $this->message,\n ];\n }", "public function toArray($notifiable)\n {\n return $this->data;\n }", "public function toArray($notifiable)\n {\n return [\n 'model_id' => $this->conv->id,\n 'model_type' => get_class($this->conv),\n 'message' => 'Richiesta di approvazione per la convenzione '.$this->conv->descrizione_titolo.' (n. '.$this->conv->id.') è stata inviata! ',\n 'description' => $this->data['description'] ? $this->data['description'] : '',\n 'subject' => 'Richiesta approvazione'\n ];\n }", "public function toArray() {\n return $this->array;\n }", "public function toArray($notifiable)\n {\n $this->data['id']=$this->id;\n $options = array(\n 'cluster' => 'ap1',\n 'encrypted' => true\n );\n $pusher = new \\Pusher\\Pusher(\n env('PUSHER_APP_KEY'),\n env('PUSHER_APP_SECRET'),\n env('PUSHER_APP_ID'),\n $options\n );\n $pusher->trigger('NotificationEvent', 'send-message/'.$notifiable->id, $this->data);\n return $this->data;\n }", "public function toArray($notifiable)\n {\n return [\n \"server_id\" => $this->server->id,\n \"time\" => time()\n //\n ];\n }", "public function toArray()\n {\n return [\n 'subject' => $this->adder,\n 'action' => 'added you to',\n 'object_type' => $this->entityType,\n 'object_name' => $this->entityName,\n 'object_id' => $this->entityId,\n ];\n }", "public function toArray() {\n\t\treturn $this->array;\n\t}", "public function toArray()\n {\n return [\n 'success' => $this->success,\n 'error' => !$this->success,\n 'message' => $this->message,\n ] + $this->data;\n }", "public function toArray($notifiable)\n\t{\n\t\treturn [\n\t\t\t//\n\t\t];\n\t}", "public function toArray()\n {\n $packet = $this->getPacket();\n\n if(empty($packet['latest_line'])) {\n $packet['latest_line'] = '';\n }\n if(empty($packet['progress'])) {\n $packet['progress'] = 0;\n }\n\n return array(\n 'id' => (string)$this->id,\n 'queue' => (string)$this->queue,\n 'class' => (string)$this->class,\n 'data' => $this->data,\n 'worker' => (string)$packet['worker'],\n 'status' => (int)$packet['status'],\n 'created' => (float)$packet['created'],\n 'updated' => (float)$packet['updated'],\n 'delayed' => (float)$packet['delayed'],\n 'started' => (float)$packet['started'],\n 'finished' => (float)$packet['finished'],\n 'progress' => (float)$packet['progress'],\n 'progress_l' => (string)$packet['latest_line'],\n 'output' => $packet['output'],\n 'exception' => $packet['exception']\n );\n }", "public function toArray()\n {\n return $this->info;\n }", "public function toArray()\n {\n return [\n 'title' => MessengerUtils::checkStringLength($this->title, 80),\n 'item_url' => $this->item_url,\n 'image_url' => $this->image_url,\n 'subtitle' => MessengerUtils::checkStringLength($this->subtitle, 80),\n 'buttons' => MessengerUtils::checkArraySize($this->buttons, 3)\n ];\n }", "public function toSlackObjectArray(): array;", "public function toArray($notifiable) {\n\t\treturn [\n\t\t\t//\n\t\t];\n\t}", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray()\n {\n return array(\n 'id' => $this->id,\n 'description' => $this->description,\n 'involvementKindID' => $this->involvementKindID,\n 'reportKindID' => $this->reportKindID,\n 'locationID' => $this->locationID,\n 'personID' => $this->personID,\n 'departmentID' => $this->departmentID,\n 'dateTime' => $this->dateTime,\n 'statusID' => $this->statusID,\n 'actionTaken' => $this->actionTaken,\n 'photoPath' => $this->photoPath\n );\n }", "public function toArray(): array\n {\n /**\n * @todo - fix this - see HER-3124\n */\n return [\n \"id\" => $this->id,\n 'connection' => $this->getAttribute('connection'),\n \"queue\" => $this->queue,\n \"payload\" => $this->payload,\n \"failed_at\" => $this->perhaps_format_date($this->failed_at),\n\n \"created_at\" => $this->perhaps_format_date($this->created_at),\n \"updated_at\" => $this->perhaps_format_date($this->updated_at),\n\n \"model_name\" => self::class,\n ];\n }", "public function toArray()\n {\n return array_filter(array(\n 'VPSProtocol' => $this->vpsProtocol,\n 'TxType' => $this->txType,\n 'Vendor' => $this->vendor,\n 'VendorTxCode' => $this->vendorTxCode,\n 'Currency' => $this->currency,\n 'NotificationURL' => $this->notificationUrl,\n 'Profile' => $this->profile\n ));\n }", "public function toArray($notifiable)\n {\n return [\n //\n ];\n }", "public function toArray($notifiable)\n {\n return [\n //\n 'type'=>'community.topic.replied',\n 'topicId'=>$this->reply->communityTopic->id,\n 'topicTitle'=>$this->reply->communityTopic->title,\n 'replyId'=>$this->reply->id,\n 'replyContent'=>$this->reply->content,\n 'replierId'=>$this->reply->user->id,\n 'replierName'=>$this->reply->user->name,\n ];\n }", "public function toArray($notifiable)\n {\n return [\n 'purchase_requisition_id' => $this->purchaseRequisition->id,\n 'number' => $this->purchaseRequisition->number,\n 'message' => 'A new purchase requisition was saved',\n ];\n }", "public function toArray($notifiable)\n {\n return [\n 'response_id' => $this->response->id,\n 'ticket_id' => $this->ticket->id,\n ];\n }", "public function toArray( $notifiable )\n\t{\n\t\treturn [\n\t\t\t//\n\t\t];\n\t}", "public function toArray( $notifiable )\n\t{\n\t\treturn [\n\t\t\t//\n\t\t];\n\t}", "public function toArray()\n {\n return [\n 'message' => '<span class=\"text-gray-800 font-medium\">'.$this->reply->owner->full_name.'</span> vous a mentionné dans le sujet <span class=\"text-gray-800 font-medium\">'. $this->reply->thread->title.'</span>',\n 'link' => $this->reply->path(),\n 'user_profile' => $this->reply->owner->username,\n 'user_photo' => $this->reply->owner->picture,\n 'action' => 'mention'\n ];\n }", "public function toArray($notifiable)\n {\n return [\n 'type' => 'notification',\n 'title' => 'Pengajuan Baru',\n 'body' => 'Pengajuan baru dengan nomor registrasi '.$this->pengajuan.' Menunggu verifikasi dari anda'\n ];\n }", "public function toArray($notifiable)\n {\n $timestamp = Carbon::now()->addSecond()->toDateTimeString();\n return [\n 'body' => $this->loan->staff->full_name . \" was request to loan salary amount: $\" . $this->loan->amount . \"<br/>Reason: {$this->loan->reason}\",\n 'notify_type' => 'loan_request',\n 'notify_id' => $this->loan->uuid,\n 'title' => 'Loan Request',\n 'created_at' => $timestamp,\n 'updated_at' => $timestamp\n ];\n }", "public function toArray() : array\n {\n return $this->data;\n }", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray(): array\n {\n return [\n 'payment_id' => $this->paymentId,\n 'status' => $this->status,\n 'extended_id' => $this->extendedId,\n 'extended_status' => $this->extendedStatus,\n 'transaction_status' => $this->transactionStatus,\n 'datetime' => $this->datetime,\n 'duplicate' => $this->duplicate,\n 'additional' => $this->additional,\n ];\n }", "public function toArray(TreasurerNotifiable $notifiable): array\n {\n return [];\n }" ]
[ "0.7677204", "0.76518434", "0.75646985", "0.74612623", "0.7459539", "0.7345479", "0.7342245", "0.7282259", "0.7245607", "0.72256297", "0.7216595", "0.72066516", "0.71769404", "0.71495396", "0.70838886", "0.70831805", "0.70795065", "0.70272046", "0.70267415", "0.70224655", "0.70070404", "0.69880015", "0.6983619", "0.6975548", "0.6944984", "0.693628", "0.6905929", "0.6899071", "0.6856213", "0.6845579", "0.684398", "0.6807287", "0.6793018", "0.67925954", "0.67778915", "0.6768755", "0.67678255", "0.67655796", "0.6748562", "0.67278945", "0.67148834", "0.67138386", "0.6708069", "0.6707375", "0.6696044", "0.6691043", "0.6688572", "0.6666045", "0.66567415", "0.6641602", "0.6632222", "0.6631512", "0.6629299", "0.6621401", "0.6619388", "0.66142315", "0.6587994", "0.6587994", "0.6583879", "0.65833664", "0.6583261", "0.6571384", "0.6567923", "0.6567689", "0.65674806" ]
0.0
-1
Create a new query builder instance.
public function __construct($table = null) { if ($table) { $this->from($table); } $this->builder = new SQLBuilder(); $this->db = new \Database(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newQuery(): Builder\n {\n return new static($this->connection);\n }", "public static function create()\n {\n return new QueryConfigurationBuilder();\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->processor);\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->grammar, $this->processor);\n }", "public function createQueryBuilder ()\r\n {\r\n return new QueryBuilder($this);\r\n }", "private function createQueryBuilder(): QueryBuilder\n {\n $queryBuilder = new QueryBuilder();\n $queryBuilder->table(($this->model)::TABLE);\n $this->applyCriteria($queryBuilder);\n $this->applyQueryBuilderUses($queryBuilder);\n return $queryBuilder;\n }", "protected function createQueryBuilder()\n {\n $builder = new QueryBuilder();\n return $builder;\n }", "public function createQueryBuilder()\n {\n return new QueryBuilder($this->db);\n }", "public function newQueryBuilder()\n {\n return new Builder($this->config);\n }", "public function newQuery() {\n return new Builder($this->connection);\n }", "public static function query()\n {\n QueryBuilder::$dataSource = true;\n\n return new QueryBuilder();\n }", "public function createQueryBuilder()\n {\n return new Query\\QueryBuilder($this);\n }", "public function newQuery()\n {\n $datasource = $this->getDatasource();\n\n $query = new Builder($datasource, $datasource->getPostProcessor());\n\n return $query->setModel($this);\n }", "public function query()\n\t{\n\t\treturn new Builder(\n\t\t\t$this, $this->getQueryGrammar(), $this->getPostProcessor()\n\t\t);\n\t}", "public function queryBuilder();", "public function queryBuilder();", "public function newQuery()\n {\n $builder = new Builder($this->newBaseQueryBuilder());\n\n $builder->setModel($this);\n\n return $builder;\n }", "public function query()\n {\n return new \\Rubberband\\Elastic\\Laravel\\Query\\Builder($this);\n }", "public function query()\n {\n return new QueryBuilder(\n $this, $this->getQueryGrammar(), $this->getPostProcessor()\n );\n }", "public function query()\n {\n return new QueryBuilder(\n $this, $this->getQueryGrammar(), $this->getPostProcessor()\n );\n }", "public static function query()\n {\n // Create a new model instance for the query to ensure\n // that the model's initialize() method gets called.\n // Otherwise, the property definitions will be incomplete.\n $model = new static();\n\n return new Query($model);\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n $builder = in_array(self::class, config('autocache.models'))\n ? \\LaravelAutoCache\\Builder::class\n : \\Illuminate\\Database\\Query\\Builder::class;\n\n return new $builder($connection, $connection->getQueryGrammar(), $connection->getPostProcessor());\n }", "public function newQuery()\n {\n return new self($this->connection, $this->processor);\n }", "public function createQueryBuilder(): QueryBuilder\n {\n return new QueryBuilder($this->db, [\n 'separator' => \"\\n\"\n ]);\n }", "public function getQuery(): Builder;", "protected function query() {\n\t\treturn new Query($this);\n\t}", "protected function retrieveOrCreateQueryInstance()\n {\n return $this->queryBuilder ?? $this->queryBuilder = new $this->model();\n }", "public function getBuilder()\n {\n $builder = new Query\\Builder($this->getKeys());\n $builder->setVisitors([\n new Visitors\\EqVisitor($builder),\n new Visitors\\NotEqVisitor($builder),\n new Visitors\\GtVisitor($builder),\n new Visitors\\GteVisitor($builder),\n new Visitors\\LtVisitor($builder),\n new Visitors\\LteVisitor($builder),\n new Visitors\\CtVisitor($builder),\n new Visitors\\SwVisitor($builder),\n new Visitors\\EwVisitor($builder),\n new Visitors\\AndVisitor($builder),\n new Visitors\\OrVisitor($builder),\n new Visitors\\NotInVisitor($builder),\n new Visitors\\InVisitor($builder),\n new Visitors\\NullVisitor($builder),\n new Visitors\\NotNullVisitor($builder),\n ]);\n\n return $builder;\n }", "public static function query()\n {\n return (new static)->newQuery();\n }", "public static function query()\n {\n return (new static)->newQuery();\n }", "protected function query(): Builder\n {\n $query = $this->make()->newQuery();\n\n // Loads the active model if set, for use in getOne(), update(), delete(), etc.\n if ($this->activeModelInstance) {\n $query->where(\n $this->activeModelInstance->getKeyName(),\n $this->activeModelInstance->getKey()\n );\n }\n\n return $query;\n }", "public function newQuery()\n {\n $builder = $this->newAlfrescoBuilder($this->getConnection());\n $builder->setModel($this);\n return $builder;\n }", "public function query(): QueryBuilder;", "protected function newBaseQueryBuilder()\n {\n $conn = $this->getConnection();\n\n $grammar = $conn->getQueryGrammar();\n\n $builder = new Builder($conn, $grammar, $conn->getPostProcessor());\n\n if (isset($this->rememberFor)) {\n $builder->remember($this->rememberFor);\n }\n\n if (isset($this->rememberCacheTag)) {\n $builder->cacheTags($this->rememberCacheTag);\n }\n\n //if (isset($this->rememberCachePrefix)) {\n //ToDo: see if using server_hostname or whatever speeds this up\n $tenant = app(\\Hyn\\Tenancy\\Environment::class)->tenant();\n if(isset($tenant->id)){\n $set_tenant = $tenant->id;\n }else{\n $set_tenant = \"default\";\n }\n $builder->prefix($set_tenant);\n //}\n\n if (isset($this->rememberCacheDriver)) {\n $builder->cacheDriver($this->rememberCacheDriver);\n }\n\n return $builder;\n }", "public function newQuery()\n {\n return new self($this->connection, $this->grammar, $this->getProcessor());\n }", "protected function newBaseQueryBuilder()\n {\n $conn = $this->getConnection();\n\n $grammar = $conn->getQueryGrammar();\n\n return new QueryBuilder($conn, $grammar, $conn->getPostProcessor());\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder($connection, $connection->getPostProcessor());\n }", "protected function newBaseQueryBuilder() {\n\n\n\t\t\t$connection = $this->getConnection();\n\n\n\t\t\t// we resolve instance here using service container\n\t\t\treturn app(\\MehrIt\\LaraDbExt\\Query\\Builder::class, [\n\t\t\t\t'connection' => $connection,\n\t\t\t]);\n\t\t}", "public function queryBuilder()\n\t{\n\t\treturn \\ORM::for_table($this->table);\n\t}", "public static function createQuery()\n\t{\n\t\treturn new ActiveQuery(['modelClass' => get_called_class()]);\n\t}", "abstract protected function initQueryBuilder(): Builder;", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder(\n $connection,\n $connection->getQueryGrammar(),\n $connection->getPostProcessor()\n );\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder(\n $connection, $connection->getQueryGrammar(), $connection->getPostProcessor()\n );\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder(\n $connection, $connection->getQueryGrammar(), $connection->getPostProcessor()\n );\n }", "public function newEloquentBuilder($query)\n {\n return new QueryBuilder($query);\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery(): QueryInterface\n {\n /** @var QueryInterface $query */\n $query = $this->objectManager->get(QueryInterface::class);\n $query->setConfiguration($this->getConfiguration());\n\n return $query;\n }", "protected function newBaseQueryBuilder() {\n\n $connection = $this->getConnection();\n\n return new Builder(\n $connection, $connection->getQueryGrammar(), $connection->getPostProcessor()\n );\n }", "public function newEloquentBuilder($query);", "public function init(Builder $queryBuilder);", "public function newQueryWithoutScopes(): Builder\n {\n return $this->newModelQuery();\n }", "protected function createQuery()\n {\n return \\PropelQuery::from($this->class);\n }", "public function createQuery() {\n\t\treturn $this->queryFactory->create($this->objectType);\n\t}", "public function createQuery()\n {\n $query = &atknew(\"atk.db.atk{$this->m_current_clusternode->m_type}query\");\n $query->m_db = $this;\n return $query;\n }", "public function query(): AppointmentQueryBuilder\n {\n return new AppointmentQueryBuilder($this->client);\n }", "public function query()\n {\n return new SingleStoreBuilder($this);\n }", "public function newQueryWithoutScopes()\n {\n $builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());\n\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n\n return $builder->setModel($this)\n //->setfillableColumns($this->fillable)\n ->with($this->with)\n ->withCount($this->withCount);\n }", "public function build()\n {\n $query = $this->qb;\n if ($this->getWhereExpression()) {\n $query->where($this->getWhereExpression());\n }\n foreach ($this->getWhereParameters() as $key => $param) {\n $query->setParameter($key, $param, is_array($param) ? Connection::PARAM_STR_ARRAY : null);\n }\n\n return $query;\n }", "public function newQueryWithoutScopes()\n {\n $builder = $this->newBuilder();\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n return $builder->setModel($this);\n }", "public function getQueryInstance()\n {\n return $this->queryBuilder;\n }", "public function createQuery() {\n\t\treturn $this->luceneQueryFactory->create($this);\n\t}", "public function build()\n {\n return new QueryConfiguration(\n $this->drawCall,\n $this->start,\n $this->length,\n $this->searchValue,\n $this->searchRegex,\n $this->columSearches,\n $this->columnOrders\n );\n }", "public function newEloquentBuilder($query)\n {\n return new Builder($query);\n }", "public function newEloquentBuilder($query)\n {\n return new Builder($query);\n }", "public function newEloquentBuilder($query)\n {\n return new Builder($query);\n }", "public function newEloquentBuilder($query)\n {\n return new Builder($query);\n }", "public function newEloquentBuilder($query)\n {\n return new Builder($query);\n }", "protected function newBaseQueryBuilder()\n {\n return $this->getConnection()->query();\n }", "protected function newBuilder(): Builder\n {\n return $this->builder = $this->game_play->newQuery();\n }", "public function createQuery()\n {\n $query = $this->persistenceManager->createQueryForType($this->objectType);\n if ($this->defaultOrderings !== []) {\n $query->setOrderings($this->defaultOrderings);\n }\n if ($this->defaultQuerySettings !== null) {\n $query->setQuerySettings(clone $this->defaultQuerySettings);\n }\n return $query;\n }", "public function query(): Query\n {\n return new Query($this->getWebservice(), $this);\n }", "public function getQuery() : QueryBuilder\n {\n return $this->query;\n }", "public function getQueryBuilder();", "public function getQueryBuilder();", "public function getBuiltQb()\n {\n $qb = clone $this->qb;\n\n $this->setSelectFrom($qb);\n $this->setJoins($qb);\n $this->setWhere($qb);\n $this->setOrderBy($qb);\n $this->setLimit($qb);\n\n return $qb;\n }", "public function newQuery();", "public function newEloquentBuilder($query) {\n\n\t\t\t// we resolve instance here using service container\n\t\t\t$ret = app(\\MehrIt\\LaraDbExt\\Eloquent\\Builder::class, [\n\t\t\t\t'query' => $query,\n\t\t\t]);\n\n\n\t\t\treturn $ret;\n\t\t}", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return $connection->query();\n }", "public function getQueryBuilder(): SQLQueryBuilder;", "public function createQuery(): QueryInterface;", "public function getCollectionQuery(): Builder;", "public function newQuery($excludeDeleted = true)\n {\n $builder = new EloquentQueryBuilder($this->newBaseQueryBuilder());\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n $builder->setModel($this)->with($this->with);\n\n if ($excludeDeleted and $this->softDelete) {\n $builder->whereNull($this->getQualifiedDeletedAtColumn());\n }\n\n return $builder;\n }", "public function query()\n {\n if ($model = $this->model) {\n return new $model();\n }\n }", "public function getQueryBuilder(){\n return $this->getDatabaseConnection()->createQueryBuilder();\n }", "public function newModelQuery();", "public function newQuery()\n {\n return $this->registerGlobalScopes($this->newQueryWithoutScopes());\n }", "public function builder()\n {\n return new Builder($this);\n }", "protected function createBuilder()\n\t{\n\t\treturn new Db_CompiledBuilder($this);\n\t}", "public function newEloquentBuilder($query)\n {\n return new DocumentQueryBuilder($query, $this->section);\n }", "public function getQuery(Builder $query);", "public function createQuery()\n {\n $query = parent::createQuery();\n $query->getQuerySettings()->setRespectStoragePage(false);\n return $query;\n }", "private function getInitialisedQueryBuilder()\n\t{\n\t\t$qb = $this->em->createQueryBuilder()\n\t\t\t->add(\"select\", \"r\")\n\t\t\t->add(\"from\", \"RecruiterRecruitBundle:Recruit r\")\n\t\t;\n\t\t\n\t\treturn $qb;\n\t}", "public static function getQueryBuilder()\n {\n return self::getLink()->createQueryBuilder();\n }", "public function newQuery($query = null)\n {\n if ($query === null) {\n $query = app()->make($this->modelClass)->newQuery();\n }\n\n if ($this->trashed === 'only') {\n $query->onlyTrashed();\n } elseif ($this->trashed === 'with') {\n $query->withTrashed();\n }\n\n if (!empty($this->with)) {\n $query->with($this->with);\n }\n\n if (!empty($this->select)) {\n $query->select($this->select);\n }\n\n return $query;\n }", "public static function NewQuery()\r\n\t{\r\n\t\treturn new QSqlQuery();\r\n\t}", "public function createBuilder();", "public function build()\n {\n if (empty($this->tables)) {\n throw new \\InvalidArgumentException('Please define your tables first using the tables() method');\n }\n\n if (empty($this->fields)) {\n throw new \\InvalidArgumentException('Please define your fields first using the fields() method');\n }\n\n $tables = $this->getTableCollection();\n $usedTables = new TableCollection();\n\n $fields = $this->getFieldCollection();\n $columns = $this->columns ? $this->columns : array('*');\n\n $this->criteria->build(\n $this->builder,\n $tables,\n $usedTables,\n $fields,\n $columns\n );\n\n return $this->builder;\n }", "public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }" ]
[ "0.8458836", "0.8247104", "0.82323474", "0.8201294", "0.8176239", "0.81556374", "0.8132826", "0.80964625", "0.8039534", "0.8022068", "0.80059546", "0.7956663", "0.7874544", "0.7856333", "0.78316677", "0.78316677", "0.7796317", "0.7772089", "0.7768361", "0.7768361", "0.7620952", "0.7554964", "0.7522503", "0.7507752", "0.7497872", "0.7473905", "0.7416558", "0.74158394", "0.74140686", "0.74140686", "0.74113005", "0.73815", "0.7379361", "0.7376921", "0.7366529", "0.7355696", "0.73372835", "0.73228896", "0.73055464", "0.7270823", "0.7244208", "0.7231555", "0.7225599", "0.7225599", "0.719689", "0.7172075", "0.7172075", "0.7172075", "0.7171279", "0.7135836", "0.70780504", "0.7072582", "0.70613277", "0.70558554", "0.7017391", "0.6989948", "0.69685525", "0.6966544", "0.69616675", "0.6957012", "0.6905812", "0.6888898", "0.6883559", "0.68821746", "0.68791646", "0.6865861", "0.6865861", "0.6865861", "0.6865861", "0.6865861", "0.6861118", "0.6860852", "0.68588495", "0.68545085", "0.6853374", "0.6832375", "0.6832375", "0.6830346", "0.6824697", "0.6815816", "0.6784312", "0.67516756", "0.6709086", "0.669384", "0.66782147", "0.66758966", "0.665481", "0.66242", "0.65970886", "0.65927124", "0.65737724", "0.65579796", "0.65333587", "0.6531792", "0.652502", "0.6518319", "0.6512087", "0.6510302", "0.6509371", "0.649868", "0.6494227" ]
0.0
-1
Set the columns to be selected
public function select($columns = array('*')) { $this->columns = array_values_recursive(func_get_args()); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setColumns($columns = \"*\")\n {\n //$sql = '';\n if ($columns == \"*\") {\n $this->select_list = '*';\n } elseif (!empty($columns)) {\n foreach ($columns as $item) {\n\n $this->select_list .= $item . ',';\n }\n $this->select_list = rtrim($this->select_list, ',');\n }\n// echo \"column set to \".$this->getColumns(); die;\n\n }", "private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n foreach ($this->_query->getFields() as $field) {\n $this->columns->add($field, null, $field);\n }\n }", "public function select($columns);", "public function setColumns($columns)\n {\n parent::setColumns($columns);\n\n if (is_array($this->selectColumns)) {\n $this->selectColumns = array_unique(array_merge($this->selectColumns, $this->keys));\n }\n\n return $this;\n }", "public function select(array $columns)\n {\n $this->select = $columns;\n }", "public function select($columns = array('*'));", "public function setColumns(array $columns);", "public function select($cols = null);", "public function get_selectable_columns()\n\t{\n\t\treturn array();\n\t}", "public function set_columns($cols) { $this->cols = $cols + 0; }", "public function setColumns(array $columns);", "public function setColumns()\r\n\t{\r\n\t\t$columns = array_filter($this->getRules(), function($rule) {\r\n\t\t\tif($rule instanceof ColumnInterface) {\r\n\t\t\t\treturn $rule;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$columns = array_map(function(ColumnInterface $rule) {\r\n\t\t\treturn $rule->getTitle();\r\n\t\t}, $columns);\r\n\r\n\t\t$this->columns = $columns;\r\n\t}", "private function toggle_master_view_select_columns(){\n\n // Check if the table has list_table_visible_columns not empty\n $master_table_visible_columns = $this->feature_model_master_table_visible_columns();\n $lookup_tables = $this->CI->grants->lookup_tables();\n\n $get_all_table_fields = $this->CI->grants_model->get_all_table_fields();\n\n\n foreach ($get_all_table_fields as $get_all_table_field) {\n //Unset foreign keys columns\n if( substr($get_all_table_field,0,3) == 'fk_'){\n unset($get_all_table_fields[array_search($get_all_table_field,$get_all_table_fields)]);\n }\n }\n\n $visible_columns = $get_all_table_fields;\n $lookup_columns = array();\n\n if(is_array($master_table_visible_columns) && count($master_table_visible_columns) > 0 ){\n $visible_columns = $master_table_visible_columns;\n\n if(is_array($lookup_tables) && count($lookup_tables) > 0 ){\n foreach ($lookup_tables as $lookup_table) {\n \n // Add primary_keys for the lookup tables in the visible columns array\n $lookup_table_fields_data = $this->CI->grants_model->table_fields_metadata($lookup_table);\n \n foreach($lookup_table_fields_data as $field_data){\n if($field_data->primary_key == 1){\n array_push($visible_columns,$field_data->name);\n }\n }\n\n //$visible_columns = $this->CI->grants->default_unset_columns($visible_columns,array($lookup_table.'_id'));\n }\n } \n\n }elseif(is_array($lookup_tables) && count($lookup_tables) > 0 ){\n $visible_columns = $this->add_lookup_name_fields_to_visible_columns($visible_columns, $lookup_tables);\n }\n\n //$default_unset_columns = $this->CI->grants->default_unset_columns($visible_columns,array($this->CI->controller.'_deleted_at'));\n\n // Add created_by and last_modified_by fields if not exists in columns selected\n $history_tracking_fields = $this->insert_history_tracking_fields_to_master_view($visible_columns);\n\n //Check if controller is not approval and find if status field is present and \n //it has status in the lookup table\n $status_column = $this->insert_status_column_to_master_view($history_tracking_fields);\n \n // Unset deleted at field\n $unset_fields = [$this->CI->grants->history_tracking_field($this->controller,'deleted_at')];\n $this->CI->grants->default_unset_columns($status_column,$unset_fields);\n\n //Remove the primary key field from the master table\n unset($status_column[array_search($this->CI->grants->primary_key_field($this->CI->controller),$status_column)]);\n \n\n return $this->access->control_column_visibility($this->controller,$status_column,'read');\n\n }", "public function select($columns){\n \n $this->columns = [];\n $columns = is_array($columns) ? $columns : func_get_args();\n\n foreach ($columns as $as => $column) {\n\n $this->columns[] = $column;\n\n }\n\n return $this;\n }", "public function getSelectColumns(): array\n {\n return [\n 'question_id',\n 'slug',\n 'user_id',\n 'subject',\n 'headline',\n 'message',\n 'views',\n 'views_not_bot_one_month',\n 'answer_count_cached',\n 'created_datetime',\n 'created_name',\n 'created_ip',\n 'modified_user_id',\n 'modified_datetime',\n 'modified_reason',\n 'moved_datetime',\n 'moved_user_id',\n 'moved_country',\n 'moved_language',\n 'moved_question_id',\n 'deleted_datetime',\n 'deleted_user_id',\n 'deleted_reason',\n ];\n }", "public function selectColumns()\n {\n $this->select(\n [\n ConfigService::$tableComments . '.id as id',\n ConfigService::$tableComments . '.content_id as content_id',\n ConfigService::$tableComments . '.comment as comment',\n ConfigService::$tableComments . '.parent_id as parent_id',\n ConfigService::$tableComments . '.user_id as user_id',\n ConfigService::$tableComments . '.temporary_display_name as display_name',\n ConfigService::$tableComments . '.created_on as created_on',\n ConfigService::$tableComments . '.deleted_at as deleted_at'\n ]\n );\n\n return $this;\n }", "public function select(...$columns)\n {\n // code...\n $this->__COLUMNS__ = array_unique(array_merge($this->__COLUMNS__ ?? [], $this->flatten($columns)));\n\n return $this;\n }", "public function set(array $cols) : void;", "public function setColumns($columns) {\n\t\t$this->columns = $columns;\n\t}", "public function select(array $columns)\r\n\t{\r\n\t\t$this->select = $columns;\r\n\t\treturn $this;\r\n\t}", "public function setCols($cols) {\n $this->cols = $cols;\n }", "public function getColumns()\n {\n return $this->select_list;\n }", "public function setColumns($columns)\n {\n $this->columns = $columns;\n }", "protected function loadColumns(){\n\t\t\t$this->columns = array_diff(\n\t\t\t\tarray_keys(get_class_vars($this->class)),\n\t\t\t\t$this->getIgnoreAttributes()\n\t\t\t);\n\t\t}", "public function setSearchColumns(array $columns);", "public function previewColumns();", "abstract protected function columns();", "public static function setColumns($columns) {\n\t\tself::$columns = $columns;\n\t}", "public function select($columns)\n\t{\n\t\tif (is_array($columns)) {\n\t\t\t$this->_select = array_unique(array_merge($this->_select, $columns));\n\t\t}\n\t\telse {\n\t\t\t$this->_select = array_unique(array_merge($this->_select, array($columns)));\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function _configureColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n $this->_sourceColumns = $this->columns;;\n\n $columnsByKey = [];\n foreach ($this->columns as $column) {\n $columnKey = $this->_getColumnKey($column);\n for ($j = 0; true; $j++) {\n $suffix = ($j) ? '_' . $j : '';\n $columnKey .= $suffix;\n if (!array_key_exists($columnKey, $columnsByKey)) {\n break;\n }\n }\n $columnsByKey[$columnKey] = $column;\n }\n\n $this->columns = $columnsByKey;\n }", "public function setCols( $criteria )\n {\n\n $cols = array\n (\n 'project_task.rowid as project_task_rowid',\n 'project_task.title as project_task_title',\n 'project_task.id_type as id_type_id_type',\n 'project_task_type.name as project_task_type_name',\n 'project_task.id_status as id_status_id_status',\n 'project_task_status.name as project_task_status_name',\n 'project_task_employee.date_start as project_task_employee_date_start',\n 'project_task_employee.date_end as project_task_employee_date_end',\n );\n\n $criteria->select($cols);\n\n }", "public function selectColsArrayAction()\n {\n $view = new ViewModel();\n $sl = $this->getServiceLocator();\n $adapter = $sl->get('dbadapter');\n $tableGateway = new TableGateway('categoria', $adapter);\n $view->data = $tableGateway->select(function (Select $select){\n $select->columns(array('nombre','activo'));\n })->toArray();\n return $view;\n }", "public function select($columns = ['*'])\n {\n $this->columns = is_array($columns) ? $columns : func_get_args();\n return $this;\n\n }", "public function columns($columns = array('*'))\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function select($columns)\n {\n return $this->columns($columns);\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "private function setColumns(array $columns)\n {\n $this->columns = $columns;\n }", "public function columns(/* ... */)\n\t{\n\t\t$args = func_get_args();\n\t\tforeach ($args as $name)\n\t\t{\n\t\t\t$this->setColumnData($name,\n\t\t\t\tContainer::keyValue($this->columnValues, $name, null),\n\t\t\t\tfalse);\n\t\t}\n\t\treturn $this;\n\t}", "function select($columns)\n{\n\t$this->tryModify();\n\t$this->query['select'] = is_array($columns)? $columns : explode(',', $columns);\n\t$this->execute();\n\t$rows = $this->db->fetchAll($this->result);\n\t$this->close();\n\t$this->query['select'] = array('*');\n\treturn $rows;\n}", "public function select($columns = '*', $option = '')\n\t{\n\t\t$this->query->select = $columns;\n\t\t$this->query->selectOption = $option;\n\t\treturn $this;\n\t}", "public function addSelect($column);", "public function select_only($columns)\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function select($columns = '*'): self\n {\n if (is_array($columns)) {\n $columns = commas($columns);\n }\n\n $this->columns = $columns;\n\n return $this;\n }", "protected function _doColumns()\n {\n global $prefs;\n\n // Turba's columns pref\n $abooks = explode(\"\\n\", $prefs->getValue('columns'));\n if (is_array($abooks) && !empty($abooks[0])) {\n $new_prefs = array();\n $cnt = count($abooks);\n for ($i = 0; $i < $cnt; ++$i) {\n $colpref = explode(\"\\t\", $abooks[$i]);\n $colpref[0] = $this->_updateShareName($colpref[0]);\n $abooks[$i] = implode(\"\\t\", $colpref);\n }\n $prefs->setValue('columns', implode(\"\\n\", $abooks));\n }\n }", "public function selectAll() {\n\t\treturn $this->select(array_keys($this->table->columns));\n\t}", "public function setColumns($data)\n {\n $this->data['columns'] = $data;\n return $this;\n }", "public function setSelectFields()\r\n\t{\r\n\t\t$fields = func_get_args();\r\n\t\tif (empty($fields))\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Select fields list is not an array or empty.');\r\n\t\t}\r\n\t\r\n\t\t// Check if fields exist in fields collection\r\n\t\tforeach($fields as &$item)\r\n\t\t{\r\n\t\t\t$found = false;\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\tif ($item == $field->name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif (!$found)\r\n\t\t\t{\r\n\t\t\t\tthrow new \\Exception('There is no field \"' . $item . '\" in table ' . $this->name . '.');\r\n\t\t\t}\r\n\t\r\n\t\t\t// Add to list\r\n\t\t\tif ($this->hasForeignFields())\r\n\t\t\t{\r\n\t\t\t\t$item = 't1.`' . $item . '`';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$item = '`' . $this->name . '`.`' . $item . '`';\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t$this->selectFields = $fields;\r\n\t}", "public function select($columns) {\n\t\t$clone = clone $this;\n\t\t\n\t\tif (!is_array($columns))\n\t\t\t$columns = func_get_args();\n\t\tif (!is_array($this->select))\n\t\t\t$clone->select = array();\n\t\t\n\t\tforeach ($columns as $column) {\n\t\t\tif (!isset($clone->select[$column])) {\n\t\t\t\t$clone->formatColumnSimple($column); // check if column exists\n\t\t\t\t$clone->select[$column] = true;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$clone->sql = null;\n\t\treturn $clone;\n\t}", "public function SetViewColumns($arrCols) {\n if(!$this->blnGoodToGo()) return;\n if(!is_array($arrCols)) {\n $this->XaoThrow(\n \"_EntBase->SetViewColumns(): This method expects an array\" .\n \" of strings representing column names to SELECT on. The\" .\n \" supplied argument was not an array.\"\n );\n return;\n }\n $this->_arrViewColumns = $arrCols;\n }", "protected function initColumns()\n\t{\n\t\tif($this->columns===array())\n\t\t{\n\t\t\tif($this->dataProvider instanceof NActiveDataProvider)\n\t\t\t\t$this->columns=$this->dataProvider->model->attributeNames();\n\t\t\telse if($this->dataProvider instanceof IDataProvider)\n\t\t\t{\n\t\t\t\t// use the keys of the first row of data as the default columns\n\t\t\t\t$data=$this->dataProvider->getData();\n\t\t\t\tif(isset($data[0]) && is_array($data[0]))\n\t\t\t\t\t$this->columns=array_keys($data[0]);\n\t\t\t}\n\t\t}\n\t\t$id=$this->getId();\n\t\tforeach($this->columns as $i=>$column)\n\t\t{\n\t\t\tif ($column['name'] && (!isset($column['export']) || @$column['export']!=false)) {\n\t\t\t\tif(is_string($column))\n\t\t\t\t\t$column=$this->createDataColumn($column);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!isset($column['class']))\n\t\t\t\t\t\t$column['class']='NDataColumn';\n\t\t\t\t\t$column=Yii::createComponent($column, $this);\n\t\t\t\t}\n\t\t\t\tif(!$column->visible)\n\t\t\t\t{\n\t\t\t\t\tunset($this->columns[$i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif($column->id===null)\n\t\t\t\t\t$column->id=$id.'_c'.$i;\n\t\t\t\t$this->columns[$i]=$column;\n\t\t\t} else {\n\t\t\t\tunset($this->columns[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tforeach($this->columns as $column)\n\t\t\t\t$column->init();\n\t}", "abstract protected function doCols();", "public function selectFields($select='*')\n\t\t{\n\t\t\t$this->reload();\n\t\t\t$this->select = $select;\n\t\t}", "public function columns(array $columns, $merge = false){\n if(!$merge){\n $this->_select = array_merge($this->_select, $columns);\n }else{\n $this->_select = $columns;\n }\n\n return $this;\n }", "protected function _prepareColumns()\n {\n \t// Checkbox\n \t$checkboxColumnBody = new Lumia_DataGrid_Body_Checkbox('student_id[]');\n \t$checkboxColumnHeader = new Lumia_DataGrid_Header_Checkbox();\n $this->addColumn(new Lumia_DataGrid_Column($checkboxColumnBody, $checkboxColumnHeader));\n \n // Name\n $nameColumnBody = new Lumia_DataGrid_Body_Text('student_name');\n $nameColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Name');\n $this->addColumn(new Lumia_DataGrid_Column($nameColumnBody, $nameColumnHeader));\n \n // Code\n $codeColumnBody = new Lumia_DataGrid_Body_Text('student_code');\n $codeColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Code');\n $this->addColumn(new Lumia_DataGrid_Column($codeColumnBody, $codeColumnHeader));\n \n // Date of birth\n $dateColumnBody = new Lumia_DataGrid_Body_Date('student_birth');\n $dateColumnBody->setOptions(array('dateFormat' => 'dd/MM/yyyy'));\n $dateColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Date of birth');\n $this->addColumn(new Lumia_DataGrid_Column($dateColumnBody, $dateColumnHeader));\n \n // Gender\n $genderColumnBody = new Admin_DataGrid_Student_Body_Gender('student_gender');\n $genderColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Gender');\n $this->addColumn(new Lumia_DataGrid_Column($genderColumnBody, $genderColumnHeader));\n \n // Class\n $classColumnBody = new Lumia_DataGrid_Body_Text('class_department');\n $classColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Class/Department');\n $this->addColumn(new Lumia_DataGrid_Column($classColumnBody, $classColumnHeader));\n \n // Status\n $statusColumnBody = new Admin_DataGrid_Student_Body_Status('user_status');\n $statusColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Status');\n $this->addColumn(new Lumia_DataGrid_Column($statusColumnBody, $statusColumnHeader));\n \n // Action\n $actionColumnBody = new Admin_DataGrid_Student_Body_Action('actionColumn');\n $actionColumnHeader = new Lumia_DataGrid_Header_Text();\n $this->addColumn(new Lumia_DataGrid_Column($actionColumnBody, $actionColumnHeader));\n }", "public function setHiddenCols($cols){\n\t\t$this->hiddenCols=explode(\",\",$cols);\n\t}", "public function setDefaultColumns()\n {\n foreach ($this->Model->columnsInformation as $column) {\n // Set indexes\n if ($column['Key'] == \"PRI\") {\n $this->indexes[] = $this->table . \".\" . $column['Field'];\n }\n // Set columns\n $this->columns[] = $this->table . \".\" . $column['Field'];\n }\n // Set default columns\n $this->defaultColumns = $this->columns;\n // Add actions column\n $this->addCustomColumn($this->builtInCustomColumns['actions']);\n // Add no column\n $this->addCustomColumnAsFirstColumn($this->builtInCustomColumns['no']);\n }", "public function columns($columns = '*'): self\n {\n return $this->select($columns);\n }", "public function setColumnsHeadData()\n\t{\n\t\tFileStorage::getInstance()->store([], 'league_table_columns_head');\n\t}", "protected function configureTableSelection()\n {\n return [ 'Table1', 'Table2', '...' ];\n }", "public function admin_table_columns($_columns)\n {\n }", "public function setSelect($columns, $table, $where = false, $order = false, $limit = false)\n {\n $action = $this->setAction(\"SELECT\");\n $table = $this->setTable($table);\n $columns = $this->setColumns($columns);\n $where = ($where !== false)?$this->setWhere($where):true;\n $order = ($order !== false)?$this->setOrder($order):true;\n $limit = ($limit !== false)?$this->setLimit($limit):true;\n\n return $action && $table && $columns && $where && $order && $limit;\n }", "public static function columns()\n {\n return filterColumnByRole([\n 'plot_ref' => trans('system.code'),\n 'plot_name' => trans_title('plots'),\n 'user.name' => trans_title('users'),\n 'city.city_name' => trans_title('cities'),\n 'plot_percent_cultivated_land' => sections('plots.cultivated_land'),\n 'plot_real_area' => sections('plots.real_area'),\n 'plot_start_date' => sections('plots.start_date'),\n 'plot_active' => trans('persona.contact.active'),\n 'plot_green_cover' => sections('plots.green_cover'),\n 'plot_pond' => sections('plots.pond'),\n 'plot_road' => sections('plots.road'),\n ],\n $roleFilter = Credentials::isAdmin(),\n $newColumns = ['client.client_name' => trans_title('clients')],//Admits multiple arrays\n $addInPosition = 3\n );\n }", "public function select(string ...$columns)\n {\n $this->select = $columns;\n\n return $this;\n }", "public function select($tables, array $columns, array $conditions = [], array $options = []): array;", "public function saveCustomColumns() {\n // get existing config\n $selectedColumns = $this->loadCustomColumns();\n\n // merge new selection for page type into existing variable\n $ctID = $this->post('ctID');\n $selectedColumns[$ctID] = $_REQUEST['selectedAttributes'];\n\n // save new configuration\n $pkg = Package::getByHandle('remo_composer_list');\n $pkg->saveConfig('SELECTED_COLUMNS', serialize($selectedColumns));\n\n die();\n }", "public function select($columns, ...$params): Selection\n {\n $this->selection->select($columns, ...$params);\n return $this;\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n $this->allColumns[$i] = $column;\n continue;\n }\n $this->columns[$i] = $column;\n $this->allColumns[$i] = $column;\n }\n }", "public function setColumns($settings = array())\n {\n if (!$settings) {\n $settings = $this->fields;\n }\n $this->Columns = array();\n foreach ($settings as $column => $options) {\n if (!is_string($column)) {\n $column = $options;\n $options = false;\n }\n if (!isset($options['display'])) {\n $options['display'] = true;\n }\n if (strpos($column, '.') === false && $column != 'actions') {\n $column = sprintf('%s.%s', $this->defaultModel, $column);\n }\n if (!isset($options['type'])) {\n if (isset($options['switch'])) {\n $options['type'] = 'switch';\n } else {\n $options['type'] = 'cell';\n }\n }\n $class = ucfirst($options['type']).'Column';\n $this->Columns[$column] = new $class($this, $column, $options);\n }\n }", "function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }", "public static function getSelectColumns(){\n\t\t$columns = '';\n\t\t/* getSelectColumns */\n\t\t$columns .= ' `'.UserSetting::FIELD_USER.'`';\n\t\t$columns .= ', `'.UserSetting::FIELD_IDENT.'`';\n\t\t$columns .= ', `'.UserSetting::FIELD_VALUE.'`';\n\t\t/* getSelectColumns end */\n\t\treturn $columns;\n\t}", "public function setSelect(array $orderBy){\n $this->select = $orderBy;\n }", "public function select(array $columns = array(), $prefix = null);", "public function setColumns($arrColumns)\n\t{\n\t\t// Make sure it's an array and there's something in it\n\t\tif (!(is_array($arrColumns) && count($arrColumns)))\n\t\t{\n\t\t\tthrow new Exception(\"Invalid columns declaration\");\n\t\t}\n\t\t\n\t\t$this->_arrSelectedColumns = array();\n\t\tforeach ($arrColumns as $column)\n\t\t{\n\t\t\tif (!array_key_exists($column, $this->_arrColumns))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Invalid column, '$column', for \". self::$_arrReportTypes[$this->_reportType]['Name']);\n\t\t\t}\n\t\t\t$this->_arrSelectedColumns[] = $column;\n\t\t}\n\t}", "private function prepareColumns()\n {\n // start with the tableName and the primary key e.g. 'fos_user' and 'id'\n $this->addSelectColumn($this->metadata, $this->rootEntityIdentifier);\n\n foreach ($this->datatable->getColumns() as $column) {\n // association delimiter found (e.g. 'posts.comments.title')?\n if (strstr($column->getProperty(), '.') !== false) {\n $array = explode('.', $column->getProperty());\n $this->setAssociations($array, $this->metadata);\n } else {\n // no association found\n if ($column !== $this->rootEntityIdentifier) {\n $this->addSelectColumn($this->metadata, $column->getProperty());\n }\n\n $this->allColumns[] = $this->metadata->getTableName().'.'.$column->getProperty();\n }\n }\n\n return $this;\n }", "public function set_cols($cols)\n {\n $this->m_numCols = $cols;\n }", "public function languageSelectColumns($value)\n {\n $this->attributes['language']['select']['columns'] = $value;\n\n return $this;\n }", "private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }", "public function wp_nav_menu_manage_columns()\n {\n }", "protected function setDbColumns()\n {\n $connection = $this->model()->eloquent()->getConnectionName();\n\n $this->dbColumns = collect(Schema::connection($connection)->getColumnListing($this->model()->getTable()));\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n continue;\n }\n $this->columns[$i] = $column;\n }\n }", "abstract public function tableColumns();", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "public function set_columns( $columns ) {\n\n\t\t$date_column = $columns['date'];\n\t\t$author_column = $columns['author'];\n\n\t\tunset( $columns['date'] );\n\t\tunset( $columns['author'] );\n\n\t\t$columns['type'] = esc_html__( 'Type', 'elementskit' );\n\t\t$columns['condition'] = esc_html__( 'Conditions', 'elementskit' );\n\t\t$columns['date'] = $date_column;\n\t\t$columns['author'] = $author_column;\n\n\t\treturn $columns;\n\t}", "public function all($cols = ['*']);", "private function resetQuery()\n {\n $this->cols('*');\n }", "abstract public function listColumns();", "public function listRegisterCols(){\n\t\t$this->registerCol('name_hld', self::COL_ANCHO_DETALLE);\n\t}", "public function selectFields($selectFields)\n\t{\n\t\t$this->select = $selectFields ? $selectFields : '*';\n\t}", "public function set_custom_column( $columns )\n {\n /* We are going to rearrange the information */\n $title = $columns['title'];\n $date = $columns['date'];\n unset ( $columns['title'] , $columns['date'] );\n\n $columns['name'] = 'Author Name';\n $columns['title'] = $title;\n $columns['approved'] = 'Approved';\n $columns['featured'] = 'Featured';\n $columns['date'] = $date;\n return ( $columns );\n }", "protected function getSelectColumns()\n {\n $select = [];\n\n foreach ($this->config as $key => $columns) {\n if (substr($key, -6) !== 'Column') continue;\n if (trim($columns) === '') continue;\n $field = substr($key, 0, -6);\n\n $columns = explode(',', $columns);\n $columns = array_map('trim', $columns);\n foreach ($columns as $col) {\n if (!isset($select[$col])) $select[$col] = [];\n $select[$col][] = $field;\n }\n }\n\n return $select;\n }", "public function setSelect($fields)\n {\n $this->select = [];\n if (func_num_args() > 1) {\n $fields = func_get_args();\n } elseif (!is_array($fields)) {\n $fields = [$fields];\n }\n return $this->addSelect($fields);\n }", "public function add_select($columns)\r\n {\r\n if ($this->columns) {\r\n array_add($this->columns, $columns);\r\n } else {\r\n $this->select($columns);\r\n }\r\n\r\n return $this;\r\n }", "public function addColumns()\n {\n add_filter( 'manage_edit-' . $this->post_type . '_columns', array($this, 'editColumns') ) ; // Add or Remove a Column\n add_action( 'manage_' . $this->post_type . '_posts_custom_column', array($this, 'manageColumns') ); //Show and Modify Column Data\n add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortableColumns') ); // Flags sortable Columns\n add_action( 'load-edit.php', array($this, 'loadSortColumns') );\n }", "public function columns($columns)\n\t{\n\t\t$this->columns = $columns;\n\n\t\treturn $this;\n\t}", "public function addSelect(string ...$columns)\n {\n $this->select = array_merge($this->select, $columns);\n\n return $this;\n }" ]
[ "0.692604", "0.69106275", "0.67120034", "0.6686156", "0.66677535", "0.6662436", "0.6540613", "0.65026516", "0.6501031", "0.64503896", "0.6447919", "0.64392364", "0.6344181", "0.6327592", "0.62401944", "0.62360525", "0.6193538", "0.6185772", "0.61580664", "0.608876", "0.6078296", "0.6062357", "0.60534775", "0.6038454", "0.60078865", "0.6002691", "0.6001282", "0.5962054", "0.5954485", "0.59500843", "0.5917618", "0.5915892", "0.5915374", "0.59115463", "0.5905441", "0.5884739", "0.5884739", "0.5884739", "0.5884739", "0.5884017", "0.5884017", "0.58726776", "0.58642346", "0.585521", "0.5839016", "0.58236176", "0.58212644", "0.5814448", "0.58048886", "0.58036876", "0.5802358", "0.5799675", "0.5796597", "0.5793474", "0.57866484", "0.5770971", "0.57704663", "0.57670057", "0.5765517", "0.5764949", "0.5750891", "0.57495683", "0.5743812", "0.5710466", "0.5700419", "0.5677136", "0.5676612", "0.5668901", "0.56638014", "0.5658141", "0.56494945", "0.56483376", "0.5643718", "0.5639462", "0.5630725", "0.56214833", "0.56143373", "0.5613051", "0.5605937", "0.56032366", "0.55965525", "0.55898523", "0.5577377", "0.5566484", "0.55531514", "0.5550966", "0.5549724", "0.554773", "0.5541251", "0.5534389", "0.55327123", "0.55306333", "0.5499562", "0.549947", "0.549754", "0.54910266", "0.54637", "0.54589534", "0.5452506", "0.5450218" ]
0.60937864
19
Set table on which the query will be executed
public function from($table) { $this->from = $table; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTable($table);", "private function setTable()\n {\n if (is_null($this->table)) {\n $this->table = $this->getTableName();\n }\n }", "public function setTable(string $table);", "function setTable($table) {\r\r\n\t\t$this->table = $table;\r\r\n\t}", "protected function setTable() : void {\n\t\t$annotation = $this->annotationReader->getClassAnnotation($this->reflectionClass, 'Henri\\Framework\\Annotations\\Annotation\\DB');\n\t\tif ($annotation && isset($annotation->table)) {\n\t\t\t$this->tableName = $annotation->table;\n\t\t\t$this->tableNamePrefixed = $this->database->getPrefix() . $this->tableName;\n\t\t}\n\t}", "public function setTable($table)\n\t{\n\t\t$this->table = $table;\n\t}", "public function setTable( $table ) {\n\t\t$this->_table = $table;\n\t}", "abstract public function setTableName();", "protected function setTable()\n {\n $class = explode('\\\\', get_called_class());\n $this->table = lcfirst(end($class)).'s';\n }", "public function set_table($table_name = '') {\n $this->table = $table_name;\n }", "public function set_table($table = NULL)\n\t{\n\t\t$this->_table = $table;\n\t}", "protected function _setTable($table)\n\t{\n\t\t$this->_table = $table;\n\t}", "public static function table($table)\n {\n }", "public function setTable($table)\n\t{\n\t\tdebugInfo(get_class($this).\"->setTable($table)\");\n\n\t\t$this->_table = $table;\n\t}", "function set_table(){\n $this->table = 'network_posts';\n }", "public function table($table){\n $this->from($table);\n return $this;\n }", "public function table(string $table) : self {\n $this->query_builder->setTable($table);\n\n return $this;\n }", "public function table($table){\n\t\t$this->table = $table;\n\t\treturn $this;\n\t}", "public function table($table);", "public function table($table);", "public function setCurrentTable($thisTable){\n User::setTable($thisTable);\n }", "public function table($tbl){\n if(empty($this->tbl)){\n $this->tbl = $tbl;\n $this->query = r\\table($tbl);\n $this->old_state = $this->query;\n }\n }", "public function setTable($table) {\n\n $this->table = is_array($table) ? $table : array(self::camelCaseToUnderscore((new \\ReflectionClass($this))->getShortName()) => $table);\n\n }", "public function setTable($table = \"\"){\n\t\t\tif(is_array($table)){\n\t\t\t\t$table = implode(\", \", $table);\n\t\t\t}elseif(is_string($table)){//if a string is passed use that (default is \"\")\n\t\t\t\tif(strlen($table) < 1){//if empty string load the expected table name\n\t\t\t\t\t$table = strtolower(substr($this->class, 0, 1). substr($this->class, 1)).\"s\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthrow new Exception(\"QueryBuilder: table name must be a string or an array of strings\", 1);\n\t\t\t}\n\n\t\t\t$this->table = $table;\n\t\t\treturn $this;\n\t\t}", "public function setTable(Table $table): void\n {\n $this->table = $table;\n }", "function table($table)\n {\n $table = preg_replace('/\\s+/', ' ', trim($table));\n $arr = explode(' ', $table);\n $this->table_name = $arr[0];\n $this->table_alias = isset($arr[1]) ? $arr[1] : $this->table_alias;\n unset($arr);\n return $this;\n }", "public function table($table)\n {\n $this->table = $table;\n return $this;\n }", "public function uses_table($table_name)\n\t{\n\t\tif (!is_string($table_name))\n\t\t\tprintf(__('Invalid table name to use with this option key (%s)'), $this->option_key);\n\t\t$this->table = $table_name;\n\t}", "private function setTableName()\n {\n // Get table name from name of entity if not defined\n if (!$this->tableName) {\n $path = explode('\\\\', get_class($entity));\n $this->tableName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', array_pop($path))).'s';\n }\n\n // Set table to be used\n $this->adapter->setTable($this->tableName);\n }", "private function _set_table()\n\t{\n\t\t$dossier = $this->config->item('dossier');\n\t\tif($dossier === false)\n\t\t{\n\t\t\tlog_message('info', '\"Dossier\" params is not set');\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_dossier = $dossier;\n\t\t\t$this->_table = $this->_dossier . '.' . $this->_table;\n\t\t}\n\t}", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "public static function setTable($name = ''){\n\t\tif(! self::$db){\n\t\t\tself::setDbName();\n\t\t}\n\t\tif($name){\n\t\t\treturn self::$collection = self::$db->$name;\n\t\t}else{\n\t\t\treturn self::$collection = self::$db->$table;\n\t\t}\n\t}", "public function setTable($table)\r\n {\r\n $this->table = $table;\r\n $table_title = $this->titlecase($this->table->getName());\r\n if (!empty($this->id)) {\r\n $this->title = \"Edit $table_title record $this->id\";\r\n } else {\r\n $this->title = \"Create new $table_title record\";\r\n }\r\n }", "public function setTable($tablename){\r\n$this->tablename=$tablename;\r\n}", "public function setTableName($tablename)\n {\n $this->dbTable = $tablename;\n }", "public function table($table)\n {\n return $this->from($table, true);\n }", "public function setTableName($tableName){\n $this->tableName = $this->tableName;\n }", "public function table($table)\n\t{\n\t\t$this->table = $table;\n\t\t\n\t\treturn $this;\n\t}", "public function setTable($table = null)\n {\n if (!$this->table) {\n if (!$table) {\n $object = get_class($this);\n $table = strtolower($object);\n }\n $this->table = $table;\n }\n return $this->table;\n }", "public function into(string $table);", "public function table($table) {\r\n\r\n if(strstr($table, $this->database->prefix))\r\n $this->table = $table;\r\n else\r\n $this->table = $this->database->prefix.$table;\r\n\r\n return $this;\r\n }", "function setTableName($tableName) {\n $this->tableName = $tableName;\n }", "function table ( $name ) {\n $this->table = $name;\n $this->alias = $name;\n return $this;\n }", "private function _fetch_table()\n {\n if (!isset($this->table))\n {\n $this->table = $this->_get_table_name(get_class($this));\n }\n }", "public function setTable($table)\n {\n $this->_table = $table;\n\n return $this;\n }", "abstract protected function getTable();", "protected function setTablePrefix()\n {\n }", "function setRemoteTable($table){\n\t\t$this->remote_table = $table;\n\t}", "public function table()\n {\n return $this->table;\n }", "public function setTableNames() {\n $caseFormat = $this->settingsAll['Model'][self::$meta_model]['tablecaseformat'];\n $aliasFormat = $this->settingsAll['Model'][self::$meta_model]['tablealiasformat'];\n foreach ($this->settingsAll as $k => $v) {\n # do not process __meta\n if (in_array($k, array(self::$meta))) {\n continue;\n }\n $tableName = $this->getRealTableName($caseFormat, $k);\n # settingsAll.k.this->meta.tablename\n # - genTable responsible for having tableName set\n $custom_set = null;\n if (isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $custom_set = $this->settingsAll[$k][self::$meta]['tablename'];\n }\n $this->log(\"setTableNames / style: {$caseFormat} / k: {$k} / tableName: {$tableName} / custom-set: \" . $custom_set);\n # set correct tablename as defined in schema, but do not override individual defaults\n if (!isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $this->settingsAll[$k][self::$meta]['tablename'] = $tableName;\n }\n # ALIAS\n $this->settingsAll[$k][self::$meta]['alias'] = $this->getTableAlias($aliasFormat, $k);\n }\n }", "public function into($table)\n\t{\n\t\t$this->table($table);\n\t}", "function swap_table($table) {\r\n if( empty($this->_table_org) ) $this->_table_org = $this->_table;\r\n $this->_table = $table;\r\n }", "private function set_table_name($name) {\n $this->table_name = $name;\n }", "public function setTable($table)\n\t{\n\t\t$this->table = $table;\n\t\t\n\t\treturn $this;\n\t}", "public function table(string $table): Query;", "public function setTable($table)\n {\n $this->table = $table;\n\n return $this;\n }", "public function setTable($table)\n {\n $this->table = $table;\n\n return $this;\n }", "public function test_the_fm_facade_table_sets_the_table_name()\n {\n $builder = FM::table('pet');\n\n $this->assertEquals('pet', $builder->from);\n }", "public function getTable() { return( $this->_table ); }", "abstract public function getTable();", "abstract public function getTable();", "public function getCreateTableQuery($table);", "public function setBigqueryTable($var)\n {\n GPBUtil::checkString($var, True);\n $this->bigquery_table = $var;\n }", "public function table($table)\n {\n $processor = $this->getPostProcessor ();\n $query = new Query\\Builder ( $this, $this->getQueryGrammar (), $processor );\n return $query->from ( $table );\n }", "public function table($t){\r\n\t\tif(is_array($t)){\r\n\t\t\t$tArray = $t;\r\n\t\t\t$t = $t_alias = array_shift(array_keys($tArray));\r\n\t\t\t$driver = get_called_class();\r\n\t\t\tif(($tArray[$t_alias] instanceof $driver) === true){\r\n\t\t\t\t$this->_placeholders = array_merge($this->_placeholders, $tArray[$t_alias]->queryData());\r\n\t\t\t\t$t = $tArray[$t_alias]->queryString();\r\n\t\t\t\t$t = \"({$t}) AS {$this->formatWithQuote($t_alias, 'alias')}\";\r\n\t\t\t}\r\n\t\t\t$t = (string) $t;\r\n\t\t\t$this->_table = trim($t);\r\n\t\t}else{\r\n\t\t\t$t = \\Dorsataio\\Squibble\\Resource\\Extract::fromTable((string) $t);\r\n\t\t\t$this->_table = trim($t['table']);\r\n\t\t\tif(isset($t['alias']) && !empty($t['alias'])){\r\n\t\t\t\t$this->_table = \"{$this->_table} as {$t['alias']}\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "public function setTableName($table)\n {\n // 1. 尝试解析为 [数据库名.表名]\n if(strpos($table, '.') !== false) {\n list($database, $table) = explode('.', $table);\n if ($database) {\n $this->options['database'] = $database;\n $this->options['real_table_name'] = $table;\n }\n }\n // 2. 尝试分离出命名空间和表名\n else {\n $table = StringHelper::toClassLastName($table, 'model');\n }\n \n $table = StringHelper::toUnderscoreVariable($table);\n if (substr($table, 0, 1) === '#') {\n $this->options['real_table_name'] = $this->options['table_name'] = str_replace('#', '', $table);\n } else {\n $this->options['table_name'] = preg_replace('/^' . static::getTablePrefix() . '/i', '', $table);\n }\n \n return $this;\n }", "public function setTable(string $table) : self\n {\n $this->table = $table;\n\n return $this;\n }", "public function table($strTable) {\r\n $this->sqlTables[] = $strTable;\r\n return $this;\r\n }", "public function table($name)\n {\n $this->statement['table'] = $name;\n return $this;\n }", "static function set_table_prefix($tp) {\n\t\tself::$table_prefix = $tp;\n\t}", "public function table(string $table): self\n {\n $this->table = $table;\n\n return $this;\n }", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "public function getTable();", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(USER_RSS); \n }", "public function getCurrentTable() {}", "public function setTableName($tableName)\n {\n $this->tableName = $tableName;\n }", "public function getTable()\r\n {\r\n }", "function set_entity($ent){\n $this -> table = $ent;\n }", "protected function table($table)\n {\n return DB::connection($this->connection)->table($table);\n }", "final public function setTableName($name)\n\t\t{\n\t\t\t$this->_tableName = $name;\n\t\t}", "public function getTableAlias() ;", "public function from(string $table): SQL\n {\n $this->table[] = $table;\n return $this;\n }", "public function get_table()\n\t{\n\t\treturn $this->_table;\n\t}", "public function setTable(Table $parent)\n {\n $this->parentTable = $parent;\n }", "public function table(string $table)\n {\n $this->table = $table;\n $this->key = $this->getPrimaryKey($this->table);\n\n return $this;\n }", "public function setTableName( string $table_name )\n {\n $this->table_name = $table_name;\n }", "public function setTables($table) {\r\n if( is_array($table) ) {\r\n $this->sqlTables = array_merge($this->sqlTables, $table);\r\n } elseif( is_string($table) ) {\r\n $this->sqlTables[] = $table;\r\n }\r\n return $this;\r\n }", "function SqlTableName($table=\"\")\n {\n return $this->ApplicationObj->SqlEventTableName(\"Inscriptions\",$table);\n }", "public function table($table,$key = \"id\",$apart_id = NULL){\r\n\t\tif($apart_id){\r\n\t\t\t$table .= static::_computeTableId($apart_id);\r\n\t\t}\r\n\t\tstatic::$_defaultMeta = static::$_meta;\r\n\t\tstatic::$_meta['source'] = $table;\r\n\t\tstatic::$_meta['key'] = $key;\r\n\t\treturn $this;\r\n\t}", "abstract public function tableName();", "abstract public function tableName();", "public function setTable($table)\n {\n if (!isset($table)) {\n throw new \\Exception('You cant define an empty value', 1);\n return false;\n }\n\n // default cache table is 'cache'\n if ($table !== 'cache') {\n $this->table = self::prefixTable . $table;\n } else {\n $this->table = 'cache';\n }\n }", "function get_table($table)\n {\n return $GLOBALS ['ZUIZZ']->config->db ['prefix'] . $this->config ['tables'] [$table];\n }", "public function __construct($table)\n {\n $this->table = $table;\n }", "public function table($table)\n {\n $this->binds = [];\n if (!$this->conn) throw new \\PDOException('未建立database链接');\n if (empty($table)) throw new \\PDOException('表名不能为空');\n if (is_object($table) && ($table instanceof SingleTableBuilder || $table instanceof MoreTableBuilder)) {\n //传入一个闭包 获取这个闭包的SQL\n $sonTable = $table->getObj();\n $table = \"(\".$sonTable['sql'].\")\";\n $this->binds = $sonTable['binds'];\n }\n\n return new SingleTableBuilder($table, $this,[\n 'binds' => $this->binds\n ]);\n }", "public function tableOptions($table, $schema=null){ }" ]
[ "0.77850586", "0.7777293", "0.7693955", "0.75881785", "0.75083214", "0.7480879", "0.7450101", "0.7447804", "0.74292517", "0.73809063", "0.7372248", "0.7324959", "0.7253151", "0.70937693", "0.7048983", "0.70214355", "0.69694227", "0.69298613", "0.6929592", "0.6929592", "0.68999094", "0.68894726", "0.6855742", "0.6854762", "0.6847486", "0.6833803", "0.6831248", "0.6810444", "0.6806308", "0.6781884", "0.6716744", "0.67155594", "0.66467184", "0.6643268", "0.66243154", "0.6623252", "0.6613679", "0.6601632", "0.6599165", "0.65725076", "0.65534633", "0.65515673", "0.6495564", "0.64954674", "0.64784515", "0.64622706", "0.6451423", "0.6445629", "0.6410937", "0.64094603", "0.6390036", "0.6388964", "0.638785", "0.6371621", "0.637025", "0.63645285", "0.63645285", "0.6360882", "0.63510096", "0.6340132", "0.6340132", "0.6339847", "0.6339395", "0.6333159", "0.6326482", "0.6313664", "0.6311982", "0.6295855", "0.62954515", "0.6292677", "0.6284538", "0.6271178", "0.6271178", "0.6271178", "0.6271178", "0.6271178", "0.6271178", "0.6271178", "0.6254326", "0.6251804", "0.625106", "0.62502754", "0.62315726", "0.6216532", "0.6203959", "0.6201611", "0.61929923", "0.6191168", "0.61799026", "0.6174278", "0.61695534", "0.6159682", "0.6148781", "0.6148203", "0.6145725", "0.6145725", "0.61438704", "0.61392975", "0.6138478", "0.61245954", "0.61182165" ]
0.0
-1
Set a "join" to the query.
public function join($table, $column_one = null, $column_two = null, $type = '') { if (func_num_args() < 3) { @list($query, $params) = func_get_args(); $params = (array) $params; $this->join[] = compact('query', 'params'); $this->add_bind('join', $params); } else { $this->join[] = compact('table', 'column_one', 'column_two', 'type'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinQuery()\n {\n }", "protected function setJoin($query = null)\n {\n $query = $query ? : $this->query;\n $baseTable = $this->related->getTable ();\n $key = $baseTable . '.' . $this->related->getKeyName ();\n $query->join ( $this->table, $key, '=', $this->getOtherKey () );\n return $this;\n }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function basic_join_setup()\r\n {\r\n \r\n }", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "private function getJoin() {\n return $this->join;\n }", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function join()\n {\n $this->defaultjoinsetted = true;\n if (!empty($this->entity_link_list)) {\n foreach ($this->entity_link_list as $entity_link) {\n $this->defaultjoin .= \" left join `\" . strtolower(get_class($entity_link)) . \"` on \" . strtolower(get_class($entity_link)) . \".id = \" . $this->table . \".\" . strtolower(get_class($entity_link)) . \"_id\";\n }\n }\n return $this;\n }", "public function join($table, $type = NULL){\n $this->_last_join = new Join($table, $type);\n $this->_last_join->setQuoter($this->quoter);\n $this->_join[] = $this->_last_join;\n return $this;\n }", "private function makeJoins(ParseLoop $parse, $join)\n {\n $model = ModelTools::buildModelName($join['REFERENCED_TABLE_NAME']);\n $parse->setData('joins', [\n 'tablejoin' => $model,\n 'table' => $model . '::TABLE',\n 'leftcol' => $this->classname . '::' . ModelTools::getFieldConstant($this->table, $join['COLUMN_NAME']),\n 'rightcol' => $model . '::' . ModelTools::getFieldConstant($join['REFERENCED_TABLE_NAME'], $join['REFERENCED_COLUMN_NAME'])\n \n ]);\n }", "public static function add_wp_query_join( $join, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\t$search = $wp_query->get( 'search' );\n\t\tif ( $search ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->postmeta} AS attr_search_meta\n\t\t\t\t\t\tON {$wpdb->posts}.ID = attr_search_meta.post_id\n\t\t\t\t\t\tAND attr_search_meta.meta_key LIKE 'attribute_%' \";\n\t\t}\n\n\t\tif ( wc_product_sku_enabled() && ! strstr( $join, 'wc_product_meta_lookup' ) ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup\n\t\t\t\t\t\tON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function makeSearchJoin($join)\n {\n global $wpdb;\n\n if (is_search()) {\n\n $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $join .= \" LEFT JOIN $wpdb->postmeta as $values ON $wpdb->posts.ID = $values.post_id\";\n\n }\n }\n\n }\n\n return $join;\n }", "protected function set_join($other)\n {\n $this->table->join($this->joining, $this->associated_key(), '=', $this->joining . '.' . $other);\n return $this;\n }", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "abstract public function join($alias_from, $rel_name, $alias_to);", "function addJoin($name, $joinType, $tableA, $tableB, $fieldA, $fieldB) {\n\t\t$this->addBlock('from', $name, array(array($joinType, $tableA, $tableB, $fieldA, $fieldB)));\n\t\treturn $this;\n\t}", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "public function addJoin( $join, $type = null ) {\n if ( !$join ) {\n return;\n }\n $this->join[] = $type ? sprintf( \"%s JOIN %s\", $type, $join ) : sprintf( \"JOIN %s\", $join );\n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public function getJoin()\n {\n return $this->get(self::_JOIN);\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "protected function performJoin(Builder $query = null)\n {\n $query = $query ?: $this->query;\n\n $ownerKey = $this->getQualifiedOwnerKeyName();\n\n $query->join($this->throughChild->getTable(), $ownerKey , '=', $this->getQualifiedFirstKeyName());\n $query->select([\n '*' => $this->related->qualifyColumn('*'),\n $this->secondKey => $this->throughChild->getQualifiedKeyName().' as '.$this->secondKey\n ]);\n\n if ($this->throughChildSoftDeletes()) {\n $query->whereNull($this->throughChild->getQualifiedDeletedAtColumn());\n }\n }", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n}", "public static function adjacent_post_link_join( $join) {\n $post = get_post();\n // only make changes if we are talking about event posts\n if ( self::$o->core_post_type == $post->post_type ) {\n $wpdb='';\n // using start date as the sorter not the post_date\n $join .= $wpdb->prepare( ' inner join ' . $wpdb->postmeta . ' as qspm on qspm.post_id = p.ID AND qspm.meta_key = %s', '_start' );\n }\n\n return $join;\n }", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) { \n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function posts_join_request( $join ) {\n global $wpdb;\n\n $join .= \" inner join {$wpdb->postmeta} as metalat on {$wpdb->posts}.ID = metalat.post_id and metalat.meta_key = 'dokan_geo_latitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metalong on {$wpdb->posts}.ID = metalong.post_id and metalong.meta_key = 'dokan_geo_longitude'\";\n $join .= \" inner join {$wpdb->postmeta} as metaaddr on {$wpdb->posts}.ID = metaaddr.post_id and metaaddr.meta_key = 'dokan_geo_address'\";\n\n remove_filter( 'posts_join_request', array( $this, 'posts_join_request' ) );\n\n return $join;\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function custom_attachments_join( $join, $query ){\n\t\tglobal $wpdb;\n\n\t\t//if we are not on admin or the current search is not on attachment return\n\t\tif(!is_admin() || (!isset($query->query['post_type']) || $query->query['post_type'] != 'attachment')){\n\t\t\treturn $join;\n\t\t}\n\n\t\t// if current query is the main query and a search...\n\t\tif( is_main_query() && is_search() ){\n\t\t\t$join .= \"\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_relationships} ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id\n\t\t\tLEFT JOIN\n\t\t\t{$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "public function getJoinExpression();", "public function join(...$params)\n {\n $this->tmpReindex = false;\n\n // Pass through to the builder\n $this->builder()->join(...$params);\n\n return $this;\n }", "public function joinBills()\n {\n $this->builder->join('bills', 'bil_id', 'rc_bill');\n }", "function cf_search_join($join) {\n global $wpdb;\n\n if (is_search()) {\n $join .=' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "public function join_quiz_master_and_postmeta( $join ) {\n\t\t\tglobal $wpdb;\n\n\t\t\treturn $join;\n\t\t}", "public function getJoinCondition() {}", "function query() {\n dpm($this);\n $this->ensure_my_table();\n\n // First, relate our current table to the link table via the field\n $first = array(\n 'left_table' => $this->table_alias,\n 'left_field' => $this->field, // @TODO real_field?\n 'table' => $this->definition['link table'],\n 'field' => $this->definition['link field'],\n );\n\n if (!empty($this->options['required'])) {\n $first['type'] = 'INNER';\n }\n\n if (!empty($this->definition['link_join_extra'])) {\n $first['extra'] = $this->definition['link_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $first_join = new $this->definition['join_handler'];\n }\n else {\n $first_join = new views_join();\n }\n $first_join->definition = $first;\n $first_join->construct();\n $first_join->adjusted = TRUE;\n\n $this->first_alias = $this->query->add_table($this->definition['link table'], $this->relationship, $first_join);\n\n // Second, relate the link table to the entity specified using\n // the specified base fields on the base and link tables.\n $second = array(\n 'left_table' => $this->first_alias,\n 'left_field' => $this->definition['base link field'],\n 'table' => $this->definition['base'],\n 'field' => $this->definition['base field'],\n );\n\n if (!empty($this->options['required'])) {\n $second['type'] = 'INNER';\n }\n\n if (!empty($this->definition['base_join_extra'])) {\n $second['extra'] = $this->definition['base_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $second_join = new $this->definition['join_handler'];\n }\n else {\n $second_join = new views_join();\n }\n $second_join->definition = $second;\n $second_join->construct();\n $second_join->adjusted = TRUE;\n\n // use a short alias for this:\n // @TODO real_field?\n $alias = $this->field . '_' . $this->definition['base'];\n\n $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);\n }", "public function getJoin(): string\n {\n return $this->join;\n }", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "public function join(string $join);", "public function getarchives_join( $join, $r ) {\n\t\tglobal $wpdb;\n\t\t$this->get_archives_where_r = $r;\n\t\tif(isset($r['taxonomy']) && is_array($r['taxonomy']) )\n\t\t$join = $join . \" INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\";\n\n\t\treturn $join;\n\t}", "final public function addJoin(YMKM_SQL_Entity_Join $s)\n {\n $this->doAddJoin($s);\n return $this;\n }", "function MWX__join ($join)\n{\n global $wpdb;\n\n if (current_user_can ('edit_users'))\n return $join;\n\n return $join .= \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'maturity'\";\n}", "function getJoinCondition() ;", "public function join($table, $type = NULL)\n {\n if ($type !== '')\n {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n {\n $type = '';\n }\n else\n {\n $type .= ' ';\n }\n }\n\n // Assemble the JOIN statement\n $table = $this->table_prefix($table);\n $table = $this->quote_identifier($table);\n $this->_join[] = $type.'JOIN '.$table;\n\n return $this;\n }", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public function activityQuery($join = true) {\n $this->SQL\n ->select('a.*')\n ->select('t.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode')\n ->select('t.Name', '', 'ActivityType')\n ->from('Activity a')\n ->join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID');\n\n if ($join) {\n $this->SQL\n ->select('au.Name', '', 'ActivityName')\n ->select('au.Gender', '', 'ActivityGender')\n ->select('au.Photo', '', 'ActivityPhoto')\n ->select('au.Email', '', 'ActivityEmail')\n ->select('ru.Name', '', 'RegardingName')\n ->select('ru.Gender', '', 'RegardingGender')\n ->select('ru.Email', '', 'RegardingEmail')\n ->select('ru.Photo', '', 'RegardingPhoto')\n ->join('User au', 'a.ActivityUserID = au.UserID')\n ->join('User ru', 'a.RegardingUserID = ru.UserID', 'left');\n }\n\n $this->fireEvent('AfterActivityQuery');\n }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "function xiliml_adjacent_join_filter( $join, $in_same_cat, $excluded_categories ) {\n\t\tglobal $post, $wpdb;\n\t\t$curlang = xiliml_get_lang_object_of_post( $post->ID );\n\n\t\tif ( $curlang ) { // only when language is defined !\n\t\t\t$join .= \" LEFT JOIN $wpdb->term_relationships as xtr ON (p.ID = xtr.object_id) LEFT JOIN $wpdb->term_taxonomy as xtt ON (xtr.term_taxonomy_id = xtt.term_taxonomy_id) \";\n\t\t}\n\t\treturn $join;\n\t}", "function test_getJoin()\n {\n $question = new MDB_QT(TABLE_QUESTION);\n $joinOn1 = TABLE_QUESTION.'.id='.TABLE_ANSWER.'.question_id';\n $question->setJoin(TABLE_ANSWER, $joinOn1);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n );\n $tables = array(TABLE_ANSWER);\n $right = array();\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n\n //--------------------------------------------------------\n\n $joinOn2 = TABLE_USER.'.id='.TABLE_ANSWER.'.question_id';\n $question->setRightJoin(TABLE_USER, $joinOn2);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n 'right' => array(TABLE_USER => $joinOn2),\n );\n $tables = array(TABLE_ANSWER, TABLE_USER);\n $right = array(TABLE_USER => $joinOn2);\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n }", "public function join($table, $on, $type){\n\t\t$this->joins[] = array($table, $on, $type);\n\t\treturn $this;\n\t}", "public function join($table, $on, $field = null, $comparitor = null);", "function wc_tab_manager_tabs_posts_join( $join, $query ) {\n\tglobal $wpdb, $typenow;\n\n\tif ( 'wc_product_tab' === $typenow ) {\n\t\t$join .= \" JOIN {$wpdb->posts} AS product_parents ON ( {$wpdb->posts}.post_parent = 0 OR ( {$wpdb->posts}.post_parent = product_parents.ID AND product_parents.post_status != 'trash' ) )\";\n\t}\n\n\treturn $join;\n}", "public function join($id);", "public function add_filter_join($field, $join_type = 'or')\n\t{\n\t\tif (!empty($this->filter_join) AND is_string($this->filter_join))\n\t\t{\n\t\t\t$this->filter_join = array($this->filter_join);\n\t\t}\n\t\t$this->filter_join[$field] = $join_type;\n\t}", "protected abstract function getJoinClause(array $joins);", "public function joinCustomers()\n {\n $this->builder->join('customers', 'cus_id', 'rc_customer');\n }", "function editor_joins(){\n //\n //begin with an empty collection of joins \n $joins=[];\n //\n //Push the editor joins also\n foreach ($this->editor_joins as $join){\n array_push($joins, $join);\n }\n //\n //Set the new joins \n $this->joins=new joins($joins);\n }", "public function addJoin ($callback) {\n $this->join = $callback;\n\n return $this;\n }", "private function set_relation_joins() {\n if(!$this->use_relations) return;\n $relations = [];\n foreach ($this->colmodel as $i => $col) {\n if (!isset($col['relation']))\n continue;\n foreach (explode('>', $col['relation']) as $relation) {\n if (!str_contains($relation, '.'))\n continue;\n list($model_name, $relation_name) = explode('.', $relation);\n if ($relation_name != '' && !in_array($relation, $relations)) {\n $this->set_relation_join($model_name, $relation_name);\n $relations[] = $relation;\n }\n }\n }\n }", "private function addJoin(array $join)\n {\n $this->joins[] = $join;\n\n return $this;\n }", "private function addJoin(array $join)\n {\n $this->joins[] = $join;\n\n return $this;\n }", "public function join( $table, $type = '' ) {\n if ( !is_string($table) ) {\n throw new Exception( \"Invalid argument type, [table] must be string type\", 1 );\n }\n\n if ( $type == 'join' ) {\n $type = '';\n }\n\n $this->_lastJoin = $table;\n\n $exceptedTypes = array( 'left', 'right', '' );\n if ( !in_array(strtolower($type), $exceptedTypes) ) {\n $type = $exceptedTypes[0];\n }\n\n $type = strtoupper( $type );\n\n $this->_currentImplement['join'][] = array( 'table' => $table, 'type' => $type );\n return $this;\n }", "public function joinBookings()\n {\n $this->builder->join('bookings', 'book_id', 'bil_booking');\n }", "public function innerJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (get_class($this) == $joined || in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_innerJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function on($entity)\n {\n $this->query .= \" on \" . $this->join . \".id = \" . strtolower(get_class($entity)) . \".\" . $this->join . \"_id\";\n\n return $this;\n }", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public static function posts_join( $join_sql, $query ) {\n\t\t\tglobal $wpdb;\n\t\t\t$joins = array();\n\n\t\t\t$postmeta_table = self::postmeta_table( $query );\n\n\t\t\t$event_start_key = '_EventStartDate';\n\t\t\t$event_end_key = '_EventEndDate';\n\n\t\t\t/**\n\t\t\t * When the \"Use site timezone everywhere\" option is checked in events settings,\n\t\t\t * the UTC time for event start and end times will be used. This filter allows the\n\t\t\t * disabling of that in certain contexts, so that local (not UTC) event times are used.\n\t\t\t *\n\t\t\t * @since 4.6.10\n\t\t\t *\n\t\t\t * @param boolean $force_local_tz Whether to force the local TZ.\n\t\t\t */\n\t\t\t$force_local_tz = apply_filters( 'tribe_events_query_force_local_tz', false );\n\n\t\t\tif ( Tribe__Events__Timezones::is_mode( 'site' ) && ! $force_local_tz ) {\n\t\t\t\t$event_start_key .= 'UTC';\n\t\t\t\t$event_end_key .= 'UTC';\n\t\t\t}\n\n\t\t\t// if it's a true event query then we want create a join for where conditions\n\t\t\tif ( $query->tribe_is_event || $query->tribe_is_event_category || $query->tribe_is_multi_posttype ) {\n\t\t\t\tif ( $query->tribe_is_multi_posttype ) {\n\t\t\t\t\t// if we're getting multiple post types, we don't need the end date, just get the start date\n\t\t\t\t\t// for events-only post type queries, the start date postmeta join is already added by the main query args\n\t\t\t\t\t$joins['event_start_date'] = \" LEFT JOIN {$wpdb->postmeta} as {$postmeta_table} on {$wpdb->posts}.ID = {$postmeta_table}.post_id AND {$postmeta_table}.meta_key = '$event_start_key'\";\n\t\t\t\t} else {\n\t\t\t\t\t// for events-only post type queries, we should also get the end date for display\n\t\t\t\t\t$joins['event_end_date'] = \" LEFT JOIN {$wpdb->postmeta} as tribe_event_end_date ON ( {$wpdb->posts}.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '$event_end_key' ) \";\n\t\t\t\t}\n\t\t\t\t$joins = apply_filters( 'tribe_events_query_posts_joins', $joins, $query );\n\n\t\t\t\treturn $join_sql . implode( '', $joins );\n\t\t\t}\n\n\t\t\treturn $join_sql;\n\t\t}", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "function test_setJoin()\n {\n $theQuestion = 'Why does this not work?';\n $theAnswer = 'I dont know!';\n\n $question = new MDB_QT(TABLE_QUESTION);\n $newQuest = array(TABLE_QUESTION => $theQuestion);\n $qid = $question->add($newQuest);\n $this->assertTrue($qid != false);\n\n $answer = new MDB_QT(TABLE_ANSWER);\n $newAnswer = array(TABLE_QUESTION.'_id' => $qid, TABLE_ANSWER => $theAnswer);\n $aid = $answer->add($newAnswer);\n $this->assertTrue($aid != false);\n\n $joinOn = TABLE_QUESTION.'.id='.TABLE_ANSWER.'.question_id';\n $question->setJoin(TABLE_ANSWER, $joinOn);\n \n if (DB_TYPE == 'ibase') {\n $expected = array(\n 't_answer_id' => $aid,\n 't_answer_answer' => $theAnswer,\n 't_answer_question_id' => $qid,\n 'id' => $qid,\n 'question' => $theQuestion,\n );\n } else {\n $expected = array(\n '_answer_id' => $aid,\n '_answer_answer' => $theAnswer,\n '_answer_question_id' => $qid,\n 'id' => $qid,\n 'question' => $theQuestion,\n );\n }\n $this->assertEqual($expected, $question->get($qid));\n }", "function map_joins($join){\n //\n //return field to str\n return $join->to_str();\n }", "protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }", "public function joinFields()\n {\n if (!$this->_joinedFields) {\n $this->getSelect()->join(\n array('related' => $this->getTable('oggetto_news/category_news')),\n 'related.news_id = main_table.entity_id',\n array('position')\n );\n $this->_joinedFields = true;\n }\n return $this;\n }", "public function joinBase()\n {\n return $this->_joins[0];\n }", "public function joins($name = null, $join = null) {\n\t\tif (is_array($name)) {\n\t\t\t$join = $name;\n\t\t\t$name = null;\n\t\t}\n\t\tif ($join) {\n\t\t\tif (!$name) {\n\t\t\t\t$this->_config['joins'][] = $join;\n\t\t\t} else {\n\t\t\t\t$this->_config['joins'][$name] = $join;\n\t\t\t}\n\t\t\treturn $this;\n\t\t}\n\t\tif (!$name) {\n\t\t\treturn $this->_config['joins'];\n\t\t}\n\t\tif (isset($this->_config['joins'][$name])) {\n\t\t\treturn $this->_config['joins'][$name];\n\t\t}\n\t}", "public function testBuildSelectWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->fields()\n ->addField('user@email', 'email')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, 'user@email' AS table2__email\",\n $query->buildSelectFields()\n );\n }", "public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', '=', 'add_resource');\n }", "function whereJoin($relName, $s)\n{\n\t$this->tryModify();\n\n\t$rel = new Relation($this->newModel(null), $relName);\n\n\t$s = $this->setWhereParams($s, func_get_args(), 2);\n\n\t$table = $rel->params['table'];\n\t$join = $rel->getJoinCondition();\n\n\tif(!isset($this->query['whereJoin'])) $this->query['whereJoin'] = array();\n\n\tif ($rel->getType() == 'many_to_many') {\n\t\t$joinTable = $rel->getJoinTableName();\n\t\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table,$joinTable where $join and ($s))\";\n\t\treturn $this;\n\t}\n\n\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table WHERE $join AND ($s))\";\n\treturn $this;\n}", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "protected function _addJoin($type, $table, $fields, $on = []) {\n $repo = $this->getRepository();\n $join = new Join($type);\n $conditions = [];\n\n if (is_array($table)) {\n $alias = $table[1];\n $table = $table[0];\n } else {\n $alias = $table;\n }\n\n foreach ($on as $pfk => $rfk) {\n if (strpos($pfk, '.') === false) {\n $pfk = $repo->getAlias() . '.' . $pfk;\n }\n\n if (strpos($rfk, '.') === false) {\n $rfk = $alias . '.' . $rfk;\n }\n\n $conditions[$pfk] = $rfk;\n }\n\n $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);\n\n return $this;\n }", "public function testBuildJoinDefaultWithAliases()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 AS table2_alias ON table1_alias.id = table2_alias.id',\n $query->buildJoin()\n );\n }", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function visitJoinClause(\n /*IJoinClause*/ $node) /*: mixed*/ {\n $id = $node->getIdentifier();\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $left = null;\n $left_value = $node->getLeft();\n if ($left_value != null) {\n $left = /*(string)*/$left_value->accept($this);\n }\n $right = null;\n $right_value = $node->getRight();\n if ($right_value != null) {\n $right = /*(string)*/$right_value->accept($this);\n }\n $group = $node->getGroup();\n\n $result = 'join ';\n if ($id !== null) {\n $result .= '$'.$id.' in ';\n }\n $result .= $collection;\n if ($left !== null && $right !== null) {\n $result .= \" on $left equals $right\";\n if ($group !== null) {\n $result .= ' into '.$group;\n }\n }\n return $result;\n }", "function carton_exclude_order_comments_from_feed_join( $join ) {\n\tglobal $wpdb;\n\n if ( ! $join )\n \t$join = \" LEFT JOIN $wpdb->posts ON $wpdb->comments.\\\"comment_post_ID\\\" = $wpdb->posts.\\\"ID\\\" \";\n\n return $join;\n}", "public function prev_next_join( $join ) {\n\t\tglobal $wpdb;\n\t\t$join .= \" LEFT JOIN $wpdb->postmeta AS m ON ( p.ID = m.post_id AND m.meta_key = 'wpex_post_link' )\";\n\t\treturn $join;\n\t}", "public function join(string $table, string $condition, string $type=''): QueryBuilderInterface\n\t{\n\t\t// Prefix and quote table name\n\t\t$table = explode(' ', mb_trim($table));\n\t\t$table[0] = $this->driver->quoteTable($table[0]);\n\t\t$table = $this->driver->quoteIdent($table);\n\t\t$table = implode(' ', $table);\n\n\t\t// Parse out the join condition\n\t\t$parsedCondition = $this->parser->compileJoin($condition);\n\t\t$condition = $table . ' ON ' . $parsedCondition;\n\n\t\t$this->state->appendMap(\"\\n\" . strtoupper($type) . ' JOIN ', $condition, 'join');\n\n\t\treturn $this;\n\t}", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "protected function joinClause(\n /*# : string */ $prefix,\n /*# : string */ $seperator,\n array $clause,\n array $settings\n )/*# : string */ {\n if (empty($clause)) {\n return '';\n } else {\n $sepr = $settings['seperator'];\n $join = $settings['join'];\n $pref = empty($prefix) ? $join : ($sepr . $prefix . $join);\n return $pref . join($seperator . $join, $clause);\n }\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "public final function addJoin($tbl, $as, $by, $condition, $reset=false)\n {\n if ($reset==true)\n \t$this->join = array();\n\n $this->join[] = array(\n 'tbl' => $tbl,\n 'as' => $as,\n 'by' => $by,\n 'cond' => $condition\n );\n\n return $this;\n }" ]
[ "0.78279716", "0.7355788", "0.6966847", "0.6959353", "0.6876668", "0.6826617", "0.68143976", "0.675143", "0.6649497", "0.66414094", "0.66207606", "0.6573418", "0.65594697", "0.6527229", "0.6502538", "0.64551586", "0.64499366", "0.64016366", "0.63563937", "0.63419855", "0.6335266", "0.6317689", "0.62966114", "0.62945133", "0.62775785", "0.62594837", "0.6250171", "0.6222121", "0.62202334", "0.62140656", "0.6204069", "0.6196793", "0.61962885", "0.61946064", "0.6184293", "0.61836165", "0.6162821", "0.6160113", "0.6124983", "0.612404", "0.6115405", "0.60816497", "0.6073305", "0.60709494", "0.60516036", "0.60479254", "0.60464054", "0.6038875", "0.6035948", "0.6031179", "0.60214585", "0.601504", "0.6009888", "0.6008071", "0.6004788", "0.59977597", "0.59927064", "0.5989717", "0.5988158", "0.5986199", "0.5973773", "0.59498864", "0.59440297", "0.59432924", "0.5931827", "0.59269", "0.5910136", "0.59016526", "0.59016526", "0.5893409", "0.58849615", "0.587741", "0.5876781", "0.5865792", "0.5851387", "0.5849416", "0.5847216", "0.583438", "0.5817514", "0.5816123", "0.5815954", "0.58115417", "0.57875144", "0.5774865", "0.57724476", "0.57721555", "0.57651365", "0.57639664", "0.5755932", "0.5748492", "0.5745953", "0.57257324", "0.57251924", "0.5714165", "0.5712131", "0.5710705", "0.57103163", "0.5706949", "0.56964684", "0.56936216", "0.5690066" ]
0.0
-1
Add a "where" to the query.
public function where($query, $params = array(), $boolean = 'and', $not = false) { if (is_array($query)) { return $this->where_assoc($query, $boolean, $not); } if ($params instanceof Query) { return $this->where_sub($query, $params, $boolean, $not); } $type = 'bind'; $this->where[] = compact('query', 'params', 'boolean', 'not', 'type'); $this->add_bind('where', $params); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "protected function getWhereClause() {}", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function addWhere($where)\n {\n $this->wheres[$where] = $where;\n }", "protected function user_where_clause() {}", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public static function where(array $where);", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "function where($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['where'])) $this->query['where'] = array();\n\t$this->query['where'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function getWhere()\n {\n return $this->where;\n }", "protected function getGeneralWhereClause() {}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "public function where()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n $this->addToBindings($bindings);\n $this->wheres[] = $sql;\n\n return $this;\n }", "abstract public function where(array $where);", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "function setWhere($where) {\n $this->where = $where;\n }", "public function getWhere($where, Database_Config $databaseConfig = NULL);", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function getWhere() {\r\n return $this->_where;\r\n }", "public function setWhere($where)\r\n {\r\n $this->where = !empty($where) ? $where : null;\r\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "protected function constructWhere($where)\n {\n if (is_array($where)) {\n $equals = array();\n \n foreach ($where as $column => $value) {\n $equals[] = new Equal($column, $value);\n }\n\n $this->where = new Where(new AndOperator($equals));\n } else {\n $this->where = new Where($where);\n }\n }", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "function getWhere() {\n return $this->where;\n }", "public function where(): Where\n {\n if (!isset($this->where)){\n $this->where = new Query\\Where($this, $this->driver, $this->topQuery);\n }\n return $this->where; \n }", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "private function sql_whereWiHits()\n {\n // Get WHERE statement\n $where = $this->pObj->objSqlInit->statements[ 'listView' ][ 'where' ] .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS();\n // Localise the WHERE statement\n $where = $this->sql_whereWiHitsLL( $where );\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "final public function addWhere(YMKM_SQL_Entity_Where $s)\n {\n $this->doAddWhere($s);\n return $this;\n }", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "protected function _setWhere(&$sql, $where, $whereValues) {\n\t\t\n\t\tif (!is_null($where)) $sql.= ' WHERE ' . $where;\n\t}", "public function whereParenWrap() {\n $where = $this->_dqlParts['where'];\n if (count($where) > 0) {\n array_unshift($where, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function where($where) \n {\n if ($where == null) {\n throw new DataSetException(\"null not allowed for where clause\");\n } \n $this->where = $where;\n return $this;\n }", "public function addWhere($condition)\n\t{\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\t\t$this->wheres[] = $condition;\n\t\treturn $this;\n\t}", "public function getWhere() {\n return $this->_where ?: new Predicate(Predicate::ALSO);\n }", "public function where($sql)\n {\n $this->where[] = call_user_func_array('self::clause', func_get_args());\n return $this;\n }", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "protected function getWhereClause(array $where)\n {\n if (empty($where)) {\n return '';\n }\n\n $conditions = [];\n foreach ($where as $field => $value) {\n if (is_null($value)) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"$field = '$value'\";\n }\n\n return 'WHERE ' . implode(' AND ', $conditions);\n }", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "public function addWhere(Expression $expression, $type = AbstractSearchQuery::WHERE_AND);", "function addComplexWhere($name, $where) {\n\t\t$this->addBlock('where', $name, $where);\n\t\treturn $this;\n\t}", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "public function where(string ...$condition): self\n {\n $this->where = array_merge($this->where, $condition);\n return $this;\n }", "public function custom_where( $where = '' ){\n\n\n\t// make sure to change your meta_key to whatever you saved your user_id as here mine is _restricted_to\n\n\t\tglobal $wpdb;\n\t\t$user_id = get_current_user_id();\n\n\t\t$where .= \" OR (( $wpdb->postmeta.meta_key = '_bcit_wpd_show_product' and $wpdb->postmeta.meta_value = $user_id ))\";\n\n\t\tremove_filter( 'posts_where', array( $this, 'custom_where' ) );\n\n\t\treturn $where;\n\n\t}", "public function andWhere($where, $params = array()) {\n parent::andWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "public function getWhereClause()\n {\n return $this->where_clause;\n }", "protected function _compile_wh($where) {\n\t\tif (is_array($where) && count($where) > 0) {\n\t\t\t$statements = array();\n\t\t\tforeach ($where as $key => $val) {\n\t\t\t\t// Get Operator\n\t\t\t\tif ($this->_has_operator($key)) {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' ' . $this->_get_operator($key) . ' ' . $this->escape($val);\n\t\t\t\t} else {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' = ' . $this->escape($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = ' WHERE ' . implode(' AND ', $statements);\n\n\t\t\treturn $query;\n\t\t} elseif (is_string($where)) {\n\t\t\treturn ' WHERE ' . $where;\n\t\t}\n\n\t\treturn '';\n\t}", "public function setWhere($where)\n\t{\n\t\t$this->where = $where;\n\t\treturn $this;\n\t}", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function where()\n {\n return $this->query; \n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "function whereAdd($where,$clause)\n{\n\tif(!strlen($clause))\n\t\treturn $where;\n\tif(!strlen($where))\n\t\treturn $clause;\n\treturn \"(\".$where.\") and (\".$clause.\")\";\n}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "public function getWhere()\n\t{\n\t\tif(empty($this->sWhere))\n\t\t{\n\t\t\treturn 'TRUE';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->sWhere;\n\t\t}\n\t}", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public static function doCarModelWhere($query, $where = array())\n {\n if ($query) {\n if (count($where) > 0) {\n foreach ($where as $w_key => $w_value) {\n if (!is_null(trim($w_value))) {\n $query->where($w_key, $w_value);\n }\n }\n }\n }\n }", "public function\r\n add_conditions_to_where_clause(\r\n $conditions\r\n );", "public function modifyWhere(&$sql, $table = 'listings')\n {\n if (!$this->geo_filter_data['applied_location']\n || !$this->geo_filter_data['is_filtering']\n ) {\n return;\n }\n\n if (!$sql) {\n $sql = &$GLOBALS['sql'];\n }\n\n $data_key = $table == 'accounts' ? 'location_account_fields' : 'location_listing_fields';\n $data = $this->geo_filter_data[$data_key];\n\n // Return if location search already performed from the search form\n if (strpos($sql, key($this->geo_filter_data[$data_key]))) {\n return;\n }\n\n foreach ($data as $field => $value) {\n if ($value) {\n $sql .= \"AND `T1`.`{$field}` = '{$value}' \";\n }\n }\n }", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= test@test.com']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "public function andWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_AND) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public function where($whereClause = null)\r\n\t\t{\r\n\t\t\tif($whereClause != null and $whereClause != 'false'){\r\n\t\t\t\tif($this->_where != '') $this->_where .= ' ' . $whereClause;\r\n\t\t\t\telse $this->_where = ' WHERE ' . $whereClause;\r\n\t\t\t}\r\n\t\t\telse if($whereClause == 'false'){\r\n\t\t\t\t//this is used as a bypass on some methods\r\n\t\t\t\t$this->_where = 'false';\r\n\t\t\t}\r\n\t\t\treturn $this;\r\n\t\t}", "protected function where(array $filter){\n if (array_key_exists(\"order\", $filter)){\n $order = $filter[\"order\"];\n unset($filter[\"order\"]);\n if (gettype($order) != \"array\")\n $order = [$order];\n }\n\n if (array_key_exists(\"limit\", $filter)){\n $limit = $filter[\"limit\"];\n unset($filter[\"limit\"]);\n if (gettype($limit) != \"integer\")\n throw new appException(\"This is off-limits, literally\");\n }\n\n if (!empty($filter)){\n $query = \" WHERE \";\n\n foreach ($filter as $k => $v){\n if (gettype($v) == \"array\"){\n $query .= $this->genTableVar($k) . \" IN ( \";\n $query .= join(\", \", array_fill(0, count($v), \"?\"));\n $query .= \") AND \";\n }\n else if (gettype($v) == \"object\" && get_class($v) == \"dbContains\"){\n $query .= $v->genSql($this->genTableVar($k)) . \" AND \";\n }\n else {\n $query .= $this->genTableVar($k) . \" = ? AND \";\n }\n $this->args[] = $v;\n }\n\n $query = substr($query, 0, -4);\n\n $this->query .= $query;\n }\n\n if (isset($order))\n $this->orderBy($order);\n\n if (isset($limit))\n $this->limit($limit);\n }", "public function where($column, $value = null)\n {\n if (!isset($this->query['where'])) {\n $this->query['where'] = array();\n }\n\n // Are we merging this with the previous?\n // This is used when coming out of Model.\n if ($this->mergeNextWhere and count($this->query['where']) > 0) {\n $this->mergeNextWhere = false;\n return $this->_and($column, $value);\n }\n\n // Array? too easy\n if (is_array($column)) {\n $this->query['where'][] = $column;\n } else {\n $this->query['where'][] = array($column => $value);\n }\n\n return $this;\n }", "private function setCustomWhere()\n\t{\n\t\tif ($this->customQuery->where) {\n\t\t\t$this->where = array_merge_recursive($this->customQuery->where, $this->where);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function where(string $condition): SQL\n {\n $this->condition[] = $condition;\n return $this;\n }", "public function buildWhere(array $where = null, array &$values = [])\n {\n if ($where === null) {\n return '';\n }\n\n return 'WHERE ' . $this->buildCondition($where, $values);\n }", "protected function addWhere( $query, $key, $extraValue )\n\t{\n\t\tif ( $extraValue === 'NULL' )\n\t\t{\n\t\t\t$query->whereNull( $key );\n\t\t}\n\t\telseif ( $extraValue === 'NOT_NULL' )\n\t\t{\n\t\t\t$query->whereNotNull( $key );\n\t\t}\n\t\telseif ( Str::startsWith( $extraValue, '!' ) )\n\t\t{\n\t\t\t$query->where( $key, '!=', mb_substr( $extraValue, 1 ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query->where( $key, $extraValue );\n\t\t}\n\t}", "public function makeSearchWhere($where)\n {\n global $wpdb;\n\n if (is_search()) {\n $where = preg_replace(\n \"/\\(\\s*\" . $wpdb->posts . \".post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n \"(\" . $wpdb->posts . \".post_title LIKE $1) OR (\" . $wpdb->postmeta . \".meta_value LIKE $1)\", $where);\n\n $where .= \" AND ($wpdb->posts.post_type = '\" . $this->post_type . \"') \";\n\n if (!is_user_logged_in()) {\n $where .= 'NOT IN ( \n ( ' . $wpdb->postmeta . '.meta_key = \"title\" ) \n OR ( ' . $wpdb->postmeta . '.meta_key = \"country\" )\n ) ';\n }\n\n //Filters\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $where .= \" AND $values.meta_key='\" . $values . \"'\";\n $where .= \" AND $values.meta_value LIKE '%\" . strip_tags($_GET[$values]) . \"%'\";\n }\n }\n }\n return $where;\n }", "private function buildWhere($existing, $add)\n {\n if(empty($existing))\n return \"WHERE {$add} \";\n else\n return \"{$existing} AND {$add} \";\n }", "public function set_where(array $params) {\n $where = '';\n foreach ($params as $field_name => $field_value) {\n $where .= '`' . $field_name . '` = \\'' . $field_value . '\\' AND ';\n }\n\n $where = rtrim($where, ' AND ');\n $this->where = ' WHERE ' . $where;\n }", "public function parseWhere($where){\n $whereStr = '';\n if(is_string($where)){\n $whereStr = $where;\n }else{\n $str = array();\n foreach($where as $key => $val){\n\t$str[] = \"`$key` = \".Model::parseValue($val);\n }\n $whereStr = \"where \".implode(\" AND \", $str);\n }\n return $whereStr;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "public function where($params = array()) \n {\n $sql = $this->_data['query'] . ' WHERE ';\n if(is_array($params)) {\n $condition = $this->replaceParam($params);\n $sql .= $condition;\n $this->_data['where'] = $condition;\n } else {\n $sql .= $params;\n $this->_data['where'] = $params;\n }\n $this->_data['query'] = $sql;\n return $this;\n }", "public function andWhere($where): QueryBuilderInterface;", "protected function parseWhere($where) {\n\t\t$parser = new Parser();\n\t\t$expr = str_replace(array(' and ', ' AND ', ' or ', ' OR '), array(' && ', ' && ', ' || ', ' || '), $where);\n\t\t$expr = $parser->parse($expr);\n\t\t$tokens = $expr->get();\n\t\t$conditions = array();\n\t\t$expression = array();\n\t\t$npar = 0;\n\t\t$condition = (object)array(\n\t\t\t'operand' => '',\n\t\t\t'operator' => '',\n\t\t\t'value' => '',\n\t\t\t'inoperand' => false,\n\t\t\t'invalue' => false,\n\t\t\t'infunction' => false\n\t\t);\n\t\tforeach ($tokens as $token) {\n\t\t\tif ($condition->infunction) {\n\t\t\t\tif ($token->type == Token::T_POPEN) {\n\t\t\t\t\t$npar++;\n\t\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\t\t$npar--;\n\t\t\t\t\tif ($npar == 0) {\n\t\t\t\t\t\t$condition->infunction = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->type == Token::T_FUNCTION) {\n\t\t\t\t$condition->infunction = true;\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->isComparator()) {\n\t\t\t\t$condition->operator = $token->value;\n\t\t\t\t$condition->inoperand = false;\n\t\t\t\t$condition->invalue = true;\n\t\t\t} else if ($token->type == Token::T_POPEN) {\n\t\t\t\tif ($condition->inoperand) {\n\t\t\t\t\t$condition->operand .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else if ($condition->invalue) {\n\t\t\t\t\t$condition->value .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else {\n\t\t\t\t\t$expression[] = $token->value;\n\t\t\t\t}\n\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->value;\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else if ($token->type == Token::T_LOGICAL_AND || $token->type == Token::T_LOGICAL_OR) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->type == Token::T_LOGICAL_AND ? 'and' : 'or';\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else {\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t}\n\t\t}\n\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t}\n\t\treturn (object)array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'expression' => $expression\n\t\t);\n\t}", "public function filter_where($where = '') {\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-30 days')) . \"'\";\n return $where;\n }", "public function where($column, $operator = null, $value = null , $boolean = 'and'){\n\n $value = func_num_args() === 2 ? $operator : $value;\n $operator = func_num_args() === 2 ? '=' : $operator;\n\n //add value and operator to the where's array\n $this->wheres = compact(\"operator\",\"value\",\"column\");\n\n return $this;\n\n }" ]
[ "0.80529046", "0.8047928", "0.7629843", "0.76030505", "0.75999737", "0.75102675", "0.7478745", "0.72652566", "0.7237629", "0.72040737", "0.7203587", "0.7185795", "0.7143643", "0.70872474", "0.7086652", "0.7065527", "0.7058429", "0.7058429", "0.70533115", "0.7020729", "0.69985217", "0.6984006", "0.69696254", "0.69659185", "0.6960986", "0.69604003", "0.69571537", "0.694225", "0.6930929", "0.6891439", "0.68913907", "0.6854888", "0.6848178", "0.680653", "0.67809683", "0.6777426", "0.67465615", "0.67396486", "0.6729141", "0.671372", "0.6700403", "0.6696994", "0.66941416", "0.66777116", "0.66771275", "0.66647637", "0.66609216", "0.66608715", "0.6660035", "0.6641316", "0.6612869", "0.66032547", "0.6598057", "0.6590347", "0.65899754", "0.658775", "0.65683734", "0.6566493", "0.6565709", "0.65621823", "0.6556107", "0.6553678", "0.6541992", "0.6539979", "0.6517601", "0.65111166", "0.6503941", "0.6489739", "0.64859676", "0.64810514", "0.6477699", "0.64736253", "0.6472948", "0.64708173", "0.64678496", "0.6463428", "0.64506954", "0.6427447", "0.642265", "0.64181894", "0.64143723", "0.64034045", "0.6398532", "0.6396876", "0.6367331", "0.6359056", "0.63443995", "0.6329678", "0.63276124", "0.63247246", "0.63178027", "0.6316809", "0.6315339", "0.63140476", "0.6303868", "0.62983423", "0.62960005", "0.6294492", "0.62890774", "0.62889886", "0.62815744" ]
0.0
-1
Add a "where" to the query with syntax column => value.
public function where_assoc(array $array, $boolean = 'and', $not = false) { $type = 'assoc'; foreach ($array as $column => $values) { if($values instanceof Query) { $this->where_sub($column, $values, $boolean, $not); continue; } if ($values !== null) { $this->add_bind('where', $values); } $this->where[] = compact('column', 'values', 'boolean', 'not', 'type'); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "public function where($column, $operator, $value);", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "public function where($column, $value, $operator = '=')\n {\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public static function where($column, $value, $operator = '=');", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "protected function user_where_clause() {}", "public static function where(array $where);", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function where($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "protected function getWhereClause() {}", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function where($table,$column,$data = \"\");", "public function addWhere($where)\n {\n $this->wheres[$where] = $where;\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "abstract public function where(array $where);", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "public function where($column, $operator = null, $value = null , $boolean = 'and'){\n\n $value = func_num_args() === 2 ? $operator : $value;\n $operator = func_num_args() === 2 ? '=' : $operator;\n\n //add value and operator to the where's array\n $this->wheres = compact(\"operator\",\"value\",\"column\");\n\n return $this;\n\n }", "protected function whereColumn(Builder $query, array $where)\n {\n return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']);\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n return parent::where(...Factory::resolve(func_get_args()));\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "public function where($column, $value = null)\n {\n if (!isset($this->query['where'])) {\n $this->query['where'] = array();\n }\n\n // Are we merging this with the previous?\n // This is used when coming out of Model.\n if ($this->mergeNextWhere and count($this->query['where']) > 0) {\n $this->mergeNextWhere = false;\n return $this->_and($column, $value);\n }\n\n // Array? too easy\n if (is_array($column)) {\n $this->query['where'][] = $column;\n } else {\n $this->query['where'][] = array($column => $value);\n }\n\n return $this;\n }", "public function where($column, $operator = null, $value = null, $link = \"where\")\n {\n $this->endquery = \"\";\n// if(is_array($critere)){\n// \n// }\n// $this->columns = is_array($columns) ? $columns : func_get_args();\n\n if (is_object($column)) {\n\n if ($this->defaultjoinsetted) {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '.id';\n } else {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '_id';\n }\n\n if ($column->getId()) {\n if ($operator == \"not\") {\n $this->query .= \" != ? \";\n } else {\n $this->query .= \" = ? \";\n }\n $this->parameters[] = $column->getId();\n } else {\n $this->query .= \" is null \";\n }\n } elseif (is_array($column)) {\n if (is_array($operator)) {\n for ($index = 0; $index < count($column); $index++) {\n $this->andwhere($column[$index], \"=\", $operator[$index]);\n }\n } elseif (is_array($column[0])) {\n foreach ($column as $value) {\n $this->andwhere($value[0], $value[1], $value[2]);\n }\n } else {\n foreach ($column as $key => $value) {\n $this->andwhere($key, \"=\", $value);\n }\n }\n } else {\n $keymap = explode(\".\", $column);\n if(count($keymap) == 2){\n $this->query .= \" \" . $link . \" \" . $column;\n }else{\n $keymapattr = explode(\" \", $column);\n if(count($keymapattr) >= 2){\n $column = $keymapattr[0];\n unset($keymapattr[0]);\n $extra = implode(\" \", $keymapattr);\n $this->query .= \" \" . $link .' `'.$column.\"` \".$extra;\n }else\n $this->query .= \" \" . $link .' `'.$column.\"` \";\n }\n //$this->query .= \" \" . $link . \" \" . $column;\n if ($operator) {\n if (in_array($operator, $this->operators)) {\n $this->query .= \" \" . $operator . \" ? \";\n $this->parameters[] = $value;\n } elseif (strtolower($operator) == \"like\") {\n $this->query .= \" LIKE '%\" . $operator . \"%' \";\n } else {\n $this->query .= \" = ? \";\n $this->parameters[] = $operator;\n }\n }\n }\n\n $this->initwhereclause = true;\n\n return $this;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "public function findWhere(String $column, $value, String $operator = '=');", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function where()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n $this->addToBindings($bindings);\n $this->wheres[] = $sql;\n\n return $this;\n }", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "protected function _setWhere(&$sql, $where, $whereValues) {\n\t\t\n\t\tif (!is_null($where)) $sql.= ' WHERE ' . $where;\n\t}", "public function where($where_col_array = NULL, $value = NULL)\n {\n if(isset($where_col_array))\n {\n if (!is_array($where_col_array) && is_null($value)) {\n $this->_database->where(array($this->table.'.'.$this->primary => $where_col_array));\n } elseif (isset($value) && !is_array($value)) {\n $this->_database->where($where_col_array, $value);\n }\n elseif (isset($value) && is_array($value))\n {\n $this->_database->where_in($where_col_array,$value);\n }\n elseif (is_array($where_col_array)) {\n $this->_database->where($where_col_array);\n }\n }\n if($this->soft_deletes===TRUE)\n {\n $this->_where_trashed();\n }\n return $this;\n }", "public function getWhere($where, Database_Config $databaseConfig = NULL);", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "protected function constructWhere($where)\n {\n if (is_array($where)) {\n $equals = array();\n \n foreach ($where as $column => $value) {\n $equals[] = new Equal($column, $value);\n }\n\n $this->where = new Where(new AndOperator($equals));\n } else {\n $this->where = new Where($where);\n }\n }", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "function where($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['where'])) $this->query['where'] = array();\n\t$this->query['where'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function findAllWhere(string $column, string $operator, $value, array $with = []);", "public function where($field, $value) {\n\t$this->parseQuery->where($field, $value);\n }", "public function addWhere(string $col, $val, string $comparison = '=', bool $or = false) : void;", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "public function where($column, $condition, $value)\n\t{\n\t\t$this->_where[] = array('row' => $column, 'condition' => $condition, 'value' => $value);\n\t\treturn $this;\n\t}", "protected function whereCarried(Builder $query, $where)\n {\n return $where['column'].' '.$where['operator'].' '.$where['value'];\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= test@test.com']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "protected function getGeneralWhereClause() {}", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "public function where(string $column, string $operator, $value, string $type = null)\n {\n $type = (!isset($type)) ? \"basic\" : $type;\n\n /**\n * If the last method call is the \"not\" method\n * then toggle the not variable to true and remove\n * the call from the call stack.\n */\n $not = (!empty($this->not)) ? array_pop($this->not) : null;\n\n /**\n * If it is not the first where statement and no and(), or() method\n * was called right before this call then the logic operator will be AND\n * Else pop the first item from the queue of the logic operators.\n */\n if (!empty($this->where) && $this->logicQueue == null) {\n $this->logicQueue = 'and';\n }\n\n $logic = (empty($this->where)) ? null : $this->logicQueue;\n\n /**\n * If the value passed is an array traverse each element \n * Then pass the contents of the array to the parameters and\n * call the syntax method to build the query of the operation.\n */\n if (is_array($value)) {\n /**\n * check if any element of the array is a Builder instance\n * and unpack its contents.\n */\n $prepared_values = array_map(\n function ($value) {\n \n if ($value instanceof Builder) {\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n return \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\";\n }\n \n array_push($this->parameters, $value);\n return \"?\";\n },\n $value\n );\n $this->{\"where\".ucfirst($type)}($column, $not, $operator, $prepared_values, $type, $logic);\n return $this;\n }\n\n /**\n * If the value is an instance of Builder class\n * unpack its contents and call the syntax method to build\n * the query of the operation and then pass the parameters property\n * of the Builder object to the parameters array.\n */\n if ($value instanceof Builder) {\n $this->{\"where\".ucfirst($type)}($column, $not, $operator, \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\", $type, $logic);\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n return $this;\n }\n\n /**\n * If the value is a scalar variable then call the syntax method\n * to build the query of the operation and pass the value to the parameters.\n */\n $this->whereBasic($column, $not, $operator, \"?\", $type, $logic);\n array_push($this->parameters, $value);\n\n $this->logicQueue = null;\n\n return $this;\n }", "public function where($field, $operator, $value);", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "public function where( array $value )\n {\n $this->query('where', $value);\n }", "protected function _compile_wh($where) {\n\t\tif (is_array($where) && count($where) > 0) {\n\t\t\t$statements = array();\n\t\t\tforeach ($where as $key => $val) {\n\t\t\t\t// Get Operator\n\t\t\t\tif ($this->_has_operator($key)) {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' ' . $this->_get_operator($key) . ' ' . $this->escape($val);\n\t\t\t\t} else {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' = ' . $this->escape($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = ' WHERE ' . implode(' AND ', $statements);\n\n\t\t\treturn $query;\n\t\t} elseif (is_string($where)) {\n\t\t\treturn ' WHERE ' . $where;\n\t\t}\n\n\t\treturn '';\n\t}", "public function where($column, $operator = null, $value = null, $connector = 'AND')\n\t{\n\t\t// If a Closure is passed into the method, it means a nested where\n\t\t// clause is being initiated, so we will take a different course\n\t\t// of action than when the statement is just a simple where.\n\t\tif ($column instanceof \\Closure)\n\t\t{\n\t\t\treturn $this->whereNested($column, $connector);\n\t\t}\n\n\t\t// If passing an expression, it means we are actually doing a Raw where\n\t\tif ($column instanceof Expression)\n\t\t{\n\t\t\treturn $this->rawWhere($column->get(), $value, $connector);\n\t\t}\n\n\t\t$type = 'where';\n\n\t\tswitch ($operator = strtoupper($operator))\n\t\t{\n\t\t\tcase '=':\n\t\t\t\t// Check if we are searching for null values\n\t\t\t\tif ($value === null)\n\t\t\t\t{\n\t\t\t\t\t$type = 'whereNull';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\tcase '!=':\n\t\t\tcase '<>':\n\t\t\tcase 'LIKE':\n\t\t\tcase 'NOT LIKE':\n\t\t\t\t// Check if we are searching for null values\n\t\t\t\tif ($value === null)\n\t\t\t\t{\n\t\t\t\t\t$type = 'whereNotNull';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$this->bindings[] = $value;\n\t\t\t\tbreak;\n\n\t\t\tcase 'NOT BETWEEN':\n\t\t\t\tif ( ! is_array($value) or count($value) != 2)\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE NOT BETWEEN must be an array with 2 elements!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereNotBetween';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tcase 'BETWEEN':\n\t\t\t\tif ( ! is_array($value) or count($value) != 2)\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE BETWEEN must be an array with 2 elements!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereBetween';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IN':\n\t\t\t\tif ( ! is_array($value))\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE IN must be an array!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereIn';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tcase 'NOT IN':\n\t\t\t\tif ( ! is_array($value))\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Core\\DatabaseException('The value in WHERE NOT IN must be an array!');\n\t\t\t\t}\n\n\t\t\t\t$type = 'whereNotIn';\n\t\t\t\t$this->bindings = array_merge($this->bindings, $value);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->bindings[] = $value;\n\t\t}\n\n\t\t$this->wheres[] = compact('type', 'column', 'operator', 'value', 'connector');\n\n\t\treturn $this;\n\t}", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "public function parseWhere($where){\n $whereStr = '';\n if(is_string($where)){\n $whereStr = $where;\n }else{\n $str = array();\n foreach($where as $key => $val){\n\t$str[] = \"`$key` = \".Model::parseValue($val);\n }\n $whereStr = \"where \".implode(\" AND \", $str);\n }\n return $whereStr;\n }", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "public function where(string $key, $value);", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n if ($column === '_id') {\n $column = $this->grammar->getMetaIdExpression($this);\n }\n\n return parent::where($column, $operator, $value, $boolean);\n }", "protected function whereColumn(Builder $builder, $where): string\n {\n return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']);\n }", "function setWhere($where) {\n $this->where = $where;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and') {\n $params = func_get_args();\n\n // Remove the leading $ from operators.\n if (func_num_args() == 3) {\n $operator = &$params[1];\n\n if (starts_with($operator, '$')) {\n $operator = substr($operator, 1);\n }\n }\n\n return call_user_func_array('parent::where', $params);\n }", "public function getWhere()\n {\n return $this->where;\n }", "protected function whereBasic(Builder $query, array $where)\n {\n $value = $this->parameter($where['value']);\n\n return $this->wrap($where['column']) . ' ' . $where['operator'] . ' ' . $value;\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "protected function whereBasic(Builder $builder, $where): string\n {\n $operator = str_replace('?', '??', $where['operator']);\n $value = $this->parameter($where['value']);\n \n return $this->wrap($where['column']).' '.$operator.' '.$value;\n }", "public function where($sql)\n {\n $this->where[] = call_user_func_array('self::clause', func_get_args());\n return $this;\n }", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n $params = func_get_args();\n\n // Remove the leading $ from operators.\n if (func_num_args() == 3)\n {\n $operator = &$params[1];\n\n if (starts_with($operator, '$'))\n {\n $operator = substr($operator, 1);\n }\n }\n\n return call_user_func_array('parent::where', $params);\n }", "public function whereParenWrap() {\n $where = $this->_dqlParts['where'];\n if (count($where) > 0) {\n array_unshift($where, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "protected function getWhereClause(array $where)\n {\n if (empty($where)) {\n return '';\n }\n\n $conditions = [];\n foreach ($where as $field => $value) {\n if (is_null($value)) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"$field = '$value'\";\n }\n\n return 'WHERE ' . implode(' AND ', $conditions);\n }", "private function _process_where_single($where){\n\t\tif((!isset($where['field'])&&!isset($where['name']))||!isset($where['operator'])){\n\t\t\t$return = '';\n\t\t}else{\n\t\t\tif(!isset($where['value'])){\n\t\t\t\t$where['value'] = '';\n\t\t\t}\n\t\t\t$field\t\t = isset($where['field'])?$where['field']:$where['name'];\n\t\t\t$operator\t = strtoupper($where['operator']);\n\t\t\t$value\t\t = $where['value'];\n\t\t\t$extra\t\t = isset($where['extra'])?$where['extra']:'';\n\t\t\t$escape\t\t = isset($where['escape'])?$where['escape']:'auto'; //this can be : auto (filter/value chooses if escape or not), true (always escapes), false (never escapes)\n\t\t\t$return\t\t = '';\n\n\t\t\t//let's create some backwards compatibility\n\t\t\tswitch($operator){\n\t\t\t\tcase 'F=':\n\t\t\t\tcase 'F>':\n\t\t\t\tcase 'F<':\n\t\t\t\tcase 'F!=':\n\t\t\t\tcase 'F>=':\n\t\t\t\tcase 'F<=':\n\t\t\t\t\t//field base\n\t\t\t\t\t$operator\t = substr($operator, 1);\n\t\t\t\t\t$escape\t\t = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//fixing some non standard operators\n\t\t\tswitch($operator){\n\t\t\t\tcase '!=':\n\t\t\t\t\t$operator = '<>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//let's prepare the $where['value']\n\t\t\tswitch($operator){\n\t\t\t\tcase 'AGAINST':\n\t\t\t\t\t$value = '(';\n\t\t\t\t\tif(is_array($where['value'])){\n\t\t\t\t\t\t$value .= $this->_escape_field($where['value'][0], $escape);\n\t\t\t\t\t\t$value .= ' '.$where['value'][1];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = $this->_escape_field($where['value'], $escape);\n\t\t\t\t\t}\n\t\t\t\t\t$value .= ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'BETWEEN':\n\t\t\t\t\tif(!is_array($where['value'])){\n\t\t\t\t\t\t$where['value'] = array(0, 0);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(!isset($where['value'][0])) $where['value'][0]\t = 0;\n\t\t\t\t\t\tif(!isset($where['value'][1])) $where['value'][1]\t = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'][0], $escape).' AND '.$this->_escape_field($where['value'][1], $escape);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'NOT IN':\n\t\t\t\tcase 'IN':\n\t\t\t\t\t$value\t = '(';\n\t\t\t\t\tif(is_array($where['value'])){\n\t\t\t\t\t\tforeach($where['value'] as $k => $v){\n\t\t\t\t\t\t\t$where['value'][$k] = $this->_escape_field($where['value'][$k], $escape);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value .= implode(',', $where['value']);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value .= $this->_escape_field($where['value'], $escape);\n\t\t\t\t\t}\n\t\t\t\t\t$value .= ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'IS':\n\t\t\t\tcase 'IS NOT':\n\t\t\t\t\t//exception to _escape_field because the \"NULL\" will not need to be escaped\n\t\t\t\t\t//so the default behavior is to NOT escape\n\t\t\t\t\tif($escape===false||$escape==='auto'){\n\t\t\t\t\t\t$value = $where['value'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = '\"'.$this->db->real_escape_string($where['value']).'\"';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'FIND_IN_SET':\n\t\t\t\tcase 'NOT FIND_IN_SET':\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'], $escape);\n//\t\t\t\tif($escape === false){\n//\t\t\t\t\t$value = $where['value'];\n//\t\t\t\t}else{\n//\t\t\t\t\t$value = '\"'.$this->db->real_escape_string($where['value']).'\"';\n//\t\t\t\t}\n\t\t\t\t\t$return\t = $operator.'('.$value.','.$field.')';\n\t\t\t\t\tbreak;\n\t\t\t\t//all of those are falling into the default\n\t\t\t\t/*\n\t\t\t\t case 'REGEXP':\n\t\t\t\t case 'LIKE':\n\t\t\t\t case '=':\n\t\t\t\t case '!=':\n\t\t\t\t case '>':\n\t\t\t\t case '<':\n\t\t\t\t case '=>':\n\t\t\t\t case '=<':\n\t\t\t\t */\n\t\t\t\tdefault:\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'], $escape);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($return==''){\n\t\t\t\t$return = $field.' '.$operator.' '.$value.' '.$extra;\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "protected static function whereFormat($where){\n $whereArray = array();\n\n $operate = ' AND ';\n\n foreach ($where as $key => $set){\n if(is_string($set)){\n if(count($where) == 2){\n list($filed,$value) = $where;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($where) == 3){\n list($filed,$exp,$value) = $where;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n break;\n }elseif(is_array($set)){\n if(count($set) == 2){\n list($filed,$value) = $set;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($set) == 3){\n list($filed,$exp,$value) = $set;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n }\n\n }\n return implode($operate, $whereArray);\n }", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "protected function whereBasic(Builder $query, $where)\n {\n $value = $this->parameter($where);\n\n return $this->wrap($where['column']).' '.$where['operator'].' '.$value;\n }", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "public function buildWhere(array $where = null, array &$values = [])\n {\n if ($where === null) {\n return '';\n }\n\n return 'WHERE ' . $this->buildCondition($where, $values);\n }", "public function set_where(array $params) {\n $where = '';\n foreach ($params as $field_name => $field_value) {\n $where .= '`' . $field_name . '` = \\'' . $field_value . '\\' AND ';\n }\n\n $where = rtrim($where, ' AND ');\n $this->where = ' WHERE ' . $where;\n }", "public function whereEqual($column, $value)\n {\n if (is_int($value)) {\n $this->where_clause .= \"$column = $value\";\n } else {\n $this->where_clause .= \" $column = \" . \"'\" . $value . \"'\";\n }\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n\n if (method_exists($this->model, 'isTableShard')) {\n if ($this->model->isTableShard()) {\n $key = $this->model->getShardKey();\n $keys = array_keys($column);\n if (in_array($key, $keys)) {\n $table = $this->model->getShardTable($column[$key]);\n $this->model->setTable($table);\n $this->query->from($table);\n }\n }\n }\n\n if ($column instanceof \\Closure) {\n $column($query = $this->model->newModelQuery());\n $this->query->addNestedWhereQuery($query->getQuery(), $boolean);\n } else {\n $this->query->where(...func_get_args());\n }\n\n return $this;\n }", "private function getWhereClause($conn, $where){\n\t\tif (!is_array($where)){\n\t\t\treturn \"\";\n\t\t}\n\t\t$sql_where=\"\";\n\t\tforeach($where as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif ($sql_where!=\"\"){\n\t\t\t\t$sql_where = $sql_where . \" AND \";\n\t\t\t}\n\t\t\tif (is_array($val) ) {\n\t\t\t\tif (count($val) > 0) {\n\t\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` IN (\";\n\t\t\t\t\t$quoted_values = array();\n\t\t\t\t\tforeach ($val as $v) {\n\t\t\t\t\t\t$quoted_values[] = $this->quote($conn, $v, $field_info[\"type\"]);\n\t\t\t\t\t}\n\t\t\t\t\t$sql_where = $sql_where . implode(', ', $quoted_values).')';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` = \";\n\t\t\t\t$sql_where = $sql_where . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t\t}\n\t\t}\n\t\treturn $sql_where;\n\t}", "public function custom_where( $where = '' ){\n\n\n\t// make sure to change your meta_key to whatever you saved your user_id as here mine is _restricted_to\n\n\t\tglobal $wpdb;\n\t\t$user_id = get_current_user_id();\n\n\t\t$where .= \" OR (( $wpdb->postmeta.meta_key = '_bcit_wpd_show_product' and $wpdb->postmeta.meta_value = $user_id ))\";\n\n\t\tremove_filter( 'posts_where', array( $this, 'custom_where' ) );\n\n\t\treturn $where;\n\n\t}", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n // If the column is an array, we will assume it is an array of key-value pairs\n // and can add them each as a where clause. We will maintain the boolean we\n // received when the method was called and pass it into the nested where.\n if (is_array($column)) {\n return $this->addArrayOfWheres($column, $boolean);\n }\n\n // Here we will make some assumptions about the operator. If only 2 values are\n // passed to the method, we will assume that the operator is an equals sign\n // and keep going. Otherwise, we'll require the operator to be passed in.\n [$value, $operator] = $this->prepareValueAndOperator(\n $value,\n $operator,\n func_num_args() === 2\n );\n\n // If the columns is actually a Closure instance, we will assume the developer\n // wants to begin a nested where statement which is wrapped in parenthesis.\n // We'll add that Closure to the query then return back out immediately.\n if ($column instanceof Closure && is_null($operator)) {\n return $this->whereNested($column, $boolean);\n }\n\n // If the column is a Closure instance and there is an operator value, we will\n // assume the developer wants to run a subquery and then compare the result\n // of that subquery with the given value that was provided to the method.\n if ($this->isQueryable($column) && ! is_null($operator)) {\n $sub = $this->createSub($column);\n\n return $this->where($sub, $operator, $value, $boolean);\n }\n\n // If the given operator is not found in the list of valid operators we will\n // assume that the developer is just short-cutting the '=' operators and\n // we will set the operators to '==' and set the values appropriately.\n if ($this->invalidOperator($operator)) {\n [$value, $operator] = [$operator, '=='];\n }\n\n // If the value is a Closure, it means the developer is performing an entire\n // sub-select within the query and we will need to compile the sub-select\n // within the where clause to get the appropriate query record results.\n if ($value instanceof Closure) {\n return $this->whereSub($column, $operator, $value, $boolean);\n }\n\n // If the value is \"null\", we will just assume the developer wants to add a\n // where null clause to the query. So, we will allow a short-cut here to\n // that method for convenience so the developer doesn't have to check.\n if (is_null($value)) {\n return $this->whereNull($column, $boolean, $operator !== '=');\n }\n\n $type = 'Basic';\n\n // Now that we are working with just a simple query we can put the elements\n // in our array and add the query binding to our array of bindings that\n // will be bound to each SQL statements when it is finally executed.\n $this->wheres[] = compact(\n 'type',\n 'column',\n 'operator',\n 'value',\n 'boolean'\n );\n\n return $this;\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "public function where()\n {\n return $this->query; \n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function where(string $condition): SQL\n {\n $this->condition[] = $condition;\n return $this;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n if (!in_array(strtolower($operator), $this->operators, true)) {\n list($value, $operator) = [$operator, '='];\n }\n\n $bag = $this->packArgs(compact('column', 'operator', 'value', 'boolean'));\n\n return $this->callHook(__FUNCTION__, $bag);\n }", "private function setWhereQuery(string $method, $column, $operatorOrValue = null, $value = null)\n {\n $this->__QUERY__ = $this->__QUERY__ ?? [];\n $query = (!isset($operatorOrValue) && !isset($value)) ? ($column instanceof SubQuery ? $column->json() : $column) : (isset($operatorOrValue) && !isset($value) ? [$column, '=', $operatorOrValue] : [$column, $operatorOrValue, $value]);\n // Add the % prefix and suffix if query operator is a `like` or `match` query\n if (isset($query[1]) && (('like' === $query[1]) || ('match' === $query[1])) && isset($query[2])) {\n $query[2] = str_contains((string) $query[2], '%') ? $query[2] : '%' . (string) $query[2] . '%';\n }\n $this->appendQuery($method, $query);\n }" ]
[ "0.73719335", "0.7340082", "0.7307772", "0.7301102", "0.7257409", "0.71883595", "0.7183073", "0.71780336", "0.7109231", "0.7107252", "0.7096021", "0.70717984", "0.7044662", "0.702086", "0.7013155", "0.6980202", "0.6921116", "0.69156474", "0.6873778", "0.6864753", "0.6855273", "0.685454", "0.6847127", "0.684146", "0.68130076", "0.6798247", "0.6796333", "0.6792716", "0.67658925", "0.6757111", "0.6722715", "0.6707185", "0.6697275", "0.66820055", "0.66576505", "0.6636726", "0.6633148", "0.6632222", "0.66090643", "0.66051984", "0.658636", "0.65820134", "0.6578018", "0.65775764", "0.65775764", "0.65702957", "0.6568345", "0.65591747", "0.65483344", "0.654471", "0.65073246", "0.65053916", "0.6496136", "0.6488238", "0.64856046", "0.6449669", "0.6449133", "0.6434261", "0.6432515", "0.64187557", "0.64185655", "0.6418335", "0.6418221", "0.64144087", "0.6414174", "0.64115614", "0.6361987", "0.6360717", "0.6356509", "0.635644", "0.6348108", "0.63478994", "0.6347782", "0.6343882", "0.6318705", "0.6315959", "0.6306327", "0.63050896", "0.6304158", "0.62972236", "0.6296502", "0.6290296", "0.628341", "0.627663", "0.6276604", "0.6273231", "0.62699455", "0.6268859", "0.6249873", "0.62239844", "0.6220303", "0.6214197", "0.62094986", "0.62000376", "0.61995715", "0.61968046", "0.6191236", "0.61902684", "0.6180152", "0.6179113", "0.61728984" ]
0.0
-1
Add a subquery to the query.
public function where_sub($column, $query, $boolean = 'and', $not = false) { $type = 'sub'; $this->add_bind('where', $query->get_binds_values()); $this->where[] = compact('column', 'query', 'boolean', 'not', 'type'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function subquery() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$model = array_shift($args);\r\n\t\t$statement = array_shift($args);\r\n\t\t$this->_subqueries[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'statement' => $statement,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function subQuery() {\n $query = new SubQuery(Query::SELECT, $this->getRepository());\n $query->fields(func_get_args());\n\n return $query;\n }", "function add_sub_query($t_name, $q)\n\t{\n $str =\n \"create temporary table $t_name \" .\n ' (primary key(id)) ' .\n \"select $q[select] \" .\n \" from $this->from \" . $q['from'] .\n \" where $this->where \" .\n ($q['group_by'] ? \" group by $q[group_by]\": '') .\n ($this->limit ? \" limit $this->limit\": '');\n\n $this->sub_queries[$t_name] = $str;\n }", "public function setSubquery()\n {\n $this->isSubQuery = true;\n return $this;\n }", "public function checkSubquerySupport();", "public function selectSub($query, $as)\n {\n throw new NotImplementedException('Subselects are not implemented in Crate');\n }", "public function getSubQuery() {\r\n\t\t$subQuery = $this->_salt_obj->query();\r\n\t\t$subQuery->_salt_alias = $this->_salt_alias;\r\n\t\treturn $subQuery;\r\n\t}", "public /*overrides*/ function getLimitSubquery()\n {\n $map = reset($this->_queryComponents);\n $table = $map['table'];\n $componentAlias = key($this->_queryComponents);\n\n // get short alias\n $alias = $this->getSqlTableAlias($componentAlias);\n\n $driverName = $this->_conn->getAttribute(Doctrine_Core::ATTR_DRIVER_NAME);\n\n // initialize the base of the subquery\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n $subquery = 'SELECT ';\n } else {\n $subquery = 'SELECT DISTINCT ';\n }\n // what about composite keys?\n if (is_array($table->getIdentifier())) {\n foreach ($table->getIdentifier() as $id) {\n $primaryKey[] = $this->_conn->quoteIdentifier($alias . '.' . $id);\n }\n $subquery .= join(', ', $primaryKey);\n } else {\n $primaryKey = $alias . '.' . $table->getColumnName($table->getIdentifier());\n $subquery .= $this->_conn->quoteIdentifier($primaryKey);\n }\n\n // pgsql & oracle need the order by fields to be preserved in select clause\n if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'mssql' || $driverName == 'odbc') {\n foreach ($this->_sqlParts['orderby'] as $part) {\n // Remove identifier quoting if it exists\n $e = $this->_tokenizer->bracketExplode($part, ' ');\n foreach ($e as $f) {\n if ($f == 0 || $f % 2 == 0) {\n $partOriginal = str_replace(',', '', trim($f));\n $callback = create_function('$e', 'return trim($e, \\'[]`\"\\');');\n $part = trim(implode('.', array_map($callback, explode('.', $partOriginal))));\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n // don't add functions\n if (strpos($part, '(') !== false) {\n continue;\n }\n\n // don't add primarykey column (its already in the select clause)\n if ($part !== $primaryKey) {\n $subquery .= ', ' . $partOriginal;\n }\n }\n }\n }\n }\n\n $orderby = $this->_sqlParts['orderby'];\n $having = $this->_sqlParts['having'];\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n $subquery .= ', ' . $expr[0] . ' AS ' . $this->_aggregateAliasMap[$dqlAlias];\n }\n }\n } else {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n foreach ($having as $k => $v) {\n $having[$k] = str_replace($this->_aggregateAliasMap[$dqlAlias], $expr[0], $v);\n }\n foreach ($orderby as $k => $v) {\n $e = explode(' ', $v);\n if ($e[0] == $this->_aggregateAliasMap[$dqlAlias]) {\n $orderby[$k] = $expr[0];\n }\n }\n }\n }\n }\n\n // Add having fields that got stripped out of select\n preg_match_all('/`[a-z0-9_]+`\\.`[a-z0-9_]+`/i', implode(' ', $having), $matches, PREG_PATTERN_ORDER);\n if (count($matches[0]) > 0) {\n $subquery .= ', ' . implode(', ', array_unique($matches[0]));\n }\n\n $subquery .= ' FROM';\n\n foreach ($this->_sqlParts['from'] as $part) {\n // preserve LEFT JOINs only if needed\n if (substr($part, 0, 9) === 'LEFT JOIN') {\n $e = explode(' ', $part);\n // Fix for http://www.doctrine-project.org/jira/browse/DC-706\n // Fix for http://www.doctrine-project.org/jira/browse/DC-594\n if (empty($this->_sqlParts['orderby']) && empty($this->_sqlParts['where']) && empty($this->_sqlParts['having']) && empty($this->_sqlParts['groupby'])) {\n continue;\n }\n }\n\n $subquery .= ' ' . $part;\n }\n\n // all conditions must be preserved in subquery\n $subquery .= ( ! empty($this->_sqlParts['where']))? ' WHERE ' . implode(' ', $this->_sqlParts['where']) : '';\n $subquery .= ( ! empty($this->_sqlParts['groupby']))? ' GROUP BY ' . implode(', ', $this->_sqlParts['groupby']) : '';\n $subquery .= ( ! empty($having))? ' HAVING ' . implode(' AND ', $having) : '';\n $subquery .= ( ! empty($orderby))? ' ORDER BY ' . implode(', ', $orderby) : '';\n\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n // When using \"ORDER BY x.foo\" where x.foo is a column of a joined table,\n // we may get duplicate primary keys because all columns in ORDER BY must appear\n // in the SELECT list when using DISTINCT. Hence we need to filter out the\n // primary keys with an additional DISTINCT subquery.\n // #1038\n $quotedIdentifierColumnName = $this->_conn->quoteIdentifier($table->getColumnName($table->getIdentifier()));\n $subquery = 'SELECT doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' FROM (' . $subquery . ') doctrine_subquery_alias'\n . ' GROUP BY doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' ORDER BY MIN(ROWNUM)';\n }\n\n // add driver specific limit clause\n $subquery = $this->_conn->modifyLimitSubquery($table, $subquery, $this->_sqlParts['limit'], $this->_sqlParts['offset']);\n\n $parts = $this->_tokenizer->quoteExplode($subquery, ' ', \"'\", \"'\");\n\n foreach ($parts as $k => $part) {\n if (strpos($part, ' ') !== false) {\n continue;\n }\n\n $part = str_replace(array('\"', \"'\", '`'), \"\", $part);\n\n if ($this->hasSqlTableAlias($part)) {\n $parts[$k] = $this->_conn->quoteIdentifier($this->generateNewSqlTableAlias($part));\n continue;\n }\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\.[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('.', $match);\n\n // Rebuild the original part without the newly generate alias and with quoting reapplied\n $e2 = array();\n foreach ($e as $k2 => $v2) {\n $e2[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n $match = implode('.', $e2);\n\n // Generate new table alias\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n // Requote the part with the newly generated alias\n foreach ($e as $k2 => $v2) {\n $e[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n\n $replace = implode('.' , $e);\n\n // Replace the original part with the new part with new sql table alias\n $parts[$k] = str_replace($match, $replace, $parts[$k]);\n }\n }\n\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($parts as $k => $part) {\n if (strpos($part, \"'\") !== false) {\n continue;\n }\n if (strpos($part, '__') == false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\_\\_[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('__', $match);\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n $parts[$k] = str_replace($match, implode('__', $e), $parts[$k]);\n }\n }\n }\n\n $subquery = implode(' ', $parts);\n return $subquery;\n }", "public function subQuery()\n {\n $subQuery = clone $this;\n $subQuery->builderCache = new Query\\BuilderCache();\n\n $subQuery->isSubQuery = true;\n\n return $subQuery;\n }", "public function createSubquery(Closure $callback)\n\t{\n\t\t$query = $this->builder->newInstance()->setSubquery();\n\n\t\t$callback($query);\n\n\t\treturn $query;\n\t}", "protected function compileSubQuery(CompilableClause $clause, QueryInterface $query, $alias = null)\n {\n //TODO les alias peuvent etre les memes. Ne gene pas MySQL, voir à regénérer ceux de la subquery\n $sql = '('.$this->compileSelect($query).')';\n\n if ($alias) {\n $sql = $sql . ' as ' . $this->quoteIdentifier($clause, $alias);\n }\n\n $this->addQueryBindings($clause, $query);\n\n return $sql;\n }", "private function addWhereQuery($type, Query $subQuery) {\r\n\t\tif ($subQuery->_salt_alias == $this->_salt_alias) {\r\n\t\t\t$this->addWhereClause($type, '('.implode(' ',$subQuery->_salt_wheres).')');\r\n\t\t\t$this->linkBindsOf($subQuery, ClauseType::WHERE, ClauseType::WHERE);\r\n\t\t} else {\r\n\t\t\tthrow new SaltException(L::error_query_mixed_subquery);\r\n\t\t}\r\n\t}", "protected function getSubQuery()\n {\n return $this->db\n ->table(CommentModel::TABLE)\n ->columns(CommentModel::TABLE.'.task_id')\n ->ilike(CommentModel::TABLE.'.comment', '%'.$this->value.'%');\n }", "function addQuery() {}", "protected function get_sql_for_subquery( $query ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t// The sub-parts of a $where part\r\n\t\t$where_parts = array();\r\n\r\n\t\t$column = ( ! empty( $query['column'] ) ) ? esc_sql( $query['column'] ) : $this->column;\r\n\r\n\t\t$column = $this->validate_column( $column );\r\n\r\n\t\t$compare = $this->get_compare( $query );\r\n\r\n\t\t$inclusive = ! empty( $query['inclusive'] );\r\n\r\n\t\t// Assign greater- and less-than values.\r\n\t\t$lt = '<';\r\n\t\t$gt = '>';\r\n\r\n\t\tif ( $inclusive ) {\r\n\t\t\t$lt .= '=';\r\n\t\t\t$gt .= '=';\r\n\t\t}\r\n\r\n\t\t// Range queries\r\n\t\tif ( ! empty( $query['after'] ) )\r\n\t\t\t$where_parts[] = $wpdb->prepare( \"$column $gt %s\", $this->build_mysql_datetime( $query['after'], ! $inclusive ) );\r\n\r\n\t\tif ( ! empty( $query['before'] ) )\r\n\t\t\t$where_parts[] = $wpdb->prepare( \"$column $lt %s\", $this->build_mysql_datetime( $query['before'], $inclusive ) );\r\n\r\n\t\t// Specific value queries\r\n\r\n\t\tif ( isset( $query['year'] ) && $value = $this->build_value( $compare, $query['year'] ) )\r\n\t\t\t$where_parts[] = \"YEAR( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) )\r\n\t\t\t$where_parts[] = \"MONTH( $column ) $compare $value\";\r\n\t\telse if ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) )\r\n\t\t\t$where_parts[] = \"MONTH( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) )\r\n\t\t\t$where_parts[] = _wp_mysql_week( $column ) . \" $compare $value\";\r\n\t\telse if ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) )\r\n\t\t\t$where_parts[] = _wp_mysql_week( $column ) . \" $compare $value\";\r\n\r\n\t\tif ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )\r\n\t\t\t$where_parts[] = \"DAYOFYEAR( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['day'] ) && $value = $this->build_value( $compare, $query['day'] ) )\r\n\t\t\t$where_parts[] = \"DAYOFMONTH( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['dayofweek'] ) && $value = $this->build_value( $compare, $query['dayofweek'] ) )\r\n\t\t\t$where_parts[] = \"DAYOFWEEK( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['hour'] ) || isset( $query['minute'] ) || isset( $query['second'] ) ) {\r\n\t\t\t// Avoid notices\r\n\t\t\tforeach ( array( 'hour', 'minute', 'second' ) as $unit ) {\r\n\t\t\t\tif ( ! isset( $query[$unit] ) ) {\r\n\t\t\t\t\t$query[$unit] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ( $time_query = $this->build_time_query( $column, $compare, $query['hour'], $query['minute'], $query['second'] ) ) {\r\n\t\t\t\t$where_parts[] = $time_query;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $where_parts;\r\n\t}", "public function union(Builder $subquery)\n {\n array_push($this->union, $this->syntax->selectSyntax($subquery));\n $this->parameters = array_merge($this->parameters, $subquery->getParameters());\n \n return $this;\n }", "public function inSubquery($column, Table $subquery)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' IN ('.$subquery->buildSelectQuery().')');\n $this->values = array_merge($this->values, $subquery->getConditionBuilder()->getValues());\n }", "public function getInnerQuery()\n {\n return $this->query;\n }", "public function selectSub($query, $as)\n {\n if (! is_string($query) && get_class($query) == self::class) {\n $this->appendCacheTags($query->getCacheTags() ?? []);\n }\n\n return parent::selectSub($query, $as);\n }", "public function query() {\n /** @var Sql $query */\n $query = $this->query;\n\n $configuration = array(\n 'table' => 'node_field_revision',\n 'field' => 'vid',\n 'left_table' => 'node_field_data',\n 'left_field' => 'vid',\n 'operator' => '=',\n 'type'=>'INNER',\n 'left_query' => 'select max(vid) from node_field_revision where nid = nfr.nid',\n 'extra' => 'node_field_data.nid = nfr.nid',\n );\n\n /** @var Subquery $join */\n $join = Views::pluginManager('join')->createInstance('subquery', $configuration);\n\n $query->addRelationship(\"nfr\", $join ,'node_field_revision' );\n $query->addWhere(0, 'nfr.moderation_state', $this->value, 'IN');\n }", "protected function loadSubQueries()\n {\n foreach ($this->subQueries as $subQuery) {\n $subQuery($this->tableQuery);\n }\n }", "public function getMagicSqlSubQuery(): string;", "public function subSelect(){\n try {\n // Sparql11query.g:620:3: ( project whereClause solutionModifier ) \n // Sparql11query.g:621:3: project whereClause solutionModifier \n {\n $this->pushFollow(self::$FOLLOW_project_in_subSelect2248);\n $this->project();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_whereClause_in_subSelect2250);\n $this->whereClause();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_solutionModifier_in_subSelect2252);\n $this->solutionModifier();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function addToQuery(&$query, $tablename=\"\", $fieldaliasprefix=\"\", $rec=\"\", $level, $mode)\n {\n }", "function addToQuery(&$query, $tablename=\"\", $fieldaliasprefix=\"\", $rec, $level, $mode)\n {\n }", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "protected function wheresToSubquery(SearchableSubquery $subquery)\n {\n $bindingKey = 0;\n\n $typesToMove = [\n 'basic', 'in', 'notin', 'between', 'null',\n 'notnull', 'date', 'day', 'month', 'year',\n ];\n\n // Here we are going to move all the where clauses that we might apply\n // on the subquery in order to improve performance, since this way\n // we can drastically reduce number of joined rows on subquery.\n foreach ((array) $this->query->wheres as $key => $where) {\n $type = strtolower($where['type']);\n\n $bindingsCount = $this->countBindings($where, $type);\n\n if (in_array($type, $typesToMove) && $this->model->hasColumn($where['column'])) {\n unset($this->query->wheres[$key]);\n\n $where['column'] = $this->model->getTable().'.'.$where['column'];\n\n $subquery->getQuery()->wheres[] = $where;\n\n $whereBindings = $this->query->getRawBindings()['where'];\n\n $bindings = array_splice($whereBindings, $bindingKey, $bindingsCount);\n\n $this->query->setBindings($whereBindings, 'where');\n\n $this->query->addBinding($bindings, 'select');\n\n // if where is not to be moved onto the subquery, let's increment\n // binding key appropriately, so we can reliably move binding\n // for the next where clauses in the loop that is running.\n } else {\n $bindingKey += $bindingsCount;\n }\n }\n }", "private function currentRevisionTimeStampSubQuery() {\n /** @var \\Drupal\\Core\\Database\\Query\\SelectInterface $subQuery */\n $subQuery = $this->connection->select('node_revision', 'r2');\n $subQuery->addField('r2', 'revision_timestamp');\n $subQuery->where('r2.vid = n.vid');\n //$subQuery->orderBy('r2.revision_timestamp', 'DESC');\n //$subQuery->range(0, 1);\n return $subQuery;\n\n }", "public function whereAndQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('AND', $subQuery);\r\n\t}", "public function isSubQueried(): bool\n {\n return $this->getMethod() === self::SUBQUERY;\n }", "public function addQueryToUnion() {\n if (empty($this->query)) {\n throw new \\Exception('Cannot add an empty query to union', 500);\n }\n\n $this->union[] = $this->query;\n // Reset all vars\n $this->query = '';\n $this->where = '';\n $this->sort = '';\n\n return $this;\n }", "public function gteSubquery($column, Table $subquery)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' >= ('.$subquery->buildSelectQuery().')');\n $this->values = array_merge($this->values, $subquery->getConditionBuilder()->getValues());\n }", "protected function whereSub(Builder $query, $where)\n {\n $select = $this->compileSelect($where['query']);\n\n return $this->wrap($where['column']).' '.$where['operator'].\" ($select)\";\n }", "public function incrementSubQueryIndex(): void\n {\n $this->subQueryIndex++;\n }", "public function select(string $alias)\n {\n $query = new Select($this->driver, $this);\n $this->columns[] = array(\n 'type' => 'sub_query',\n 'query' => $query,\n 'alias' => $alias,\n );\n return $query;\n }", "public function addSubQueryValues(Select $subQuery): void\n {\n /** @var mixed $nestedValue */\n foreach ($subQuery->getValues() as $nestedIndex => $nestedValue) {\n $index = $this->getSubQueryIndexPrefix() . $nestedIndex;\n $this->indexedValues[$index] = $nestedValue;\n }\n\n $this->incrementSubQueryIndex();\n }", "protected function get_es_subquery( $query, $es_query ) {\n\t\tglobal $wpdb;\n\n\t\t// The sub-parts of a $where part\n\t\t$filter_parts = array();\n\n\t\t$field = ( ! empty( $query['column'] ) ) ? esc_sql( $query['column'] ) : $this->column;\n\t\t$field = $this->validate_column( $field );\n\n\t\t$compare = $this->get_compare( $query );\n\n\t\t// Range queries, we like range queries\n\t\tif ( ! empty( $query['after'] ) || ! empty( $query['before'] ) ) {\n\t\t\t$inclusive = ! empty( $query['inclusive'] );\n\n\t\t\tif ( $inclusive ) {\n\t\t\t\t$lt = 'lte';\n\t\t\t\t$gt = 'gte';\n\t\t\t} else {\n\t\t\t\t$lt = 'lt';\n\t\t\t\t$gt = 'gt';\n\t\t\t}\n\n\t\t\t$range = array();\n\n\t\t\tif ( ! empty( $query['after'] ) ) {\n\t\t\t\t$range[ $gt ] = $this->build_datetime( $query['after'], ! $inclusive );\n\t\t\t}\n\n\t\t\tif ( ! empty( $query['before'] ) ) {\n\t\t\t\t$range[ $lt ] = $this->build_datetime( $query['before'], $inclusive );\n\t\t\t}\n\n\t\t\tif ( ! empty( $range ) ) {\n\t\t\t\t$filter_parts[] = $es_query->dsl_range( $es_query->es_map( $field ), $range );\n\t\t\t}\n\t\t\tunset( $range );\n\t\t}\n\n\t\t// Legacy support and field renaming\n\t\tif ( isset( $query['monthnum'] ) ) {\n\t\t\t$query['month'] = $query['monthnum'];\n\t\t}\n\t\tif ( isset( $query['w'] ) ) {\n\t\t\t$query['week'] = $query['w'];\n\t\t}\n\t\tif ( isset( $query['w'] ) ) {\n\t\t\t$query['week'] = $query['w'];\n\t\t}\n\t\tif ( isset( $query['dayofyear'] ) ) {\n\t\t\t$query['day_of_year'] = $query['dayofyear'];\n\t\t}\n\t\tif ( isset( $query['dayofweek'] ) ) {\n\t\t\t// We encourage you to store the day_of_week according to ISO-8601 standards.\n\t\t\t$day_of_week = $query['dayofweek'] === 1 ? 7 : $query['dayofweek'] - 1;\n\n\t\t\t// This is, of course, optional. Use this filter to manipualte the value however you'd like.\n\t\t\t$query['day_of_week'] = apply_filters( 'es_date_query_dayofweek', $day_of_week, $query['dayofweek'] );\n\t\t}\n\n\t\tforeach ( array( 'year', 'month', 'week', 'day', 'day_of_year', 'day_of_week' ) as $date_token ) {\n\t\t\tif ( isset( $query[ $date_token ] ) && $part = $this->build_dsl_part( $es_query->es_map( \"{$field}.{$date_token}\" ), $query[ $date_token ], $compare ) ) {\n\t\t\t\t$filter_parts[] = $part;\n\t\t\t}\n\t\t}\n\n\t\t// Avoid notices\n\t\t$query = wp_parse_args( $query, array( 'hour' => null, 'minute' => null, 'second' => null ) );\n\n\t\t$time = $this->build_es_time( $compare, $query['hour'], $query['minute'], $query['second'] );\n\t\tif ( false === $time ) {\n\t\t\tforeach ( array( 'hour', 'minute', 'second' ) as $date_token ) {\n\t\t\t\tif ( isset( $query[ $date_token ] ) && $part = $this->build_dsl_part( $es_query->es_map( \"{$field}.{$date_token}\" ), $query[ $date_token ], $compare ) ) {\n\t\t\t\t\t$filter_parts[] = $part;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( $time < 1 ) {\n\t\t\t\t$filter_parts[] = $this->build_dsl_part( $es_query->es_map( \"{$field}.seconds_from_hour\" ), $time, $compare, 'floatval' );\n\t\t\t} else {\n\t\t\t\t$filter_parts[] = $this->build_dsl_part( $es_query->es_map( \"{$field}.seconds_from_day\" ), $time, $compare, 'floatval' );\n\t\t\t}\n\t\t}\n\n\t\treturn $filter_parts;\n\t}", "function augmentSQL(SQLQuery &$query) {\r\n\t}", "public function lteSubquery($column, Table $subquery)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' <= ('.$subquery->buildSelectQuery().')');\n $this->values = array_merge($this->values, $subquery->getConditionBuilder()->getValues());\n }", "private function tinydb_add_where($query)\n {\n return static::tinydb_add_where_for_pkey($this->get_id(), $query);\n }", "protected function whereSub(Builder $query, array $where)\n {\n $select = $this->compileSelect($where['query']);\n\n return $this->wrap($where['column']) . ' ' . $where['operator'] . \" ($select)\";\n }", "public function exists(Builder $subquery)\n {\n $condition = \"exists\";\n\n $this->where('', $condition, $subquery, $condition);\n \n return $this;\n }", "protected function whereSub($column, $operator, Closure $callback, $boolean)\n {\n $type = 'Sub';\n\n // Once we have the query instance we can simply execute it so it can add all\n // of the sub-select's conditions to itself, and then we can cache it off\n // in the array of where clauses for the \"main\" parent query instance.\n call_user_func($callback, $query = $this->forSubQuery());\n\n $query->grammar->compileSelect($query);\n\n if (isset($query->limit) && $query->limit == 1) {\n //Return the value, not an array of values\n $query->aqb = $query->aqb->first($query->aqb);\n }\n\n $this->wheres[] = compact(\n 'type',\n 'column',\n 'operator',\n 'query',\n 'boolean'\n );\n\n return $this;\n }", "protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }", "public function newQuery()\n {\n return $this->registerGlobalScopes($this->newQueryWithoutScopes());\n }", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "protected function createDerivedQuery(): Query\n {\n return (clone $this->baseQuery);\n }", "public function ltSubquery($column, Table $subquery)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' < ('.$subquery->buildSelectQuery().')');\n $this->values = array_merge($this->values, $subquery->getConditionBuilder()->getValues());\n }", "function addQuery($sql, $error = null, $errno = null)\n {\n //if ( $this->activated ) $this->queries[] = array('sql' => $sql, 'error' => $error, 'errno' => $errno);\n }", "public function mergeQuery(array $queryToBeAppended);", "public function multiQuery($query) {\n $this->query($query);\n }", "public function testWhereSubQuery()\n {\n $query = (new WhereBuilder($this->mockConnection))->whereSubQuery(function (Select $select) {});\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'type' => 'subQuery',\n 'select' => [],\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function gtSubquery($column, Table $subquery)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' > ('.$subquery->buildSelectQuery().')');\n $this->values = array_merge($this->values, $subquery->getConditionBuilder()->getValues());\n }", "function query($query = false, $nest = false, $field = 'post_parent') {\n\t\tglobal $wpdb;\n\t\tif(!$query) return false;\n\t\t\n\t\tif(stristr($query, 'SELECT')) {\n\t\t\t$results = $wpdb->get_results($query);\n\t\t\tif($results) {\n\t\t\t\tif($nest) return $this->nest($results, $field);\n\t\t\t\telse return $results;\n\t\t\t} else {\n\t\t\t\treturn array();\n\t\t\t}\n\t\t} else {\n\t\t\treturn $wpdb->query($query);\n\t\t}\n\t}", "protected function buildSubqueryArray(string $sql, ArrayExpression $expression): string\n {\n return 'ARRAY(' . $sql . ')' . $this->getTypeHint($expression);\n }", "function query() {\n $this->add_additional_fields();\n }", "private function createSubpageQuery($subpageQuery, $pageNo)\r\n {\r\n # the total number of pages to one.\r\n if($this->mItemCount <= ROWS_PER_VIEW)\r\n {\r\n $pageNo = 1;\r\n $this->mTotalPages = 1;\r\n }\r\n # Otherwise, calculate the total number of pages required\r\n else\r\n {\r\n $this->mTotalPages = ceil($this->mItemCount / ROWS_PER_VIEW);\r\n $startIndex = ($pageNo - 1) * ROWS_PER_VIEW;\r\n $subpageQuery .= ' LIMIT ' . $startIndex . ' , ' . ROWS_PER_VIEW;\r\n }\r\n\r\n $this->mReturnedPage = $pageNo;\r\n return $subpageQuery;\r\n }", "public function whereOrQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('OR', $subQuery);\r\n\t}", "public function buildQueryBuilderForCountWithSubQuery(QueryBuilder $queryBuilder): void\n {\n $this->qb->resetQueryParts();\n\n $this->qb->addSelect('COUNT(t1.id) AS count')\n ->from($this->table, 't1')\n ->join('t1', sprintf('(%s)', $queryBuilder->getSQL()), 't3', 't1.id = t3.id')\n ;\n }", "public function runCustomQuery($query, Database_Config $databaseConfig = NULL);", "protected function whereInSub(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' in (' . $this->compileSelect($where['query']) . ')';\n }", "protected function _transformQuery()\n {\n if (!$this->_dirty || $this->_type !== 'select') {\n return;\n }\n\n if (empty($this->_parts['from'])) {\n $this->from([$this->_repository->getAlias() => $this->_repository->table()]);\n }\n $this->_addDefaultFields();\n $this->getEagerLoader()->attachAssociations($this, $this->_repository, !$this->_hasFields);\n $this->_addDefaultSelectTypes();\n }", "protected function queryMore()\n {\n $result = $this->client->queryMore($this->queryResult->getQueryLocator());\n $this->setQueryResult($result);\n $this->rewind();\n }", "public function newQuery()\n {\n $query = parent::newQuery();\n\n if ($this->usesTimestamps()) {\n $table = $this->getTable();\n $columns = ['*'];\n foreach ($this->getDates() as $dateColumn) {\n $columns[] = DB::raw(\"CONCAT($table.$dateColumn) AS $dateColumn\");\n }\n $query->addSelect($columns);\n }\n\n return $query;\n }", "function query() {\n $this->ensure_my_table();\n $value = $this->parse_gis_location();\n $this->query->add_where($this->options['group'], \"$this->table_alias.$this->real_field\", $value, $this->operator);\n }", "public static function getSubpageByIdQuery($id)\n {\n return Doctrine_Query::create()\n ->from('tdSubpage s')\n ->where('s.id = ?', $id);\n }", "function _buildQuery()\n\t{\t\t\n\t\t// Get the WHERE and ORDER BY clauses for the query\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\t\t$query = 'SELECT a.*, DATEDIFF(a.early_bird_discount_date, NOW()) AS date_diff, c.name AS location_name, IFNULL(SUM(b.number_registrants), 0) AS total_registrants FROM #__eb_events AS a '\n\t\t\t. ' LEFT JOIN #__eb_registrants AS b '\n\t\t\t. ' ON (a.id = b.event_id AND b.group_id=0 AND (b.published = 1 OR (b.payment_method=\"os_offline\" AND b.published != 2))) '\n\t\t\t. ' LEFT JOIN #__eb_locations AS c '\n\t\t\t. ' ON a.location_id = c.id '\t\t\t\t\t\n\t\t\t. $where\t\t\n\t\t\t. ' GROUP BY a.id '\n\t\t\t. $orderby\n\t\t;\n\t\treturn $query;\n\t}", "public function query(): QueryBuilder;", "public function appendQuery(?QueryBuilder $query = null): Builder\n {\n if ($query === null) {\n $this->queries[] = new QueryBuilder();\n } else {\n $this->queries[] = $query;\n }\n\n return $this;\n }", "function showSubcategory() {\n\n\tglobal $db;\n\n\tglobal $cat_id;\n\n\tglobal $select_sub_query;\n\n\t$query = \"SELECT * FROM sub_category WHERE cat_name_id = $cat_id\";\n\n\t$select_sub_query = mysqli_query($db, $query);\n\n\tconfirmQuery($select_sub_query);\n\n\n}", "public function query() {\n if (!empty($this->value)) {\n $this->ensureMyTable();\n $field = \"$this->tableAlias.nid\";\n\n $configuration = array(\n 'type' => 'INNER',\n 'table' => 'menu_link_content_data',\n 'field' => 'link__uri',\n 'left_table' => 'node_field_data',\n 'left_field' => 'nid',\n 'operator' => '=',\n );\n $join = Views::pluginManager('join')->createInstance('standard', $configuration);\n $this->query->addRelationship('my_uu', $join, 'node_field_data');\n $this->query->addWhere($this->options['group'], $field, $this->value, '=');\n }\n }", "public function addQuery($sql = '', $comment = '', $option = ''){\n\t\t$this->_queries[] = array(\n\t\t\t'sql' => $sql,\n\t\t\t'comment' => $comment,\n\t\t\t'option' => $option\n\t\t);\n\n\t\treturn $this;\n\t}", "public function get_sql() {\r\n\t\t// The parts of the final query\r\n\t\t$where = array();\r\n\r\n\t\tforeach ( $this->queries as $key => $query ) {\r\n\t\t\t$where_parts = $this->get_sql_for_subquery( $query );\r\n\t\t\tif ( $where_parts ) {\r\n\t\t\t\t// Combine the parts of this subquery into a single string\r\n\t\t\t\t$where[ $key ] = '( ' . implode( ' AND ', $where_parts ) . ' )';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Combine the subquery strings into a single string\r\n\t\tif ( $where )\r\n\t\t\t$where = ' AND ( ' . implode( \" {$this->relation} \", $where ) . ' )';\r\n\t\telse\r\n\t\t\t$where = '';\r\n\r\n\t\t/**\r\n\t\t * Filter the date query WHERE clause.\r\n\t\t *\r\n\t\t * @since 3.7.0\r\n\t\t *\r\n\t\t * @param string $where WHERE clause of the date query.\r\n\t\t * @param WP_Date_Query $this The WP_Date_Query instance.\r\n\t\t */\r\n\t\treturn apply_filters( 'get_date_sql', $where, $this );\r\n\t}", "protected function applyAdditionalStatementToIndex($query)\n {\n return $query;\n }", "public function queryMore($queryLocator);", "public function queryBuilder();", "public function queryBuilder();", "protected function compileComplexAggregate(CompilableClause $query)\n {\n list($function, $column) = $query->statements['aggregate'];\n\n $query->statements['aggregate'] = null;\n $query->statements['columns'] = $column === '*' ? [] : [['column' => $column, 'alias' => null]];\n\n return 'SELECT '.$this->compileAggregate($query, $function, '*', false).' FROM ('.$this->doCompileSelect($query).') as derived_query';\n }", "public function withQuery(array $query);", "public function newQuery();", "public function selectSum(string $field, $as=FALSE): QueryBuilderInterface\n\t{\n\t\t// Create the select string\n\t\t$this->state->appendSelectString(' SUM'.$this->_select($field, $as));\n\t\treturn $this;\n\t}", "public function processSelect(Builder $query, $results);", "public function addQuery($sql, $error = null, $errno = null, $query_time = null)\n {\n if ($this->activated) {\n $this->queries[] = array(\n 'sql' => $sql, 'error' => $error, 'errno' => $errno, 'query_time' => $query_time\n );\n }\n }", "private function buildQuery( array $request )\n\t{\n\t\treturn $this->buildSelect($request);\n\t}", "public function buildQuery($query)\n\t{\n\t\t$sql = isset($query['distinct']) && $query['distinct'] ? 'SELECT DISTINCT' : 'SELECT';\n\t\t\n\t\t$sql.= isset($query['calc_found_rows']) ? \" \".$query['calc_found_rows'] : \"\";\n\t\t\n\t\t$sql.=' ' . (isset($query['select']) ? $query['select'] : '* ');\n\n\t\tif (isset($query['from']))\n\t\t\t$sql.=\"\\nFROM \" . $query['from'];\n\t\telse\n\t\t\tthrow new \\GO\\Base\\Exception\\Database('The DB query must contain the \"from\" portion.');\n\n\t\tif(isset($query['join']))\n $sql.=\"\\n\".(is_array($query['join']) ? implode(\"\\n\",$query['join']) : $query['join']);\n\n\t\t\n\t\tif (isset($query['where']))\n\t\t\t$sql.=\"\\nWHERE \" . $query['where'];\n\n\t\tif (isset($query['order']))\n\t\t\t$sql.=\"\\nORDER BY \" . $query['order'];\n\n\t\t$limit = isset($query['limit']) ? (int) $query['limit'] : -1;\n\t\t$offset = isset($query['offset']) ? (int) $query['offset'] : -1;\n\t\tif ($limit >= 0 || $offset > 0)\n\t\t\t$sql = $this->_connection->applyLimit($sql, $limit, $offset); //TODO: works for mysql progressql and sqlite only\n\n\t\treturn $sql;\n\t}", "function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}", "public function scopeSubGrado($query, $subGrado)\n {\n if (isset($subGrado))\n {\n return $query->whereHas('subGrados', function ($query) use ($subGrado) {\n return $query->where('id', $subGrado);\n });\n }\n }", "function addToQuery(&$query, $tablename=\"\", $fieldaliasprefix=\"\", $rec, $level, $mode)\n {\n $languages = $this->getLanguages();\n if(!$this->isMlNode())\n {\n if ($mode == \"add\" || $mode == \"update\")\n {\n for ($i=0,$_i=count($languages);$i<$_i;$i++)\n {\n $query->addField($this->fieldName().'_'.$languages[$i],$this->escapeSQL($rec[$this->fieldName()][$languages[$i]]),\"\",\"\",!$this->hasFlag(AF_NO_QUOTES));\n }\n }\n else\n {\n for ($i=0,$_i=count($languages);$i<$_i;$i++)\n {\n $query->addField($this->fieldName().'_'.$languages[$i],\"\",$tablename,$fieldaliasprefix,!$this->hasFlag(AF_NO_QUOTES));\n }\n }\n }\n else\n {\n // when this node has multilanguage support we save multiple records per occurance\n // we only add the default language to this query\n parent::addToQuery($query,$tablename,$fieldaliasprefix,$rec,$level,$mode);\n }\n }", "abstract public function newQuery();", "protected function initQuery(): SelectQuery\n {\n return $this->source->getDatabase()->select()->from($this->getJoinTable());\n }", "public static function getActiveSubpageByIdQuery($id)\n {\n return Doctrine_Query::create()\n ->from('tdSubpage s')\n ->where('s.active = 1')\n ->andWhere('s.id = ?', $id);\n }", "public function getQuery() : QueryBuilder\n {\n return $this->query;\n }", "public function toBase() : QueryBuilder\n {\n return $this->applyScopes()->getQuery();\n }", "private function addCollectionQuery($query = '')\n {\n if(!empty($query)){\n $this->collectionQuery[] = $query;\n }\n }", "public function addAggregationsToQuery(Query $query): Query\n {\n $termsAggregation = new Terms('titles');\n $termsAggregation->setField('live_frameworks.title');\n $termsAggregationRmNumber = new Terms('rm_number');\n $termsAggregationRmNumber->setField('live_frameworks.rm_number');\n $termsAggregationRmNumber->setSize(1);\n $termsAggregation->addAggregation($termsAggregationRmNumber);\n $nestedAggregation = new Nested('frameworks', 'live_frameworks');\n $nestedAggregation->addAggregation($termsAggregation);\n $termsAggregation->setSize(1000);\n\n return $query->addAggregation($nestedAggregation);\n }", "private function addConditionToQuery($sqlPart) {\n if (empty($sqlPart)) {\n return;\n }\n $this->sql .= $sqlPart;\n }", "protected function appendSql($string)\n {\n $this->selectSQL .= $string;\n return $this;\n }", "public function query() {\n $this->field_alias = $this->real_field;\n }", "public function addAggregation($aggregate)\n {\n $aggregateQuery = new AggregateQuery(\n $this->connection,\n $this->parentName,\n [\n 'query' => $this->query,\n 'limitToLast' => $this->limitToLast\n ],\n $aggregate\n );\n\n return $aggregateQuery;\n }" ]
[ "0.67563033", "0.6746011", "0.6679187", "0.66543424", "0.6610735", "0.641384", "0.6250226", "0.6211717", "0.61828977", "0.5945408", "0.58553743", "0.57506245", "0.57254475", "0.5716918", "0.5710541", "0.56976575", "0.5638616", "0.5617864", "0.5570998", "0.5538112", "0.5537016", "0.5534135", "0.5520356", "0.5495664", "0.54875195", "0.544318", "0.543518", "0.5426545", "0.5404671", "0.5362522", "0.53572834", "0.533056", "0.53016967", "0.5292269", "0.52748764", "0.5271009", "0.52689683", "0.52060235", "0.5168715", "0.51184773", "0.5087013", "0.5073294", "0.5050535", "0.50250864", "0.501479", "0.50099325", "0.50078386", "0.5003967", "0.50002766", "0.50001705", "0.4995102", "0.49847385", "0.49740282", "0.49643594", "0.49642634", "0.49194938", "0.48962972", "0.48938012", "0.48924577", "0.4891222", "0.48686028", "0.48658633", "0.48635587", "0.48615983", "0.4856028", "0.48258072", "0.48196384", "0.48191303", "0.4814335", "0.48122332", "0.47949788", "0.47947183", "0.47936675", "0.4783302", "0.47683546", "0.4767068", "0.47613567", "0.47613567", "0.4761157", "0.4745449", "0.4742593", "0.47342807", "0.47331065", "0.47319323", "0.472996", "0.47264406", "0.47220683", "0.47132477", "0.47020608", "0.46925962", "0.46904516", "0.4684313", "0.46820992", "0.4676731", "0.46754134", "0.46738824", "0.46558055", "0.46557835", "0.46485266", "0.46480307" ]
0.46934107
89
Determine if any row exists as a result of this query
public function exists() { $sql = $this->builder->exists($this); $rs = $this->db->select_one($sql, $this->get_binds_values()); $row = (array) $rs; return (bool) $row['exist']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function has_results() {\n\t\treturn ($this->QueryID && $this->record_count() !== 0);\n\t}", "public function hasResults() {\n\t\treturn $this->count() >= 1;\n\t}", "function dbResultExists($query) {\n\t$result = dbQuery($query);\n\t$row = mysqli_fetch_array($result);\n\tif(!empty($row)) { return(true); }\n\treturn(false);\n}", "public function hasRows()\n\t{\n\t\treturn count($this->getRows()) > 0;\n\t}", "public function has_result()\n\t{\n\t\treturn !empty($this->result);\n\t}", "public function hasResult()\n {\n return Claroline::getDatabase()->query( \"\n SELECT\n user_id\n FROM\n `{$this->tbl['examination_score']}`\n WHERE\n user_id = \" . Claroline::getDatabase()->escape( $this->userId )\n )->numRows();\n }", "public function hasResult()\n\t{\n\t\treturn isset($this->result);\n\t}", "abstract public function hasRow();", "public function hasResults()\n {\n return $this->matches && $this->matches->exists();\n }", "public function exists()\n {\n return (bool)$this->where->count(1);\n }", "public function hasResult(): bool\n {\n return ! is_null($this->result);\n }", "private function exist() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE \"\n . \"product_category_id= :cat_id and product_id= :prod_id \");\n $stmt->bindValue(\":cat_id\", $this->product_category_id, \\PDO::PARAM_INT);\n $stmt->bindValue(\":prod_id\", $this->product_id, \\PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch();\n }", "public function exists() {\n\t\tglobal $config;\n\t\t\n\t\tif(!empty($this->data['id']))\n\t\t\t$where = 'id = '.$this->data['id'];\n\t\telseif(!empty($this->data['fbid']))\n\t\t\t$where = 'fbid = '.$this->data['fbid'];\n\t\n\t\t$result = $config['database']->query(\"\n\t\t\tSELECT id\n\t\t\tFROM nuusers\n\t\t\tWHERE $where\n\t\t\tLIMIT 1\n\t\t\");\n\t\t\n\t\treturn $result->num_rows;\n\t}", "function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM REPORT WHERE titleFileVideo = ? AND idArt = ?\");\n\t\t\t$exist->execute(array($this->titleFileVideo, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}", "public function exists(){\n\t\treturn ($this->count() > 0);\n\t}", "public function isHasResults();", "private function _exists($uid){\n $select = $this->select()\n ->from($this->_name,array('uid'))\n ->where('uid = ?', $uid);\n $row = $this->fetchRow($select);\n\t\t\n // Zend_Debug::dump($select->__toString());\n if($row){\n return true;\n }\n return false;\n \n }", "function recordExists()\n {\n global $objDatabase;\n\n $query = \"\n SELECT 1\n FROM \".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products\n WHERE id=$this->id\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult || $objResult->EOF) return false;\n return true;\n }", "public function exist()\n {\n return ($this->count() > 0);\n }", "public function hasResults();", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "function exists() {\n\t return !empty($this->id);\n\t}", "public function hasResults() {\n return 0 < count($this->getResults());\n }", "public function hasResult();", "public function hasResult();", "public function hasResult();", "public function has_results()\r\n {\r\n \t$tbl_stats = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);\r\n\t\t$sql = 'SELECT count(exe_id) AS number FROM '.$tbl_stats\r\n\t\t\t\t.\" WHERE exe_cours_id = '\".$this->get_course_code().\"'\"\r\n\t\t\t\t.' AND exe_exo_id = '.$this->get_ref_id();\r\n \t$result = api_sql_query($sql, __FILE__, __LINE__);\r\n\t\t$number=mysql_fetch_row($result);\r\n\t\treturn ($number[0] != 0);\r\n }", "public function exists()\n {\n $result = self::select(\"*\",0,\"invoice_no = ?\", $this->invoice_no);\n if($result->rowCount() >= 1)\n return true;\n return false;\n }", "public function checkResult() {\n\t\treturn ($this->_query_result !== false);\n\t}", "public function valid()\n {\n return isset($this->resultSet[$this->key()]);\n }", "public function exists(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$bReturn = false;\r\n\r\n\t\t\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE dsh_id = ?\";\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\t$totalRow = $ks_db->fetchOne ( $sql, $this->id );\r\n\r\n\t\t\tif ($totalRow > 0) {\r\n\t\t\t\t$bReturn = true;\r\n\t\t\t}else {\r\n\t\t\t\t$bReturn = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn $bReturn;\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "protected function metaRowExists($id_meta){\r\n\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaDataTableName.\" WHERE id_meta = \".(int)$id_meta.\" AND \".$this->metaConnectId.\" = \".$this->id);\r\n\treturn count($res);\r\n}", "function isEmptyQuery($resource) {\n\t// Deal with the result from doQuery()\n\tif ( NULL != $resource ) {\n\t\t$num_row = mysqli_num_rows($resource);\n\t\tif ( $num_row && 0 < $num_row )\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "public function hasRowContents(){\n return $this->_has(1);\n }", "function is_rowid_exist($rowid,$db_table='') {\r\n $db_table = $db_table == '' ? $this->db_table : $GLOBALS['dbpre'].$db_table;\r\n $sql = 'select 1 from '.$db_table.' where rowid='.intval($rowid);\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n return mysql_num_rows($res);\r\n }", "public function query_and_count($sql) \n {\n $exists = array_shift($this->query_and_fetch_one($sql));\n return ($exists > 0) ? true : false;\n }", "function exists()\r\n\t{\r\n\t\treturn ( ! empty($this->id));\r\n\t}", "final public function hasResults()\n {\n return boolval($this->results);\n }", "public function exists() {\n\t\treturn !is_null($this->id);\n\t}", "public function exists()\n {\n return !empty($this->data);\n }", "public function hasResult(){\n return $this->_has(2);\n }", "public function exists()\n {\n return !empty($this->ID);\n }", "public function hasResult($name)\n {\n return isset($this->results[$name]);\n }", "function emptyResult() {\r\n\t if(mysqli_num_rows($this->result) > 0){\r\n\t\t return false;\r\n\t }else{\r\n\t\t return true;\r\n\t }\r\n\t \r\n }", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "public function exists() {\n\t\tglobal $wpdb, $bp;\n\n\t\t// Check cache first\n\t\t$cached = wp_cache_get( $this->field_id, 'bp_xprofile_data_' . $this->user_id );\n\n\t\tif ( $cached && ! empty( $cached->id ) ) {\n\t\t\t$retval = true;\n\t\t} else {\n\t\t\t$retval = $wpdb->get_row( $wpdb->prepare( \"SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d\", $this->user_id, $this->field_id ) );\n\t\t}\n\n\t\treturn apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, $this ) );\n\t}", "public function isRowExist(array $rowData): bool\n {\n $connection = $this->getConnection();\n\n //Raw query is more faster on big bunch of data\n //phpcs:ignore Magento2.SQL.RawQuery.FoundRawSql\n $select = 'SELECT 1 FROM `' . $this->getMainTable() . '` WHERE ';\n $select .= 'method_id=' . (int)$rowData[ShippingTableRateInterface::METHOD_ID];\n unset($rowData[ShippingTableRateInterface::METHOD_ID]);\n\n foreach ($rowData as $columnKey => $value) {\n $description = $this->describeTable->getColumnDescribe($columnKey);\n if ($description['IDENTITY']) {\n continue;\n }\n\n $value = $rowData[$columnKey] ?? $description['DEFAULT'];\n\n if ($value === null && $description['NULLABLE']) {\n $select .= ' AND `' . $columnKey . '` IS NULL';\n continue;\n }\n\n // because for users value in db null or '' are the same\n if ($value === '' && $description['NULLABLE'] && $description['DATA_TYPE'] === 'varchar') {\n $select .= ' AND (`' . $columnKey . '` IS NULL OR `'\n . $columnKey . '` = ' . $this->quoteValue->quoteValue($columnKey, $value) . ')';\n continue;\n }\n\n $value = $this->quoteValue->quoteValue($columnKey, $value);\n\n $select .= ' AND `' . $columnKey . '` = ' . $value;\n }\n\n $select .= ' LIMIT 1';\n //phpcs:ignore Magento2.SQL.RawQuery.FoundRawSql\n $select = 'SELECT EXISTS (' . $select . ')';\n\n return (bool)$connection->fetchOne($select);\n }", "function existe($tabla,$campo,$where){\n\treturn (count(CON::getRow(\"SELECT $campo FROM $tabla $where\"))>0)?true:false;\n}", "public function hasRows($sql_result = null)\n {\n if( !$sql_result ){\n $sql_result = $this->result;\n }\n \n $numRows = $sql_result->num_rows;\n \n if( $numRows > 0 ){\n return true;\n }\n \n return false;\n }", "public function exists()\n {\n return $this->count() > 0;\n }", "public function exists(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\t\t\t\r\n\t\t\t$bReturn = false;\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE lp_id = ?\";\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\t$totalRow = $ks_db->fetchOne ( $sql, $this->id );\r\n\t\t\t\r\n\t\t\tif ($totalRow > 0) {\r\n\t\t\t\t$bReturn = true;\r\n\t\t\t}else {\r\n\t\t\t\t$bReturn = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $bReturn;\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function userExists()\r\n {\r\n $sql = \"SELECT COUNT(*) FROM (SELECT * FROM doctors WHERE email = :email) AS subquery\";\r\n\r\n $query = $this->db_connection->prepare($sql);\r\n $query->bindValue(':email', $this->email);\r\n $query->execute();\r\n\r\n while($result_row = $query->fetch() ){\r\n if($result_row[0] == 1) return true;\r\n else return false;\r\n }\r\n\r\n return false; \r\n }", "public function fetchHasResults($q = '')\r\n {\r\n return $this->hasResults($this->query($q));\r\n }", "function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM HISTORIC WHERE nameFile = ? AND idArt = ? \");\n\t\t\t$exist->execute(array($this->nameFile, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}", "public function single()\n {\n return count($this->queries) === 1;\n }", "function is_exists( $data, $table )\n {\n\t$this->db->where( $data );\n\t$query = $this->db->get($table);\n\t\n\tif ($query->num_rows() > 0){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n }", "public function hasRowCount(){\n return $this->_has(7);\n }", "public function exists(){\n\n\t\treturn (!empty($this->_data)) ? true : false;\n\n\t}", "function IfExists($natregno) {\r\n $conn = conn();\r\n $stmt = $conn->prepare(\"SELECT * FROM employee WHERE Natregno='$natregno';\");\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }", "public function has_results()\n\t{\n\t\treturn (bool) $this->total_results();\n\t}", "public function exists($id) {\n\t\t$q = $this->query();\n\t\t$q->select('COUNT(*)');\n\t\t$q->where('id=:id', [':id' => $id]);\n\t\treturn boolval($q->execute()->fetchColumn());\n\t}", "public function hasResults($r)\r\n {\r\n return ($this->numResults($r) > 0 ? true : false);\r\n }", "function username_exist($username) {\n\n $sql = \"SELECT id FROM users WHERE username = '$username'\";\n\n $result = query($sql);\n if(row_count($result) == 1) {\n return true;\n } else {\n return false;\n }\n}", "public function checkIfAnalyzerResultDataExist($result): bool;", "function is_exists($id) {\n $query = \"SELECT\n id\n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of user to be updated\n $stmt->bindParam(1, $id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n return ($stmt->rowCount() > 0);\n }", "public function existsData () {\n\t\tif (is_null($this->bExistsData)) {\n\t\t\t$sQuery = \"\n\t\t\t\tPREFIX skos: <\" . self::SKOS_CORE . \">\n\n\t\t\t\tSELECT ?concept\n\t\t\t\tWHERE {\n\t\t\t\t\t?concept a skos:Concept .\n\t\t\t\t}\n\t\t\t\tLIMIT 1\";\n\t\t\t$aRow = $this->oStore->query($sQuery, 'row');\n\t\t\t$this->bExistsData = count($aRow) ? TRUE : FALSE;\n\t\t}\n\n\t\treturn $this->bExistsData;\n\t}", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function isAlreadyExist(){\n \n $query = \"SELECT *\n FROM \" . $this->table . \" \n WHERE email='\".$this->email.\"'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // execute query\n $stmt->execute();\n if($stmt->rowCount() > 0){\n return true;\n }else{\n return false;\n }\n }", "private function isTalantExists($tal_name) {\n\t\t$stmt = $this->conn->prepare(\"SELECT tal_name from talants WHERE status = 1 and tal_name = ? \");\n $stmt->bind_param(\"s\",$tal_name);\n $stmt->execute();\n\t\t$stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return ($num_rows > 0); //if it has more than zero number of rows; then it sends true\n }", "public function exists()\n {\n return ! is_null($this->first([Grammar::VIRTUAL_META_ID_COLUMN]));\n }", "public function Exists()\n {\n if (!$this->BuildId) {\n return false;\n }\n\n $exists_result = pdo_single_row_query(\n 'SELECT COUNT(1) AS numrows FROM coveragesummarydiff\n WHERE buildid=' . qnum($this->BuildId));\n\n if ($exists_result && array_key_exists('numrows', $exists_result)) {\n $numrows = $exists_result['numrows'];\n if ($numrows > 0) {\n return true;\n }\n }\n return false;\n }", "function check_data($db_connection, $query)\n{\n if ($result = mysqli_query($db_connection, $query)) {\n $row = $result->fetch_assoc();\n if ($row[\"count\"] > 0) {\n return true;\n }\n return false;\n }\n}", "function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}", "function IfExists($natregno) {\r\n $conn = conn();\r\n $sql = \"SELECT * FROM users WHERE national_id='$natregno'\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (!empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }", "private function Check_If_User_Exists($query){\r\n\r\n // Send query into server\r\n $this->_db->get_Row($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "function user_id_exists($db, $user_id)\n{\n\t$sql = 'SELECT * FROM users where id=:id';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':id'=>$user_id));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "public function exists()\r\n {\r\n global $g_comp_database_system;\r\n\r\n $l_sql = \"SELECT * FROM isys_report WHERE \" . \"(isys_report__title = '\" . $g_comp_database_system->escape_string($this->m_title) . \"');\";\r\n\r\n $l_resource = $g_comp_database_system->query($l_sql);\r\n if ($g_comp_database_system->num_rows($l_resource) > 0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n } // if\r\n }", "public function exists(): bool\n {\n if ($this->shouldEmulateExecution()) {\n return false;\n }\n\n return $this->one() !== null;\n }", "function existe($tabla,$campo,$where){\n\t$query=$GLOBALS['cn']->query('SELECT '.$campo.' FROM '.$tabla.' '.$where);\n\treturn (mysql_num_rows($query)>0)?true:false;\n}", "public function hasRecord();", "public function checkIfExists(){\n $query = \"SELECT EXISTS(SELECT * FROM `Locations` \n WHERE `AccStrAdd` = :stradd AND `AccZip` = :zip AND `AccAptNum` = :aptnum)\";\n try {\n $stmt = $this->dbh->prepare($query);\n $stmt->bindParam(\":stradd\", $this->accStrAdd);\n $stmt->bindParam(\":zip\", $this->accZip);\n $stmt->bindParam(\":aptnum\",$this->accAptNum);\n $stmt->execute();\n } catch (Exception $e){\n error_log(\"Error: \" . $e->getMessage());\n }\n\n $row = $stmt->fetch(PDO::FETCH_NUM);\n\n if($row[0] == \"1\"){\n return true;\n } else {\n return false;\n }\n }", "public function any_user_exists(){\n $select_query = \"SELECT `id`, `staff_id`, `unit`, `password`, `cpassword` FROM `register_user` \";\n //check if user exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if user exists \n if(mysqli_num_rows($run_select_query) > 0){\n //check if \n return true;\n }else{\n return false;\n }\n }\n }", "public function has($uid)\n {\n $options = $this->getOptions();\n $stmt = $this->adapter->query(\n sprintf('SELECT %s FROM %s WHERE %s = \"%s\"',\n $options['column_value'],\n $options['table'],\n $options['column_key'],\n $uid\n ), Adapter::QUERY_MODE_EXECUTE\n );\n return $stmt->count() > 0;\n }", "function isAlreadyExist(){\n $query = \"SELECT *\n FROM\n \" . $this->db_table . \" \n WHERE\n username='\".$this->username.\"'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // execute query\n $stmt->execute();\n if($stmt->rowCount() > 0){\n return true;\n }\n else{\n return false;\n }\n }", "private function _executeQuery() \n\t{\n\t\t$this->_stmt->execute ( $this->_stmtData );\n\t\t\n\t\tif ($this->_stmt->rowCount () > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn $this->_stmt->errorInfo();\n\t\t}\n\t}", "public function isstudentsExisting ($student_number){\n $sqlQuery = \"SELECT count (*) as isExisting \";\n $sqlQuery .= \"FROM students \";\n $sqlQuery .= \"WHERE student_number= $student_number\";\n $result = $this -> getDbManager() -> executeSelectQuery ( $sqlQuery );\n if ( $result [0][ \" isExisting \"] == 1) return ( true );\n else return ( false );\n }", "function exists_query($query, array $params = array()) {\n\treturn (count_query($query, $params) > 0);\n}", "public function runExists() {\r\n $db = static::getDB();\r\n $stmt = $db->query(\r\n \"SELECT * FROM runboard \"\r\n . \"WHERE fromStore='$this->fromStore' \"\r\n . \"AND toStore='$this->toStore' \"\r\n . \"AND category='$this->category' \"\r\n . \"AND item='$this->item' \"\r\n );\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n \r\n return $results;\r\n }", "public function hasRowSet(){\n return $this->_has(8);\n }", "public function exists()\n {\n return ($this->id > 0) ? true : false;\n }", "public function hasPrimaryKey()\n {\n return count($this->getPrimaryKey()) > 0;\n }", "function exists($id) {\n\t\t$res = $this->query('SELECT EXISTS (SELECT * FROM `'.$this->table.'` WHERE `'.$this->primaryKey.'` = \\''.$this->escape($id).'\\')');\n\t\t$row = $res->fetch_row();\n\t\t$res->free();\n\t\treturn (bool) $row[0];\n\t}", "public static function select_exists($fields, $table_name, $args) {\n $result = self::select($fields, $table_name, $args);\n return (mysqli_num_rows($result) >= 1) ? true : false;\n }", "public function checkrow(){\n return $this->select->num_rows;\n }", "public function exists();", "public function exists();", "public function exists();", "public function isnationalitiesExisting ($id){\n $sqlQuery = \"SELECT count (*) as isExisting \";\n $sqlQuery .= \"FROM nationalities \";\n $sqlQuery .= \"WHERE id= $id\";\n $result = $this -> getDbManager() -> executeSelectQuery ( $sqlQuery );\n if ( $result [0][ \" isExisting \"] == 1) return ( true );\n else return ( false );\n }" ]
[ "0.75641125", "0.7337439", "0.72962093", "0.72803533", "0.72268933", "0.71912754", "0.7124411", "0.7072432", "0.6983328", "0.6917372", "0.6912172", "0.6888816", "0.687014", "0.6866121", "0.6865625", "0.6841919", "0.67694616", "0.67500144", "0.6738059", "0.6729712", "0.67289495", "0.6714213", "0.6690688", "0.6683437", "0.6683437", "0.6683437", "0.66753167", "0.6664374", "0.66526383", "0.66504675", "0.66431725", "0.66384006", "0.66370964", "0.66141117", "0.6613605", "0.6605628", "0.6573769", "0.6573212", "0.65710133", "0.65697306", "0.65564066", "0.65395045", "0.6535009", "0.65226203", "0.65160656", "0.65146637", "0.6507051", "0.65013015", "0.65011936", "0.64993554", "0.6497701", "0.6491678", "0.6488666", "0.64723575", "0.6470138", "0.646429", "0.64586884", "0.64147997", "0.6407952", "0.63791984", "0.63787353", "0.6375586", "0.63671005", "0.6363422", "0.63561183", "0.6350162", "0.6338887", "0.6338887", "0.6338887", "0.6337802", "0.6336183", "0.6319583", "0.6314351", "0.6298674", "0.62916094", "0.6287943", "0.62867624", "0.6282648", "0.6270436", "0.62658995", "0.6250611", "0.6248475", "0.6236192", "0.62313396", "0.6227056", "0.6225276", "0.6221705", "0.62187403", "0.62125957", "0.6208039", "0.620725", "0.6207093", "0.62006927", "0.6191238", "0.6188801", "0.6188444", "0.6185507", "0.6185507", "0.6185507", "0.6181317" ]
0.72074443
5
Add a "group by" to the query.
public function group($columns) { $columns = array_values_recursive(func_get_args()); $this->group = array_merge((array) $this->group, $columns); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function groupBy() {\n $this->sql .= 'GROUP BY inv_agent_id ';\n }", "public function groupBy($sql);", "private function sql_groupBy()\n {\n // Get WHERE statement\n $groupBy = $this->curr_tableField;\n\n // RETURN GROUP BY statement without GROUP BY\n return $groupBy;\n }", "protected function setGroup() {\r\n //var_dump($this->sql);\r\n if( $this->sqlGroupBy ) {\r\n var_dump($this->sql);\r\n $this->sql .= ' GROUP BY ' . $this->sqlGroupBy;\r\n }\r\n //var_dump($this->sql);\r\n }", "public function group_by($groupBy) \n {\n $this->sql .= \" GROUP BY \". $this->clean($groupBy);\n return $this;\n }", "protected function _compile_group_by()\n\t{\n\t\tif (count($this->qb_groupby) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->qb_groupby); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t// Is it already compiled?\n\t\t\t\tif (is_string($this->qb_groupby[$i]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this->qb_groupby[$i] = ($this->qb_groupby[$i]['escape'] === FALSE OR $this->_is_literal($this->qb_groupby[$i]['field']))\n\t\t\t\t\t? $this->qb_groupby[$i]['field']\n\t\t\t\t\t: $this->protect_identifiers($this->qb_groupby[$i]['field']);\n\t\t\t}\n\n\t\t\treturn \"\\nGROUP BY \".implode(', ', $this->qb_groupby);\n\t\t}\n\n\t\treturn '';\n\t}", "public function implicitGroupby() {\n\t\treturn true;\n\t}", "function group_by($columns = array())\n {\n if (!isset($this->object->_query_args['group_by_columns'])) {\n $this->object->_query_args['group_by_columns'] = $columns;\n } else {\n $this->object->_query_args['group_by_columns'] = array_merge($this->object->_query_args['group_by_columns'], $columns);\n }\n return $this->object;\n }", "public function group($column)\n {\n // Make column name safe\n $column = $this->san($column);\n \n // GROUP BY .. \n $this->query .= 'GROUP BY ' . $column . ' ';\n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function groupBy($sql) {\n $this->__groupBy__ = $sql;\n return $this;\n }", "public function getQueryGroupby() {\n $R = 'R_'. $this->id;\n return \"$R.value_id\";\n }", "public function get_group_by()\n\t{\n\t\treturn NULL;\n\t}", "public function groupBy($field);", "public function groupBy($field);", "public function build_group_by( $group ) {\n if ( empty( $group ) ) {\n return '';\n }\n\n return ' GROUP BY ' . $group;\n }", "protected function prepareGroupByPart()\n {\n $this->groupByQuery = 'GROUP BY ';\n $this->groupByQuery .= implode(', ', $this->groupByPart);\n $this->groupByQuery = \" {$this->groupByQuery} \";\n }", "public function groupBy() {\n $fields = func_get_args();\n\n if (is_array($fields[0])) {\n $fields = $fields[0];\n }\n\n $this->_groupBy = array_unique(array_merge($this->_groupBy, $fields));\n\n return $this;\n }", "public function &getGroupBy();", "public function getQueryGroupby() {\n // SubmittedOn is stored in the artifact\n return 'a.submitted_on';\n }", "function group_by($columns = array())\n {\n if (!is_array($columns)) {\n $columns = array($columns);\n }\n $this->object->_group_by_columns = array_merge($this->object->_group_by_columns, $columns);\n return $this->object;\n }", "public function groupby($field)\n\t\t{\n\t\t\t$this->groupby[] = $field;\n\t\t\treturn $this;\n\t\t}", "function getGroupBy() {\n return $this->getAdditionalProperty('group_by', self::DONT_GROUP);\n }", "public function group_by($columns){\n $columns = func_get_args();\n $this->_group_by = array_merge($this->_group_by, $columns);\n return $this;\n }", "public function group($str) \n {\n $this->_data['group'] = $str;\n $this->_data['query'] .= ' GROUP BY '.$str;\n return $this;\n }", "public function addGroupBy($field)\n\t{\n\t\tparent::addGroupBy($field);\n\t\treturn $this;\n\t}", "public function groupBy()\n {\n $this->groupBy = func_get_args();\n return $this;\n }", "public function groupBy($field)\n {\n $this->groupBy = $field;\n return $this;\n }", "function grouping(){\n\n return $this->db->table('posts')\n ->groupStart()\n ->where(['post_id >'=> '25', 'post_created_at <' => '1990-01-01 00:00:00'])\n ->groupEnd()\n ->orWhere('post_author', 10)\n ->join('users', 'posts.post_author=users.user_id')\n ->get()\n ->getResult();\n }", "abstract protected function _buildGroupBy( $group );", "function groupBy($column) {\n if(!is_array($column)) {\n $column = array($column);\n }\n foreach ($column as $value) {\n $this->group_by .= ', `'.str_replace('.', '`.`', $value).'`';\n }\n $this->group_by = trim($this->group_by, ', ');\n return $this;\n }", "public function groupBy($columns)\n\t{\n\t\t$this->query->groupBy = $columns;\n\t\treturn $this;\n\t}", "public function groupBy($field): QueryBuilderInterface\n\t{\n\t\tif ( ! is_scalar($field))\n\t\t{\n\t\t\t$newGroupArray = array_map([$this->driver, 'quoteIdent'], $field);\n\t\t\t$this->state->setGroupArray(\n\t\t\t\tarray_merge($this->state->getGroupArray(), $newGroupArray)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state->appendGroupArray($this->driver->quoteIdent($field));\n\t\t}\n\n\t\t$this->state->setGroupString(' GROUP BY ' . implode(',', $this->state->getGroupArray()));\n\n\t\treturn $this;\n\t}", "public function groupBy(array $fields, $order = null);", "public function group($groupBy) {\r\n $this->sqlGroupBy = $groupBy;\r\n return $this;\r\n }", "protected function buildGroupClause() {\r\n\t\t$sql = '';\r\n\t\tif (count($this->_salt_groups) > 0) {\r\n\t\t\t$sql.=' GROUP BY '.implode(', ', $this->_salt_groups);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "function groupBy($groupBy)\n {\n if (empty($groupBy)) {\n return false;\n }\n \n $columns = $this->to_string($groupBy);\n \n return 'GROUP BY ' .$columns;\n }", "protected function compileGroup(CompilableClause $query)\n {\n if (empty($query->statements['groups'])) {\n return '';\n }\n\n $fields = array_map(fn (string $group) => $query->preprocessor()->field($group), $query->statements['groups']);\n\n if ($query->isQuoteIdentifier()) {\n $fields = $this->quoteIdentifiers($query, $fields);\n }\n\n return ' GROUP BY '.implode(', ', $fields);\n }", "protected function compileGroupByStatement()\n {\n if (count($this->builderCache->groupBy) > 0) {\n for ($i = 0, $c = count($this->builderCache->groupBy); $i < $c; $i++) {\n // Is it already compiled?\n if (is_string($this->builderCache->groupBy[ $i ])) {\n continue;\n }\n\n $this->builderCache->groupBy[ $i ] = ($this->builderCache->groupBy[ $i ][ 'escape' ]\n === false OR\n $this->isLiteral(\n $this->builderCache->groupBy[ $i ][ 'field' ]\n ))\n ? $this->builderCache->groupBy[ $i ][ 'field' ]\n : $this->conn->protectIdentifiers($this->builderCache->groupBy[ $i ][ 'field' ]);\n }\n\n return \"\\n\" . sprintf(\n 'GROUP BY %s',\n implode(', ', $this->builderCache->groupBy)\n );\n }\n\n return '';\n }", "public function groupBy($columns);", "public function visitGroupClause(\n /*IGroupClause*/ $node) /*: mixed*/ {\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $key = /*(string)*/$node->getKey()->accept($this);\n\n return 'group '.$collection.' by '.$key;\n }", "function summary_query() {\r\n $this->get_query_fields();\r\n \r\n // No way to do summaries on more than one field at a time.\r\n if (count($this->query_fields) > 1) {\r\n return;\r\n }\r\n \r\n $field = $this->query_fields[0]['field'];\r\n $date_handler = $this->query_fields[0]['date_handler'];\r\n \r\n // Get the SQL format for this granularity, like Y-m,\r\n // and use that as the grouping value.\r\n $format = $date_handler->views_formats($this->options['granularity'], 'sql');\r\n $this->formula = $date_handler->sql_format($format, $date_handler->sql_field($field['fullname']));\r\n \r\n // Add the computed field.\r\n $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $this->formula, $field['query_name']);\r\n \r\n return $this->summary_basics(FALSE);\r\n }", "public function groupBy( array $group ) {\n $group = array_map(function($n) { return \"@$n\"; }, $group);\n $group = implode(' ', array_merge([count($group)], $group));\n $this->groupBy = \"GROUPBY $group\";\n return $this;\n }", "function ydgdict_group_search_results_by_entry( $groupby, $wp_query ) \n{\n if ( ! $wp_query->is_archive( 'entry' ) || ! $wp_query->is_search() || is_admin() ) return $groupby; // unchanged\n\n global $wpdb;\n\n return \" {$wpdb->posts}.ID \";\n}", "public function group_by ( $mFields )\n {\n /*\n Convert from comma separated list to array.\n */\n if (!is_array($mFields))\n {\n $mFields = explode(',', str_replace(', ', ',', $mFields));\n }\n /*\n Save.\n */\n $this->aGroupBy = array_merge($this->aGroupBy, $mFields);\n /*\n Return for method chaining.\n */\n return $this;\n }", "protected function getGroupbySql($data) {\n $str = '';\n if ($data->groupBys) {\n foreach ($data->groupBys as $group) {\n $str .= ' ' . $group['col'] . ($group['direction'] ? ' ' . strtoupper($group['direction']) : '') . ($group['option'] ? ' ' . strtoupper($group['option']) : '');\n }\n }\n\n return $str ? ' GROUP BY ' . $str : '';\n }", "function group_by($by)\r\n\t{\r\n\t\t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t$this->db->group_by($this->table . '.' . $by);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->db->group_by($by);\r\n\t\t}\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "protected function getGroupByAttribute()\n {\n return $this->fetchData[self::GROUP_CLAUSE];\n }", "public function stripGroupByForGroupByKeywordDataProvider() {}", "public function groupBy($property)\n {\n $this->group[] = $this->dbFieldName($property);\n }", "public function addGroupBy(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('group by')\n );\n\n return $this;\n }", "public function clearGroupBy() {\r\n $this->groupBy = \"\";\r\n return $this;\r\n }", "public function testGroupByBaseField() {\n $this->setupTestEntities();\n\n $view = Views::getView('test_group_by_count');\n $view->setDisplay();\n // This tests that the GROUP BY portion of the query is properly formatted\n // to include the base table to avoid ambiguous field errors.\n $view->displayHandlers->get('default')->options['fields']['name']['group_type'] = 'min';\n unset($view->displayHandlers->get('default')->options['fields']['id']['group_type']);\n $this->executeView($view);\n $this->assertStringContainsString('GROUP BY entity_test.id', (string) $view->build_info['query'], 'GROUP BY field includes the base table name when grouping on the base field.');\n }", "protected abstract function getGroupByClause(array $grouping);", "public function getGroupByResults()\n {\n return $this->group_by_results;\n }", "public function getGroupBy() {\n return $this->_groupBy;\n }", "public function reset_group_by() {\n\t\t$this->_group_by = array();\n\n\t\treturn $this;\n\t}", "public function rawGroupBy($groupBy)\n {\n $this->groupBy = new Expressions\\GroupByClause($groupBy, null, $this);\n return $this;\n }", "public function groupBy($column)\n\t{\n\t\t$this->groupings[] = $column;\n\t\treturn $this;\n\t}", "public function getGroupBy()\n {\n return $this->groupby;\n }", "public function posts_groupby_request( $groupby ) {\n if ( $this->latitude && $this->longitude && $this->distance ) {\n $distance = absint( $this->distance );\n $groupby .= \" having geo_distance < {$distance}\";\n }\n\n remove_filter( 'posts_groupby_request', array( $this, 'posts_groupby_request' ) );\n\n return $groupby;\n }", "public function groupStart(): QueryBuilderInterface\n\t{\n\t\t$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' ';\n\n\t\t$this->state->appendMap($conj, '(', 'group_start');\n\n\t\treturn $this;\n\t}", "public function groupBy($callback);", "public function groupBy($field, $asc = true)\n {\n if ($asc) {\n $this->groupBy[] = \" $this->alias.$field ASC\";\n } else {\n $this->groupBy[] = \" $this->alias.$field DESC\";\n }\n \n return $this;\n }", "public function group_by($columns)\n {\n $columns = func_get_args();\n foreach($columns as $idx => $column)\n {\n // if an array of columns is passed, flatten it\n if (is_array($column))\n {\n foreach($column as $c)\n {\n $columns[] = $c;\n }\n unset($columns[$idx]);\n }\n }\n\n $this->_group_by = array_merge($this->_group_by, $columns);\n\n return $this;\n }", "public function custom_attachments_groupby( $groupby, $query ){\n\t\tglobal $wpdb;\n\n\t\tif(!is_admin() || (!isset($query->query['post_type']) || $query->query['post_type'] != 'attachment')){\n\t\t\treturn $groupby;\n\t\t}\n\n\t\tif( is_main_query() && is_search() ){\n\t\t\t$groupby = \"{$wpdb->posts}.ID\";\n\t\t}\n\n\t\treturn $groupby;\n\t}", "protected function buildGroups(Query $query)\n {\n return count($query->getGroup()) > 0 ? ' GROUP BY '.implode(',', $query->getGroup()) : '';\n }", "public function groupBy($sGroup)\n {\n $this->clause('GROUP BY', $sGroup);\n\n return $this;\n }", "public function groupBy($fields, $overwrite = false);", "public final function resetGroupBy()\n {\n $this->group_by = '';\n return $this;\n }", "public function testBuildGroupByWithOneArgument()\n {\n $query = $this->getQuery()\n ->groupBy('param')\n ;\n\n $this->assertSame(\n 'GROUP BY param',\n $query->buildGroupBy()\n );\n }", "function setGroupBy($value) {\n if($value == self::GROUP_BY_DATE || $value == self::GROUP_BY_CLIENT || $value == self::GROUP_BY_MONTH || $value == self::GROUP_BY_YEAR) {\n return $this->setAdditionalProperty('group_by', $value);\n } else {\n return $this->setAdditionalProperty('group_by', self::DONT_GROUP);\n } // if\n }", "public function groupByProbe()\n {\n return $this\n ->reverse()\n ->reduce(function (Collection $carry, Collection $results) {\n foreach ($results as $result) {\n $carry->push($result);\n }\n return $carry;\n }, new static())\n ->groupBy('id');\n }", "public function group($sort, $direction = 'asc')\n {\n $this->clauses[] = array('group', array($sort, $direction));\n return $this;\n }", "function wc_tab_manager_tabs_posts_groupby( $groupby, $query ) {\n\tglobal $wpdb, $typenow;\n\n\tif ( 'wc_product_tab' === $typenow ) {\n\t\t$groupby = \"{$wpdb->posts}.ID\";\n\t}\n\n\treturn $groupby;\n}", "public function groupBy($columns)\n {\n return $this;\n }", "public function fetchAllGrouped($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC);\r\n }", "public function groupBy(array $groupByClause): self\n {\n $this->fetchData[self::GROUP_CLAUSE] = $groupByClause;\n\n return $this;\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function getGroupBy()\n\t\t{\n\t\t\treturn $this->groupby;\n\t\t}", "public function groupBy(string $column): self\n {\n array_push($this->groupByPart, $column);\n\n return $this;\n }", "public function groupBy(callable $function);", "public function groupBy($condition)\n {\n $this->groupbyString = $condition;\n return $this;\n }", "public function groupBy( $table, $column )\n {\n $this->groupBy = new Column($column, false, $this->addTable($table) );\n return $this;\n }", "public function addGroupBy($groupBy)\n {\n if (empty($groupBy)) {\n return $this;\n }\n\n $groupBy = is_array($groupBy) ? $groupBy : func_get_args();\n\n return $this->add('groupBy', $groupBy, true);\n }", "public function groupEnd(): QueryBuilderInterface\n\t{\n\t\t$this->state->appendMap('', ')', 'group_end');\n\n\t\treturn $this;\n\t}", "public function groupBy($groupBy)\n {\n if (empty($groupBy)) {\n return $this;\n }\n\n $groupBy = is_array($groupBy) ? $groupBy : func_get_args();\n\n return $this->add('groupBy', $groupBy, false);\n }", "public function testBuildGroupByWithTwoArguments()\n {\n $query = $this->getQuery()\n ->groupBy('param1')\n ->groupBy('param2')\n ;\n\n $this->assertSame(\n 'GROUP BY param1, param2',\n $query->buildGroupBy()\n );\n }", "public function groupBy($parameters)\n {\n $this->groupBy = $parameters;\n }", "function get_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->get_by($field, $match);\n\t}", "function group($s)\n{\n\t$this->tryModify();\n\t$this->query['group'] = $s;\n\treturn $this;\n}", "public function groupBy($columns = null)\n\t{\n\t\t$owner = $this->getOwner();\n\t\t$owner->getDbCriteria()->mergeWith(array('group' => $this->generateGroupBy($columns)));\n\t\treturn $owner;\n\t}", "function custom_search_groupby($groupby) {\r\n if ( is_search() && isset($_GET['s'])) {\r\n global $wpdb;\r\n $groupby = \" $wpdb->posts.ID \";\r\n }\r\n return($groupby);\r\n}", "public function group()\n {\n $this->doGroup('group', \\func_get_args());\n }", "public function testBuildGroupByWithTwoArgumentsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->groupBy('param1')\n ->groupBy('param2')\n ;\n\n $this->assertSame(\n 'GROUP BY alias.param1, alias.param2',\n $query->buildGroupBy()\n );\n }", "public function testBuildGroupByWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->groupBy('is_admin', 'desc')\n )\n ->groupBy('id', 'asc')\n ;\n\n $this->assertSame(\n 'GROUP BY table1_alias.id, table2_alias.is_admin',\n $query->buildGroupBy()\n );\n }", "public function groupBy($field, $escape = null)\n {\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if (is_string($field)) {\n $field = ($escape === true)\n ? explode(',', $field)\n : [$field];\n }\n\n foreach ($field as $fieldName) {\n $fieldName = trim($fieldName);\n\n if ($fieldName !== '') {\n $fieldName = ['field' => $fieldName, 'escape' => $escape];\n\n $this->builderCache->groupBy[] = $fieldName;\n }\n }\n\n return $this;\n }", "public function groupBy($columns)\n {\n if (!is_array($columns)) {\n $columns = preg_split('/\\s*,\\s*/', trim($columns), -1, PREG_SPLIT_NO_EMPTY);\n }\n $this->groupBy = $columns;\n return $this;\n }", "public function group(string ...$columns)\n {\n $this->group = $columns;\n \n return $this;\n }", "protected function compileGroups(Builder $query, array $groups)\n {\n return 'group by ' . $this->columnIze($groups);\n }", "function groupByHeader(&$conf,$GBCode,$menuRow,&$groupBy,&$lastgroupBy,&$evalGroupBy,$GrpByField,&$lc,&$gc,&$i,&$pagejump,&$sql,$end=false,&$DEBUG,$nbrow) {\n\t\t// group by field handling\n\t\t//if ($end) return;\n\t\t$GBmarkerArray=array();\n\t\t$groupByFields=\"\";\n\t\t$gbflag=0;\n\t\t$newGroupBy=array();\n\t\tif ($conf['list.']['groupByFieldBreaks']) {\n\t\t\t$fNA=t3lib_div::trimexplode(',',$conf['list.']['groupByFieldBreaks']);\n\t\t\tforeach($fNA as $fN) {\n\t\t\t\t$fN2=t3lib_div::trimexplode(':',$fN);\n\t\t\t\t$fN=$fN2[0];\n\t\t\t\t//if ($conf['list.']['hiddenGroupByField.'][$fN]) continue;\n\n\t\t\t\t$GBmarkerArray['###GROUPBY_'.$fN.'###']=\"\";\n\t\t\t\t//error_log(__METHOD__.\": -\".$groupBy[$fN].\"!==\".$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf));\n\t\t\t\tif (($groupBy[$fN]!==$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf) || $end) && !$conf['list.']['hiddenGroupByField.'][$fN]) {\n\t\t\t\t\t// Group by field change !\n\t\t\t\t\t$GBmarkerArray['###FOOTERSUM_'.$fN.'_FIELD_metafeeditnbelts###']='';\n\t\t\t\t\t//error_log(__METHOD__.\": aa- $nbrow : \".$evalGroupBy[$fN]);\n\t\t\t\t\tif ($nbrow>1) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$GBmarkerArray['###GROUPBYFOOTER_'.$fN.'###']=$evalGroupBy[$fN]; \n\t\t\t\t\t\t$this->metafeeditlib->getGroupByFooterSums($conf,'FOOTERSUM',$GBmarkerArray,$fN,$sql,$lastgroupBy,$end,$DEBUG);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFOOTERFIELD_'.$fN.'###','');\n\t\t\t\t\t}\n\t\t\t\t\t$std=$menuRow[$fN];\n\n\t\t\t\t\t// Default we get value from std group by field ...\n\t\t\t\t\tif ($GrpByField[$fN]) {\n\t\t\t\t\t $std=$menuRow[$GrpByField[$fN]];\n\t\t\t\t\t if ($menuRow['EVAL_'.str_replace('.','_',$GrpByField[$fN])]) $std=$menuRow['EVAL_'.str_replace('.','_',$GrpByField[$fN])];\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t// stdWrap on group by.\t\t\n\t\t\t\t\t$_fN=str_replace('.','_',$fN);\n\t\t\t\t\tif ($conf['list.']['groupByFields.']['stdWrap.'][$_fN.'.']) {\n\t\t\t\t\t $this->cObj->start($menuRow,$this->theTable);\n\t\t\t\t\t $std=$this->cObj->stdWrap($std,$conf['list.']['groupByFields.']['stdWrap.'][$_fN.'.']);\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t// ??? \t\n\t\t\t\t\t\n\t\t\t\t\tif ($GrpByField[$fN]) {\n\t\t\t\t\t\t$newGroupBy[$fN]=$menuRow[$GrpByField[$fN]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$newGroupBy[$fN]=$menuRow[$fN];\n\t\t\t\t\t\tif ($menuRow['EVAL_'.$_fN]) $std=$menuRow['EVAL_'.$_fN];\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\t// we set group by flag\n\t\t\t\t\t$gbflag=1;\n\t\t\t\t\t$GBmarkerArray['###GROUPBY_'.$fN.'###']=$std;\n\t\t\t\t\t$evalGroupBy[$fN]=$std;\n\t\t\t\t\t// We have to reset all son groupbys so that the headers will be regenerated...\n\t\t\t\t\t$resetgbf=FALSE;\n\t\t\t\t\tif (is_array($groupBy)) foreach ($groupBy as $gbf=>$val) {\n\t\t\t\t\t\tif ( $resetgbf) unset($groupBy[$gbf]);\n\t\t\t\t\t\tif ($gbf==$fN) $resetgbf=TRUE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// we clear unused group bys \n\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFIELD_'.$fN.'###','');\n\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFOOTERFIELD_'.$fN.'###','');\n\t\t\t\t}\n\t\t\t\t// We clear next group by if end of list is reached\n\t\t\t\tif ($end) $GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFIELD_'.$fN.'###','');\n\t\t\t}\n\t\t\tforeach($newGroupBy as $fN=>$val) {\n\t\t\t\t$groupBy[$fN]=$this->metafeeditlib->transformGroupByData($fN,$val,$conf);\n\t\t\t\t//$lastgroupBy[$fN]=$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN];\n\t\t\t\t$lastgroupBy[$fN]=$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf);\n\t\t\t}\n\t\t}\n\t\tif ($gbflag) {\n\t\t\t$groupByFields=$this->cObj->substituteMarkerArray($GBCode, $GBmarkerArray);\n\t\t\t$gc++;\n\t\t\t// Jump page on group by\n\t\t\tif ($gc>1 && $conf['list.']['jumpPageOnGroupBy']) {\n\t\t\t $pagejump=1;\n\t\t\t}\n\t\t\tif ($conf['list.']['groupBySize']) {\n\t\t\t\t$lc=$lc+$conf['list.']['groupBySize'];\n\t\t\t}\n\t\t\tif ($conf['list.']['no_detail']) $lc++; //MMM\n\n\t\t\tif ($gc>1 && $dispDir=='Right') $lc++;\n\t\t\t$i=0; // pour fin de ligne\n\t\t}\n\t\t//error_log(__METHOD__.\"end: -\".print_r($groupByFields,true)); \n\t\treturn $groupByFields;\n\t}", "public function aggregate( \\Aimeos\\MW\\Criteria\\Iface $search, $key );" ]
[ "0.73448384", "0.71061736", "0.7038702", "0.70145273", "0.6873885", "0.67164785", "0.66742504", "0.66212726", "0.66040087", "0.6578695", "0.6552176", "0.6541399", "0.6492032", "0.6492032", "0.63911796", "0.63900375", "0.6352228", "0.62707204", "0.6250877", "0.6241932", "0.61864305", "0.6160902", "0.6155389", "0.61317647", "0.6112486", "0.611136", "0.6053838", "0.6050152", "0.60127014", "0.60124487", "0.60087556", "0.6006844", "0.59797454", "0.5933563", "0.58922607", "0.5885089", "0.5880395", "0.5876092", "0.5855382", "0.58438265", "0.5838969", "0.5811186", "0.5796211", "0.57676184", "0.5766208", "0.57485634", "0.57238525", "0.5701657", "0.56624234", "0.5650809", "0.56427956", "0.563226", "0.5619434", "0.5603646", "0.5590205", "0.55886817", "0.5577427", "0.55585104", "0.5555574", "0.5553206", "0.55328804", "0.55171454", "0.5514048", "0.54955477", "0.5491049", "0.54529", "0.5436201", "0.5420952", "0.5415062", "0.5409542", "0.54081434", "0.5408027", "0.5399797", "0.5374543", "0.53662133", "0.5359585", "0.5346365", "0.53431624", "0.5334672", "0.5323611", "0.5320329", "0.5320194", "0.53080666", "0.52834934", "0.5267248", "0.52652556", "0.5258738", "0.52584076", "0.5257417", "0.5247868", "0.52381796", "0.52255726", "0.51885575", "0.51877874", "0.5183234", "0.5176564", "0.51658076", "0.5156867", "0.5156779", "0.5111453", "0.51096374" ]
0.0
-1
Add a "having" to the query.
public function having($query, array $params = array()) { $this->add_bind('having', $params); $this->having[] = compact('query', 'params'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function having($having) \n {\n $this->sql .= \" HAVING \". $this->clean($having);\n return $this;\n }", "public function having(string $having);", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "public function having($clause, array $params);", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public function having(): Having\n {\n if (!isset($this->having)){\n $this->having = new Query\\Having($this, $this->driver, $this->topQuery);\n }\n return $this->having; \n }", "public function getHaving() {\n return $this->_having ?: new Predicate(Predicate::ALSO);\n }", "public function having($sql);", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function setHaving($having)\n {\n $having = func_num_args() > 1 ? func_get_args() : $having;\n $this->having = [];\n return $this->addHaving($having);\n }", "public function having()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n $this->having[] = $args[0];\n } else {\n $this->having[] = array_shift($args);\n \n if ($count == 2 && is_array($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->having_params = array_merge($this->having_params, $args);\n }\n return $this;\n }", "function addComplexHaving($name, $having) {\n\t\t$this->addBlock('having', $name, $having);\n\t\treturn $this;\n\t}", "public function getHaving()\n {\n return $this->having;\n }", "public function addHaving($having)\n {\n $having = $this->normalisePredicates(func_get_args());\n\n // If the function is called with an array of items\n $this->having = array_merge($this->having, $having);\n\n return $this;\n }", "public function having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function having($having)\n {\n if ( ! (func_num_args() == 1 && $having instanceof Composite)) {\n $having = new Composite(Composite::TYPE_AND, func_get_args());\n }\n\n return $this->add('having', $having);\n }", "public function having($having = null) {\n\t\tif (!$having) {\n\t\t\treturn $this->_config['having'];\n\t\t}\n\t\t$this->_config['having'] = array_merge(\n\t\t\t(array) $this->_config['having'], (array) $having\n\t\t);\n\t\treturn $this;\n\t}", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function having(string $having, ...$params): Selection\n {\n $this->selection->having($having, ...$params);\n return $this;\n }", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "public function havingSQL($havingSqlStatement){\n $this->debugBacktrace();\n $this->havingClause = $havingSqlStatement;\n }", "protected function compileHaving(Builder $query, array $having)\n {\n $sql = implode(' ', array_map([$this, 'compileHaving'], $having));\n\n return 'having ' . $this->removeLeadingBoolean($sql);\n }", "function mHAVING(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$HAVING;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:64:3: ( 'having' ) \n // Tokenizer11.g:65:3: 'having' \n {\n $this->matchString(\"having\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected function buildHaving(Query $query)\n {\n $having = '';\n $data = [];\n foreach ($query->getHaving() as $key => $value) {\n //\tadd where on first loop only, AND on all others\n $having .= ($having == '' ? ' HAVING ' : ' AND ').$key;\n if (is_array($value)) {\n $data = array_merge($data, $value);\n continue;\n }\n\n $data[] = $value;\n }\n\n return ['placeholders' => $having, 'data' => $data];\n }", "protected function _buildContentHaving($q = true)\n\t{\n\t\t$filter_assigned = $this->getState('filter_assigned');\n\n\t\t$having = array();\n\n\t\tif ($filter_assigned === 'O')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) = 0';\n\t\t}\n\t\telseif ($filter_assigned === 'A')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) > 0';\n\t\t}\n\n\t\tif ($q instanceof \\JDatabaseQuery)\n\t\t{\n\t\t\treturn $having ? $q->having($having) : $q;\n\t\t}\n\n\t\treturn $q\n\t\t\t? ' HAVING ' . (count($having) ? implode(' AND ', $having) : ' 1 ')\n\t\t\t: $having;\n\t}", "public function addHaving(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('having')\n );\n\n return $this;\n }", "public function having()\n {\n $this->having = $expr = new Expression;\n $expr->driver = $this->driver;\n $expr->builder = $this;\n $expr->parent = $this;\n return $expr;\n }", "public function buildHaving(array $having = null, array &$values = [])\n {\n if ($having === null) {\n return '';\n }\n\n return 'HAVING ' . $this->buildCondition($having, $values);\n }", "public function scopeHavingFeature(EloquentBuilder $query, $feature);", "public function andHaving($having)\n {\n $having = $this->getQueryPart('having');\n $args = func_get_args();\n\n if ($having instanceof Composite && $having->getType() === Composite::TYPE_AND) {\n $having->addMultiple($args);\n } else {\n array_unshift($args, $having);\n $having = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('having', $having);\n }", "function _having($key, $value = '', $type = 'AND ', $escape = TRUE)\r\n\t{\r\n\t\t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t$this->db->_having($this->table . '.' . $key, $value, $type, $escape);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->db->_having($key, $value, $type, $escape);\r\n\t\t}\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function having(array $clauseProps){\r\n\r\n foreach ($clauseProps as $key => $value) {\r\n if(is_array($value)){\r\n if(count($value) > 0){\r\n # check that HAVING clause operator supplied is allowed !!\r\n if(!(in_array(strtoupper($value[0]), $this->allowedOperators))){\r\n throw new UnexpectedValueException();\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->queryString .= (\" HAVING \" . implode(', ', $this->prepareSelectPlaceholder($clauseProps)));\r\n\r\n return $this;\r\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "function having($key, $value = '', $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_having($key, $value, 'AND ', $escape);\r\n\t}", "public function having($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val);\n\t}", "public function not_having($having) \n {\n $this->sql .= \" NOT HAVING \". $this->clean($having);\n return $this;\n }", "public function havingCondition($field, $value = NULL, $operator = NULL);", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "public function having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'AND ', $escape);\n\t}", "public function and_having_close(){\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "protected function renderHaving() : ?string\n {\n return $this->renderWhere('having');\n }", "protected function compileBasicHaving($having): string\n {\n $column = $this->wrap($having['column']);\n\n $parameter = $this->parameter($having['value']);\n\n return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter;\n }", "public function having($conditions = null, $overwrite = false);", "protected function compileHaving(array $having): string\n {\n if ($having['type'] === 'raw') {\n return $having['boolean'].' '.$having['sql'];\n } elseif ($having['type'] === 'between') {\n return $this->compileHavingBetween($having);\n }\n\n return $this->compileBasicHaving($having);\n }", "public function orHaving(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'orHaving'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function having($expression)\n\t{\n\t\tif (!($expression === NULL || is_string($expression))) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string or NULL.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $expression;\n\t\t$this->args['having'] = array_slice(func_get_args(), 1);\n\t\treturn $this;\n\t}", "public function having($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->havings = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "public function getHavingParameterised(&$parameters)\n {\n $this->splitQueryParameters($this->having, $conditions, $parameters);\n return $conditions;\n }", "public function and_having_close()\n {\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "final public function addHaving(YMKM_SQL_Entity_Having $s)\n {\n $this->doAddHaving($s);\n return $this;\n }", "public function having(): self\n {\n $bindingsFunction = func_get_args();\n\n $sql = array_shift($bindingsFunction);\n\n $this->addToBindings($bindingsFunction);\n\n $this->havings[] = $sql;\n\n return $this;\n }", "public function having($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'AND ', $escape, 'having');\n }", "protected function compileHaving(array $having)\n {\n // If the having clause is \"raw\", we can just return the clause straight away\n // without doing any more processing on it. Otherwise, we will compile the\n // clause into Cypher based on the components that make it up from builder.\n if ($having['type'] === 'raw') {\n return $having['boolean'].' '.$having['cypher'];\n }\n\n return $this->compileBasicHaving($having);\n }", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "protected function compileBasicHaving($having)\n {\n $column = $this->wrap($having['column']);\n\n $parameter = $this->parameter($having['value']);\n\n return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter;\n }", "public function having(string $column, string $operator, $value)\n {\n /**\n * If the value is a Builder object then\n * add its parameters to the parameters array\n * and create the subquery from the syntax class\n */\n if ($value instanceof Builder) {\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n $value = \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\";\n }\n $this->having = [\"column\" => $column, \"operator\" => $operator, \"value\" => $value];\n \n return $this;\n }", "public function getHaving()\n\t\t{\n\t\t\treturn $this->havings;\n\t\t}", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "public function and_having($column, $op, $value = NULL){\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function and_having_open(){\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "protected function _having($key, $values=[], string $conj='AND'): self\n\t{\n\t\t$where = $this->_where($key, $values);\n\n\t\t// Create key/value placeholders\n\t\tforeach($where as $f => $val)\n\t\t{\n\t\t\t// Split each key by spaces, in case there\n\t\t\t// is an operator such as >, <, !=, etc.\n\t\t\t$fArray = explode(' ', trim($f));\n\n\t\t\t$item = $this->driver->quoteIdent($fArray[0]);\n\n\t\t\t// Simple key value, or an operator\n\t\t\t$item .= (count($fArray) === 1) ? '=?' : \" {$fArray[1]} ?\";\n\n\t\t\t// Put in the having map\n\t\t\t$this->state->appendHavingMap([\n\t\t\t\t'conjunction' => empty($this->state->getHavingMap())\n\t\t\t\t\t? ' HAVING '\n\t\t\t\t\t: \" {$conj} \",\n\t\t\t\t'string' => $item\n\t\t\t]);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function havingOR()\n {\n $this->having .= \" OR \";\n }", "protected function compileHavings(Builder $builder, $havings): string\n {\n $sql = implode(' ', array_map([$this, 'compileHaving'], $havings));\n\n return 'having '.$this->removeStatementBoolean($sql);\n }", "public function having($sField, $sValue, $sOperator = '=')\n {\n $this->optClause('HAVING', $sField, $sValue, $sOperator);\n\n return $this;\n }", "public function andHaving($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $this->having ? '(' . $this->having . ') AND (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('having', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public function and_having($column, $op = null, $value = null)\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function havingGte($col, $value)\n {\n $this->having .= \"$col >= $value\";\n }", "public static function buildHaving(UniqueObject $havingClause, $firstTable, $lastTable, $lastModel) {\n\t\tif ($havingClause->getModel()->getName() != 'Comhon\\Logic\\Having\\Clause') {\n\t\t\t$clauseModel = ModelManager::getInstance()->getInstanceModel('Comhon\\Logic\\Having\\Clause');\n\t\t\tthrow new ArgumentException($havingClause, $clauseModel->getObjectInstance(false)->getComhonClass(), 1);\n\t\t}\n\t\t$havingClause->validate();\n\t\t$clause = new HavingClause($havingClause->getValue('type'));\n\t\t\n\t\t/** @var \\Comhon\\Object\\UniqueObject $element */\n\t\tforeach ($havingClause->getValue('elements') as $element) {\n\t\t\tif ($element->getModel()->getName() == 'Comhon\\Logic\\Having\\Clause') { // clause\n\t\t\t\t$clause->addClause(self::buildHaving($element, $firstTable, $lastTable, $lastModel));\n\t\t\t} else { // literal\n\t\t\t\t// table is not used anymore for function \"COUNT\" because we now use COUNT(*) instead of COUNT(table.column)\n\t\t\t\t// but we keep condition just in case\n\t\t\t\t$table = $element->getModel()->getName() == 'Comhon\\Logic\\Having\\Literal\\Count' ? $firstTable : $lastTable;\n\t\t\t\t$clause->addLiteral(HavingLiteral::buildHaving($element, $table, $lastModel));\n\t\t\t}\n\t\t}\n\t\treturn $clause;\n\t}", "public function orHaving($having)\n {\n $having = $this->getQueryPart('having');\n $args = func_get_args();\n\n if ($having instanceof Composite && $having->getType() === Composite::TYPE_OR) {\n $having->addMultiple($args);\n } else {\n array_unshift($args, $having);\n $having = new Composite(Composite::TYPE_OR, $args);\n }\n\n return $this->add('having', $having);\n }", "public function and_having_open()\n {\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "public function or_having_close(){\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "public function having($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::ALSO, $field, $op, $value);\n }", "public function having($columns)\n\t{\n\t\tif (is_array($columns)) {\n\t\t\t$this->_having = array_unique(array_merge($this->_having, $columns));\n\t\t} else {\n\t\t\t$this->_having = array_unique(array_merge($this->_having, array($columns)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function or_having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'OR ', $escape);\n\t}", "public function having($conditions, $context, array $options = [])\n\t{\n\t\t$defaults = ['prepend' => 'HAVING'];\n\t\t$options += $defaults;\n\t\treturn $this->_conditions($conditions, $context, $options);\n\t}", "public function testGroupByCountOnlyFilters() {\n // Check if GROUP BY and HAVING are included when a view\n // doesn't display SUM, COUNT, MAX, etc. functions in SELECT statement.\n\n for ($x = 0; $x < 10; $x++) {\n $this->storage->create(['name' => 'name1'])->save();\n }\n\n $view = Views::getView('test_group_by_in_filters');\n $this->executeView($view);\n\n $this->assertStringContainsString('GROUP BY', (string) $view->build_info['query'], 'Make sure that GROUP BY is in the query');\n $this->assertStringContainsString('HAVING', (string) $view->build_info['query'], 'Make sure that HAVING is in the query');\n }", "public function orHaving($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val, 'OR');\n\t}", "public function having(array $filter): static\n {\n return $this->withProperty('filter', array_merge($this->filter, $filter));\n }", "public function having($field, $value = null, $comparitor = null);", "public function orHaving($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $this->having ? '(' . $this->having . ') OR (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('having', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public function or_having_close()\n {\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "public function orHaving($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'OR ', $escape, 'having');\n }", "public function or_having_open(){\n $this->_having[] = array('OR' => '(');\n\n return $this;\n }", "private function getHavingRaw($search_string) {\n\n $searchArray = explode(\" \", $search_string);\n\n static $having = '';\n //creates a having query for each incoming word\n for ($nCount = 0; $nCount < sizeof($searchArray); $nCount++) {\n if (Config::get('database.default') === 'mysql') {\n $having .= \" AND GROUP_CONCAT(descriptors.description) \" .\n \"like '%\" . strtolower(ltrim(rtrim($searchArray[$nCount]))) . \"%'\";\n } else {\n $having .= \" AND string_agg(LOWER(descriptors.description), ' ' ORDER BY descriptors.\\\"descriptorType_id\\\") \" .\n \"like '%\" . strtolower(ltrim(rtrim($searchArray[$nCount]))) . \"%'\";\n }\n }\n\n return substr($having, 5, strlen($having) - 5);\n }", "public function appendHavingItem($value)\n {\n return $this->append(self::HAVING_ITEM, $value);\n }", "protected function compileHavingBetween($having): string\n {\n $between = $having['not'] ? 'not between' : 'between';\n\n $column = $this->wrap($having['column']);\n\n $min = $this->parameter(headItem($having['values']));\n $max = $this->parameter(lastItem($having['values']));\n\n return $having['boolean'].' '.$column.' '.$between.' '.$min.' and '.$max;\n }", "public function havingLte($col, $value)\n {\n $this->having .= \"$col <= $value \";\n }", "function or_having($key, $value = '', $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_having($key, $value, 'OR ', $escape);\r\n\t}", "public function hasFilteredQuery() {\n return $this->_has(5);\n }", "private function setGroup2() {\n $this->qestion->groupBy(\"moods.id\");\n //$this->qestion->havingRaw(\"CASE WHEN count(forwarding_drugs.id_mood) = 0 THEN 1 else forwarding_drugs.id_mood END \");\n }", "public function hasHaving()\n\t\t{\n\t\t\treturn !is_null($this->havings);\n\t\t}", "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function &havingConditions();", "public function addHavingWithVariables($condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addHavingWithVariables($condition, array());\n }", "public function or_having_open()\n {\n $this->_having[] = array('OR' => '(');\n\n return $this;\n }", "public function havingBetween($col, $value1, $value2)\n {\n $this->having .= \" $col BETWEEN $value1 AND $value2 \";\n }", "public function hasFilteredQuery() {\n return $this->_has(3);\n }", "protected function user_where_clause() {}", "protected function compileHavings(Builder $query, $havings)\n {\n $cypher = implode(' ', array_map([$this, 'compileHaving'], $havings));\n\n return 'with '.$this->removeLeadingBoolean($cypher);\n }" ]
[ "0.7567441", "0.7470589", "0.7201348", "0.718581", "0.71236396", "0.7078133", "0.7061876", "0.7035788", "0.6998503", "0.69211286", "0.6913795", "0.68690294", "0.68597203", "0.67643046", "0.676221", "0.6684293", "0.6644776", "0.66149527", "0.6600674", "0.6535502", "0.6523339", "0.6484653", "0.6479941", "0.64331406", "0.63542336", "0.62985975", "0.629298", "0.6290073", "0.6207817", "0.62038285", "0.6197506", "0.6178496", "0.6114768", "0.6112844", "0.61023176", "0.6101392", "0.6092017", "0.60833555", "0.6054206", "0.6046548", "0.60211146", "0.59989905", "0.597343", "0.5965811", "0.59461623", "0.59079844", "0.58810544", "0.58796996", "0.58740467", "0.57843333", "0.57734174", "0.57721466", "0.5765855", "0.57569474", "0.5749891", "0.5743756", "0.5716353", "0.57103014", "0.5705011", "0.5673926", "0.56640357", "0.5647951", "0.5641286", "0.5636864", "0.5614197", "0.5576712", "0.55478036", "0.5536136", "0.5517795", "0.53911006", "0.53871113", "0.5385892", "0.53616714", "0.5359106", "0.5357509", "0.533992", "0.53053445", "0.52930814", "0.52742696", "0.5264034", "0.5246085", "0.5242594", "0.522871", "0.5219963", "0.5210288", "0.5184842", "0.5164055", "0.51618147", "0.51542866", "0.5105069", "0.5088763", "0.5086576", "0.5055426", "0.5023346", "0.49877614", "0.4982449", "0.49799466", "0.49523863", "0.49211317", "0.49189332" ]
0.68388414
13
Add an "order by" to the query.
public function order($column, $order = null) { $columns = $order == null ? $column : func_get_args(); $this->order[] = $columns; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orderBy() {\n $this->_orderBy = \"\";\n foreach ($this->_columns as $tableName => $table) {\n if (array_key_exists('order_bys', $table)) {\n foreach ($table['order_bys'] as $fieldName => $field) {\n $this->_orderBy[] = $field['dbAlias'];\n }\n }\n }\n $this->_orderBy = \"ORDER BY \" . implode(', ', $this->_orderBy) . \" \";\n }", "public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }", "public function order_by() {\r\n\t\t$fields = func_get_args();\r\n\r\n\t\t// Loop through the columns\r\n\t\tfor ( $i = 0; $i < intval( $_GET['iSortingCols'] ); $i++ ) {\r\n\t\t\t// Add the necessary comman\r\n\t\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t\t$this->order_by .= ',';\r\n\t\t\t\r\n\t\t\t// Compile the fields\r\n\t\t\t$this->order_by .= $fields[$_GET['iSortCol_' . $i]] . ' ' . $_GET['sSortDir_' . $i];\r\n\t\t}\r\n\t\t\r\n\t\t// If it's not empty\r\n\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t$this->order_by = ' ORDER BY ' . $this->order_by;\r\n\t}", "private function sql_orderBy()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $arr_order = null;\n $arr_order = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'order.' ];\n\n // Order field\n switch ( true )\n {\n case( $arr_order[ 'field' ] == 'uid' ):\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n break;\n case( $arr_order[ 'field' ] == 'value' ):\n default:\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n break;\n }\n // Order field\n // Order flag\n switch ( true )\n {\n case( $arr_order[ 'orderFlag' ] == 'DESC' ):\n $orderFlag = 'DESC';\n break;\n case( $arr_order[ 'orderFlag' ] == 'ASC' ):\n default:\n $orderFlag = 'ASC';\n break;\n }\n // Order flag\n // Get ORDER BY statement\n $orderBy = $orderField . ' ' . $orderFlag;\n\n // RETURN ORDER BY statement\n return $orderBy;\n }", "protected function setOrder() {\r\n if( $this->sqlOrderBy ) {\r\n $this->sql .= ' ORDER BY ' . $this->sqlOrderBy;\r\n }\r\n }", "public function orderBy($sql);", "public function OrderBy($by = null) {\r\n $this->orderBy = $by;\r\n }", "function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "protected function _appendOrderByClause(Zend_Db_Select $query)\n {\n $order = strtoupper($this->_getParam($this->_orderKey, $this->_defaultOrderDirection));\n $orderBy = $this->_getParam($this->_orderByKey, $this->_defaultOrderColumn);\n \n if (in_array($orderBy, $this->_getTable()->info('cols'))) {\n $this->view->order = $order;\n $this->view->orderBy = $orderBy;\n \n $query->order($orderBy . ' ' . $order);\n }\n \n return $query;\n }", "private function orderBy($param) {\n if (isset($param['column']) && isset($param['type'])) {\n $this->sql .= 'ORDER BY ' . $param['column'] . ' ' . $param['type'] . ' ';\n }\n }", "public function orderBy(){\r\n $this->orderBy = \"ORDER BY \";\r\n $args = func_get_args();\r\n foreach($args as $arg){\r\n $this->orderBy.= $this->db->formatTableName($arg);\r\n if(end($args) !== $arg){\r\n $this->orderBy.=\", \";\r\n } \r\n\r\n }\r\n return $this;\r\n }", "protected function prepareOrderByStatement() {}", "public function orderBy($field) {\n\t$this->parseQuery->orderBy($field);\n }", "function order_by($order_by, $direction = 'ASC')\n {\n // We treat the rand() function as an exception\n if (preg_match(\"/rand\\\\(\\\\s*\\\\)/\", $order_by)) {\n $order = 'rand()';\n } else {\n $order_by = $this->object->_clean_column($order_by);\n // If the order by clause is a column, then it should be backticked\n if ($this->object->has_column($order_by)) {\n $order_by = \"`{$order_by}`\";\n }\n $direction = $this->object->_clean_column($direction);\n $order = \"{$order_by} {$direction}\";\n }\n $this->object->_order_clauses[] = $order;\n return $this->object;\n }", "public function &getOrderBy();", "protected function _compile_order_by()\n\t{\n\t\tif (is_array($this->qb_orderby) && count($this->qb_orderby) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->qb_orderby); $i < $c; $i++)\n\t\t\t{\n\t\t\t\tif ($this->qb_orderby[$i]['escape'] !== FALSE && ! $this->_is_literal($this->qb_orderby[$i]['field']))\n\t\t\t\t{\n\t\t\t\t\t$this->qb_orderby[$i]['field'] = $this->protect_identifiers($this->qb_orderby[$i]['field']);\n\t\t\t\t}\n\n\t\t\t\t$this->qb_orderby[$i] = $this->qb_orderby[$i]['field'].$this->qb_orderby[$i]['direction'];\n\t\t\t}\n\n\t\t\treturn $this->qb_orderby = \"\\nORDER BY \".implode(', ', $this->qb_orderby);\n\t\t}\n\t\telseif (is_string($this->qb_orderby))\n\t\t{\n\t\t\treturn $this->qb_orderby;\n\t\t}\n\n\t\treturn '';\n\t}", "function order_by($order_by, $direction = 'ASC')\n {\n // Make an exception for the rand() method\n $order_by = preg_replace(\"/rand\\\\(\\\\s*\\\\)/\", 'rand', $order_by);\n if (in_array($order_by, $this->object->_get_querable_table_columns())) {\n $this->object->_query_args['orderby'] = $order_by;\n } else {\n // ordering by a meta value\n $this->object->_query_args['orderby'] = 'meta_value';\n $this->object->_query_args['meta_key'] = $order_by;\n }\n $this->object->_query_args['order'] = $direction;\n return $this->object;\n }", "function orderBy($columns, $direction = \"\") {\n\t\t\n\t\tif (gettype($columns) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($columns as $col => $dir) {\n\t\t\t\t$cols[] = \"`$col` $dir\";\n\t\t\t}\n\t\t\t$cols = implode($cols, \",\");\n\t\t} else {\n\t\t\tif (!preg_match(\"/\\\\)$/\", $columns)) $cols = \"`$columns` $direction\";\n\t\t\telse $cols = \"$columns $direction\";\n\t\t\t// $cols = \"`\" . implode(\"` `\", preg_split(\"/\\s/i\", $columns)) . \"` $direction\";\n\t\t\t// $cols = \"`$columns` $direction\";\n\t\t}\n\t\t\n\t\tif (!isset($this->stmts['orderBy']))\n\t\t\t$cols = \"ORDER BY $cols\";\n\t\t\n\t\t$this->appendStmt('orderBy', \"$cols\");\n\n\t\treturn $this;\n\t}", "public function default_order_by()\r\n {\r\n $this->db->order_by('partners.id');\r\n }", "protected function enforceOrderBy()\n {\n if (empty($this->query->orders) && empty($this->query->unionOrders)) {\n $this->orderBy($this->model->getQualifiedKeyName(), 'asc');\n }\n }", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = $this->fields_arr['orderby_field'].' '.$this->fields_arr['orderby'];\n\t\t\t}", "function order_by($params, $default_field, $default_order = 'ASC') {\r\n \tif (isset($params['sortby'])) {\r\n \t\t$default_field = $params['sortby'];\r\n \t}\r\n\r\n \tif (isset($params['sortdir'])) {\r\n \t\t$default_order = $params['sortdir'];\r\n \t}\r\n\r\n \treturn \"ORDER BY $default_field $default_order\";\r\n\r\n }", "public function implicitOrderby() {\n\t\treturn true;\n\t}", "public function setOrderby($query)\n {\n // If not search or main query, return the default query\n if (!is_search() || is_post_type_archive() || !$query->is_main_query() || is_admin()) {\n return;\n }\n\n // Set orderby\n $query->set('orderby', 'relevance');\n }", "public function orderBy($direction = \"ASC\",$column);", "function get_order_by_clause() {\n $result = parent::get_order_by_clause();\n\n //make sure the result is actually valid\n if ($result != '') {\n //always sort by course in addition to everything else\n $result .= ', coursename, courseid';\n }\n\n return $result;\n }", "public function order($field, $order = 'desc');", "public function getOrderBy()\n {\n return $this->order_by;\n }", "public function getOrderBy()\n {\n return $this->order_by;\n }", "public function getOrderBy()\n {\n return $this->order_by;\n }", "public function orderBy($order = \"\"){\n\t\t\tif(is_string($order) && strlen($order) > 0){\n\t\t\t\t$this->orderBy = \" ORDER BY \" . $order;\n\t\t\t}else{\n\t\t\t\t$this->orderBy = false;\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "private function buildOrderBy() {\n\t\t$hasorderby = false;\n\t\tforeach($this->ordergroup as $key=>$extra) {\n\t\t\tif(strpos(strtoupper($extra), 'ORDER BY') !== false) {\n\t\t\t\t$this->orders[] = str_replace('ORDER BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'LIMIT') !== false) {\n\t\t\t\t$this->limit = $extra;\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'GROUP BY') !== false) { \n\t\t\t\t$this->groups[] = str_replace('GROUP BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t}\n\t}", "public function addOrder($ord) {\n $this->sql .= \" ORDER BY $ord\";\n }", "protected function enforceOrderBy() : void\n {\n if (empty($this->query->orders) && empty($this->query->unionOrders)) {\n $this->orderBy($this->mapper->getQualifiedKeyName(), 'asc');\n }\n }", "protected function addSortQuery($query)\n {\n $query->addOrderBy('root_id, lft');\n }", "private function makeOrderingSQL($order_by) {\n $all_columns = \"\";\n if (is_array($order_by))\n {\n foreach ($order_by as $column_name)\n\t{\n\t $all_columns .= $column_name . ', ';\n\t}\n $all_columns = rtrim($all_columns, ', ');\n }\n else\n {\n $all_columns = $order_by;\n }\n return 'ORDER BY ' . $all_columns;\n}", "public function build_order_by( $order_by, $order = 'ASC' ) {\n if ( empty( $order_by ) ) {\n return '';\n }\n $sql = ' ORDER BY ' . $this->get_row_suffix() . $order_by;\n if ( ! in_array( $order, array( 'ASC', 'DESC' ) ) ) {\n $order = 'ASC';\n }\n\n return $sql . ' ' . $order . ' ';\n }", "public function orderBy($column, $direction = 'asc');", "abstract protected function _buildOrderBy( $order );", "public function getOrderByClause() {\n\n\t\ttx_pttools_assert::isTrue($this->isSortable, array('message' => 'This column is not sortable'));\n\t\tswitch ($this->sortingState) {\n\t\t\tcase self::SORTINGSTATE_NONE: {\n\t\t\t\t$orderBy = '';\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_ASC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'ASC');\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_DESC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'DESC');\n\t\t\t} break;\n\n\t\t\tdefault: {\n\t\t\t\tthrow new tx_pttools_exception('Invalid sorting state!');\n\t\t\t} break;\n\t\t}\n\t\treturn $orderBy;\n\t}", "public function orderByAsc($param){\n $this->params[\"ORDER BY\"] = $param.\" ASC\";\n return $this;\n }", "public function setOrderBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->order_by = $var;\n\n return $this;\n }", "public function setOrderBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->order_by = $var;\n\n return $this;\n }", "public function setOrderBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->order_by = $var;\n\n return $this;\n }", "public function orderby($columns,$condition){\n\t\t$this->query[\"ORDERBY\"] .= \"(\" . $columns .\") \". $condition;\n\t\treturn $this;\n\t}", "function orderBy($orderBy, $order)\n {\n if (empty($orderBy)) {\n return false;\n }\n \n $columns = $this->to_string($orderBy);\n \n $order = (in_array(strtoupper($order), array( 'ASC', 'DESC'))) ? strtoupper($order) : 'ASC';\n \n return 'ORDER BY '.$columns.' '. $order;\n }", "public function getOrderBy()\n\t{\n\t\t$sort = $this->getSessionOrderBy();\n\t\treturn BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sort);\n\t}", "public function getOrderBy()\n\t{\n\t\t$sort = $this->getSessionOrderBy();\n\t\treturn BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sort);\n\t}", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = '';\n\t\t\t\t$sort = $this->fields_arr['orderby_field'];\n\t\t\t\t$orderBy = $this->fields_arr['orderby'];\n\t\t\t\tif ($sort AND $orderBy)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->sql_sort = ' '.$sort.' '.$orderBy;\n\t\t\t\t\t}\n\t\t\t}", "public function orderBy($column, $direction = 'asc')\n {\n\n }", "public function setOrderBy($orderBy)\r\n\t{\r\n\t\t$this->orderBy = $orderBy;\r\n\t}", "public function getOrderBy() {\n\t\tglobal $log, $adb;\n\t\t$log->debug('> getOrderBy');\n\t\t$cmodule = get_class($this);\n\t\t$order_by = '';\n\t\tif (GlobalVariable::getVariable('Application_ListView_Default_Sorting', 0, $cmodule)) {\n\t\t\t$order_by = GlobalVariable::getVariable('Application_ListView_Default_OrderField', $this->default_order_by, $cmodule);\n\t\t}\n\n\t\tif (isset($_REQUEST['order_by'])) {\n\t\t\t$order_by = $adb->sql_escape_string($_REQUEST['order_by']);\n\t\t} elseif (!empty($_SESSION[$cmodule.'_Order_By'])) {\n\t\t\t$order_by = $adb->sql_escape_string($_SESSION[$cmodule.'_Order_By']);\n\t\t}\n\t\t$log->debug('< getOrderBy');\n\t\treturn $order_by;\n\t}", "function GetOrderBy() {\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sSort);\n\t}", "function GetOrderBy() {\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sSort);\n\t}", "function GetOrderBy() {\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sSort);\n\t}", "function foo_modify_query_order( $query ) {\n if ( $query->is_main_query() ) {\n $query->set( 'orderby', 'title' );\n $query->set( 'order', 'ASC' );\n }\n}", "public static function order( $column, $order, $use_alias = true ) {\n\t\t\tif( self::$query_open ) {\n self::$current_query->order( $column, $order, $use_alias );\n }\n\t\t}", "public function addOrderClause(Zend_Db_Select &$select) {\n // Distill the WHERE class from the Select object\n $where = $select->getPart(Zend_Db_Select::WHERE);\n // Save the existing ORDER clause.\n $originalOrder = $select->getPart(Zend_Db_Select::ORDER);\n $select->reset(Zend_Db_Select::ORDER);\n \n $alias = '';\n if ($this->_modelAlias) {\n $alias = $this->_modelAlias . '.';\n }\n\n /**\n * If a registered foreign key (see self::_relationConfig) is found, this query is \n * considered to be a related fetch() command, and an ORDER BY clause is added with\n * the registered weight column.\n */\n foreach ($where as $w) {\n foreach ($this->_relationConfig as $model => $modelRelationConfig) {\n if (strpos($w, $modelRelationConfig[self::FOREIGN_KEY_COLUMN_KEY]) !== false) {\n $select->order($alias . $modelRelationConfig[self::WEIGHT_COLUMN_KEY].' DESC');\n }\n }\n }\n \n // Return the existing ORDER clause, only this time '<weight-column> DESC' will be in front of it\n foreach ($originalOrder as $order) {\n // [0] = column, [1] = direction\n if (is_array($order)) {\n $order = $order[0].' '.$order[1];\n }\n $select->order($order);\n } \n }", "protected function formOrderBy(&$builder, $order_by = null)\n {\n if (is_string($order_by)){\n $builder->orderBy($order_by);\n }\n }", "public function orderBy($column, $dir): QueryBuilderInterface;", "protected static function addOrderBy(SugarQuery $q, array $orderByOption)\n {\n foreach ($orderByOption as $orderBy) {\n // ID and date_modified are used to give some order to the system\n if ($orderBy[0] != 'date_modified' && $orderBy[0] != 'id') {\n self::verifyField($q, $orderBy[0]);\n }\n $q->orderBy($orderBy[0], $orderBy[1]);\n }\n }", "public function setOrderBy(array $orderBy);", "public function getOrderBy()\r\n\t{\r\n\t\treturn $this->orderBy;\r\n\t}", "public function orderBy($vars){\n\t\t\t$string = self::ORDER_BY;\n\t\t\t\n\t\t\t$cpt = 0;\n\t\t\tforeach($vars as $var){\n\t\t\t\t$string .= ' ' . $var;\n\t\t\t\tif(($cpt+1) < count($vars)){\n\t\t\t\t\t$string .= ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_query .= $string . ' ';\n\t\t\treturn $this->_returnObject ? $this : $string;\n\t\t}", "public function custom_column_orderby( $query ) {\n\n\t\tif ( ! isset( $_GET['post_type'] ) || 'ticket' !== $_GET['post_type'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$fields = $this->get_custom_fields();\n\t\t$orderby = $query->get( 'orderby' );\n\n\t\tif ( ! empty( $orderby ) && array_key_exists( $orderby, $fields ) ) {\n\n\t\t\tif ( 'taxonomy' != $fields[ $orderby ]['args']['field_type'] ) {\n\t\t\t\t$query->set( 'meta_key', '_dev_' . $orderby );\n\t\t\t\t$query->set( 'orderby', 'meta_value' );\n\t\t\t}\n\n\t\t}\n\n\t}", "public function orderBy($field, $direction = 'ASC');", "protected function compileOrderByStatement()\n {\n if (is_array($this->builderCache->orderBy) && count($this->builderCache->orderBy) > 0) {\n for ($i = 0, $c = count($this->builderCache->orderBy); $i < $c; $i++) {\n if ($this->builderCache->orderBy[ $i ][ 'escape' ] !== false\n && ! $this->isLiteral(\n $this->builderCache->orderBy[ $i ][ 'field' ]\n )\n ) {\n $this->builderCache->orderBy[ $i ][ 'field' ] = $this->conn->protectIdentifiers(\n $this->builderCache->orderBy[ $i ][ 'field' ]\n );\n }\n\n $this->builderCache->orderBy[ $i ] = $this->builderCache->orderBy[ $i ][ 'field' ]\n . $this->builderCache->orderBy[ $i ][ 'direction' ];\n }\n\n return $this->builderCache->orderBy = \"\\n\" . sprintf(\n 'ORDER BY %s',\n implode(', ', $this->builderCache->orderBy)\n );\n } elseif (is_string($this->builderCache->orderBy)) {\n return $this->builderCache->orderBy;\n }\n\n return '';\n }", "public function sort($orderBy): void;", "public function orderBy($key, $order='asc');", "public function orderBy($columns)\n\t{\n\t\t$this->query->orderBy = $columns;\n\t\treturn $this;\n\t}", "public function orderBy($columns);", "function get_sql_order(){\r\n\r\n\t\tif(stripos($this->sql_query,' ORDER BY ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$order_str_ini=substr($this->sql_query,stripos($this->sql_query,' ORDER BY '),stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' ORDER BY '));\r\n\t\t\telse\r\n\t\t\t\t$order_str_ini=substr($this->sql_query,stripos($this->sql_query,' ORDER BY '));\r\n\t\t}else{\r\n\t\t\t$order_str_ini='';\r\n\t\t}\r\n\r\n\t\t$order_str='';\r\n\t\t$arr_new_cols=array();\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++){\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\t\t\t$arr_new_cols[]=$this->extra_cols[$i][0];\r\n\t\t}\r\n\r\n\t\t$arr_sort=explode('_',$this->sort);\r\n\t\tasort($arr_sort);\r\n\r\n\t\tforeach($arr_sort as $key => $value){\r\n\r\n\t\t\tif(!in_array($key+1,$arr_new_cols)){\r\n\r\n\t\t\t\tif(substr($arr_sort[$key],-1)=='a')\r\n\t\t\t\t\t$order_str.=(($order_str_ini or $order_str) ? ', ' : ' ORDER BY ').$arr_sql_fields[$key].' ASC';\r\n\r\n\t\t\t\tif(substr($arr_sort[$key],-1)=='d')\r\n\t\t\t\t\t$order_str.=(($order_str_ini or $order_str) ? ', ' : ' ORDER BY ').$arr_sql_fields[$key].' DESC';\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn $order_str_ini.$order_str;\r\n\t}", "function orderby($column) {\n\treturn \"<span class='orderby'><a href='?orderby={$column}&order=asc'>&darr;</a><a href='?orderby={$column}&order=desc'>&uarr;</a></span>\";\n}", "function getOrderBy()\n\t{\n\t\tglobal $log;\n $log->debug(\"Entering getOrderBy() method ...\");\n\t\tif (isset($_REQUEST['order_by']))\n\t\t\t$order_by = $_REQUEST['order_by'];\n\t\telse\n\t\t\t$order_by = (isset($_SESSION['NOTES_ORDER_BY'])?($_SESSION['NOTES_ORDER_BY']):($this->default_order_by));\n\t\t$log->debug(\"Exiting getOrderBy method ...\");\n\t\treturn $order_by;\n\t}", "public function setOrderBy($orderBy)\n {\n return $this->setAdditionalParam('orderBy', $orderBy);\n }" ]
[ "0.7733458", "0.7361272", "0.7356781", "0.7280303", "0.7097974", "0.70515233", "0.7005229", "0.7003761", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.69747245", "0.6967215", "0.6941141", "0.6913059", "0.68822867", "0.67679757", "0.6764951", "0.66464686", "0.66271013", "0.66011363", "0.6601119", "0.6593697", "0.6586075", "0.6554519", "0.65421766", "0.6540209", "0.6536008", "0.6530809", "0.65190756", "0.6518501", "0.65143466", "0.65143466", "0.65143466", "0.6514233", "0.650874", "0.6502404", "0.6493201", "0.647743", "0.6471916", "0.6451527", "0.64307225", "0.64023095", "0.6402119", "0.6397577", "0.63860035", "0.63860035", "0.63860035", "0.6364712", "0.6349498", "0.6337149", "0.6337149", "0.6316233", "0.6307321", "0.630654", "0.62951785", "0.6287363", "0.6287363", "0.6287363", "0.62836456", "0.62706774", "0.6265505", "0.62600803", "0.62600684", "0.62450856", "0.6228935", "0.621872", "0.62176687", "0.6200461", "0.6186008", "0.61816156", "0.6181436", "0.61740583", "0.6163321", "0.61544573", "0.615005", "0.61444026", "0.61433625", "0.6139455" ]
0.0
-1
Add a "limit" to the query.
public function limit($limit) { $this->limit = $limit; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function limit(int $limit){\n $this->query .= \"LIMIT \" . $limit . \" \";\n }", "protected function setLimit() {\r\n if( $this->sqlLimit ) {\r\n $this->sql .= ' LIMIT ' . $this->sqlLimit;\r\n }\r\n }", "public function setQueryLimit($limit) {\n\t\t$this->queryLimit = (integer) $limit;\n\t}", "public function limit($limit) {\r\n\t\t$this->query .= \" LIMIT \" . $limit;\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $this;\r\n\t}", "public function setLimit($limit) {\n\t$this->parseQuery->setLimit($limit);\n }", "public function limit($limit);", "public function limit($limit);", "public function limit($limit)\n\t{\n\t\t$this->query->limit = $limit;\n\t\treturn $this;\n\t}", "public static function limit($limit);", "public function limit($limit)\n {\n }", "public static function setQueryLimit($limit){\t\t\n\t\t//reset the queryCount\n\t\tself::$queryCount = 0;\n\t\t\n\t\tself::$queryLimit = $limit;\n }", "public function limit($limit)\r\n {\r\n $this->query->limit($limit);\r\n \r\n return $this;\r\n }", "public function addLimit($_params , $_query)\n {\n \n $_query->setMaxResults($_params['length'])\n ->setFirstResult($_params['offset']);\n\n return $_query;\n }", "public function limit($limit) {\r\n $this->sqlLimit = $limit;\r\n return $this;\r\n }", "public function limit(?int $limit): self;", "function limit($limit, $offset = 0)\n{\n\t$this->tryModify();\n\t$this->query['limit'] = array((int)$limit, (int)$offset);\n\treturn $this;\n}", "public function limit($limit, $offset = null);", "public function limit($limit)\t{\n\t\t$this->limit = array(\"LIMIT $limit\");\n\t\treturn $this;\n\t}", "public function addLimit($amt, $offset = \"0\") {\n $this->sql .= \" LIMIT $offset, $amt\";\n }", "public function set_limit($limit);", "private function _limit($numRows) \n\t{\n\t\t$this->_query .= \" LIMIT \" . ( int ) $numRows;\n\t}", "public function limit($limit = 10) {\n $this->limit = $limit;\n return $this;\n }", "public function limit(int $limit, int $offset);", "public function limit($limit)\n\t{\n\t\t$this->limit = (int) $limit;\n\t}", "public function limit($limit,$offset);", "public function setLimit($limit)\n {\n //argument 1 must be a string\n Argument::i()->test(1, 'int');\n $this->query['limit'] = $limit;\n \n return $this;\n }", "public function limit($limit)\n {\n return $this->query->limit($limit);\n }", "function q_limit($query, $limit, $off=0)\n{\n\treturn $query .' LIMIT '. $limit .' OFFSET '. $off;\n}", "public function limit($limit = \"\"){\n\t\t\tif(is_numeric($limit)){\n\t\t\t\t$this->limit = \" LIMIT :limit\";\n\t\t\t\t$this->addParam(\"limit\", $limit);\n\t\t\t}else{\n\t\t\t\t$this->limit = false;\n\t\t\t\tunset($this->parameters[\"limit\"]);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function setLimit($x) { $this->limit = $x; }", "public function setLimit(int $limit): self;", "public function setLimit($value)\n {\n return $this->setParameter('limit', $value);\n }", "public function limit($limit)\n {\n $this->_parts['limit'] = $limit;\n\n return $this;\n }", "public function setLimit($limit) {\n\t\t$this->limit = $limit;\n\t}", "public function limit($limit) {\n $this->limit = (int) $limit;\n return $this;\n }", "public function setLimit($limit)\n {\n $this->limit = $limit;\n }", "private function setCustomLimit()\n\t{\n\t\t$this->limit = $this->customQuery->limit ? $this->customQuery->limit : $this->queryLimit;\n\n\t\treturn $this;\n\t}", "public function setLimit($limit) {\n $this->limit = $limit;\n return $this;\n }", "function limit($count) {\n\t\t$this->appendStmt('limit', \"LIMIT ?\", [$count]);\n\t\treturn $this;\n\t}", "public function limit($limit)\n {\n $this->limit = $limit;\n return $this;\n }", "public function set_limit($new_limit){\r\n $this->limit = $new_limit;\r\n }", "public function limit($limit) {\n\t\t\t$this->builder->limit($limit);\n\t\t\treturn $this;\n\t\t}", "public function limit( $limit )\n\t{\n\t\tif ( $limit > 500 ) {\n\t\t\t$limit = 500;\n\t\t}\n\n\t\t$this->parameters['limit'] = $limit;\n\n\t\treturn $this;\n\t}", "public function setLimit($var)\n {\n GPBUtil::checkInt32($var);\n $this->limit = $var;\n\n return $this;\n }", "public function dbLimit($limit) {\r\n $this->limit = $limit;\r\n return $this;\r\n }", "public function limit($limit, $offset=null)\n\t{\n\t\t\t\t\t$this->_query['limit']=(int)$limit;\n\t\t\t\t\tif($offset!==null)\n\t\t\t\t\t\t\t\t\t$this->offset($offset);\n\t\t\t\t\treturn $this;\n\t}", "public function setLimit($var)\n {\n GPBUtil::checkDouble($var);\n $this->limit = $var;\n\n return $this;\n }", "public function setLimit($var)\n {\n GPBUtil::checkInt32($var);\n $this->limit = $var;\n $this->has_limit = true;\n\n return $this;\n }", "function modifyLimitQuery($query, $from, $count)\n {\n $this->limit_from = $from;\n $this->limit_count = $count;\n return $query;\n }", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->limit=$row->answersperpage;\n }", "public function limit($limit = 10, $offset = 0): Database\n {\n $this->query .= 'LIMIT ' . $limit . ' OFFSET ' . $offset . ' ';\n return $this;\n }", "protected function compileLimit(Builder $query, $limit)\n {\n return 'LIMIT '.(int) $limit;\n }", "public function setLimit($limit)\r\n {\r\n $this->limit = intval($limit);\r\n }", "public function limit($limit)\n {\n $this->limit = (int) $limit;\n return $this;\n }", "public function limit($sql){\n\t\t$params = get_params(func_get_args());\n\t\t$sql_new = $sql;\n\t\n\t\tif(isset($params['limit']) && is_numeric($params['limit'])){\n\t\t\t$sql_new.=\" FIRST $params[limit]\";\n\t\t}\n\t\t\n\t\tif(isset($params['offset']) && is_numeric($params['offset'])){\n\t\t\t$sql_new.=\" SKIP $params[offset]\";\n\t\t}\n\t\t\n\t\treturn $sql_new;\n\t}", "public function setLimit($limit)\n\t{\n\t\t$this->limit = $limit;\n\t\treturn $this;\n\t}", "public function limitClause(){\n try {\n // Sparql11query.g:164:3: ( LIMIT INTEGER ) \n // Sparql11query.g:165:3: LIMIT INTEGER \n {\n $this->match($this->input,$this->getToken('LIMIT'),self::$FOLLOW_LIMIT_in_limitClause592); \n $this->match($this->input,$this->getToken('INTEGER'),self::$FOLLOW_INTEGER_in_limitClause594); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function limit($limit)\n {\n return $this->set_limit($limit);\n }", "public function setLimit($limit)\n {\n $this->_limit = $limit;\n return $this;\n }", "public function limit($start, $end = '')\n {\n if(!$this->query)\n {\n return false;\n }\n \n $this->query .= 'LIMIT ';\n $start = intval($start);\n \n if(empty($end))\n {\n $this->query .= $start . ' '; \n }\n else\n {\n $end = intval($end);\n $this->query .= $start . ', ' . $end . ' ';\n } \n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function limit($limit)\n {\n if ( $this->driver->type == 'sqlite' ) {\n // throw new Exception('sqlite does not support limit syntax');\n }\n $this->limit = $limit;\n return $this;\n }", "public function limit( int $limit )\n {\n $this->limit = $limit;\n return $this;\n }", "public function getLimit(): int\n {\n return $this->getQueryPageSize();\n }", "public function setLimit($limit) {\n $this->limit = (int)$limit;\n }", "public function limit( $limit ) {\n\t\t$this->isDirty( true );\n\t\t$this->_limit = $limit;\n\t\treturn $this;\n\t}", "function mLIMIT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$LIMIT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:186:3: ( 'limit' ) \n // Tokenizer11.g:187:3: 'limit' \n {\n $this->matchString(\"limit\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "private function addLimitToQueryBuilder($qb, $limit = 0, $page = 0)\n {\n if ($limit > 0) {\n $qb->limit($limit)->skip($limit * $page);\n }\n\n return $qb;\n }", "public function limit($sql){\n\t\t$params = get_params(func_get_args());\n\t\t$sql_new = $sql;\n\t\n\t\tif(isset($params['limit']) && is_numeric($params['limit'])){\n\t\t\t$sql_new.=\" LIMIT $params[limit]\";\n\t\t}\n\t\t\n\t\tif(isset($params['offset']) && is_numeric($params['offset'])){\n\t\t\t$sql_new.=\" OFFSET $params[offset]\";\n\t\t}\n\t\t\n\t\treturn $sql_new;\n\t}", "public function setLimit ($value)\r\n\t{\r\n\t\t$this->limit = $value;\r\n\t}", "public function setLimit($limit)\n {\n $this->limit = $limit;\n\n return $this;\n }", "public function setLimit($limit)\n {\n $this->limit = $limit;\n\n return $this;\n }", "public function setLimit($limit)\n {\n $this->limit = $limit;\n\n return $this;\n }", "public function setSqlLimit($limit)\n {\n if ($this->searchResult !== null) {\n $limit = '';\n }\n\n return $limit;\n }", "function AddLimit($offset=-1, $numtofetch=-1)\n\t{\n\t\t$this->offset = $offset;\n\t\t$this->numtofetch = $numtofetch;\n\t\treturn ' ';\n\t}", "public function limit(?int $limit = null) : int;", "public function limit($limit, $offset = 0)\n {\n $limit = intval($limit);\n $offset = intval($offset);\n $this->limit_str = \"{$offset}, {$limit}\";\n return $this;\n }", "public function limit($limit,$offset = null)\n {\n $this->_limitStr = \" LIMIT \".intval($limit);\n if (!is_null($offset)) {\n $this->_limitStr .= ', '.intval($offset);\n }\n\n return $this;\n }", "public function limit($offset, $max = null);", "public function limit($limit)\n {\n $this->limit = (int) $limit;\n\n return $this;\n }", "public function getLimit() {}", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "protected function compileLimit(Builder $query, int $limit)\n {\n return 'limit ' . (int)$limit;\n }", "public function limit($num)\n {\n $this->limit = $num;\n return $this;\n }", "function selectLimit ($limit, $offset=null)\n {\n return \" LIMIT {$limit}\".($offset? \" OFFSET {$offset}\": null);\n }", "public function limit($count, $offset);", "function allWithLimit() {\n\n }", "private function _sql_limit() {\n\t\tif ( $this->limit ) {\n\t\t\treturn ' LIMIT ' . $this->limit;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t}", "public function setLimit($limit)\n {\n $this->limit = (int) $limit;\n return $this;\n }", "public function limit($limit=10, $offset=0) {\n $this->__limit__ = array($limit, $offset);\n return $this;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function getQueryLimit() {\n\t\treturn $this->queryLimit;\n\t}", "public function limit($str) \n {\n $this->_data['limit'] = $str;\n $this->_data['query'] .= ' LIMIT '.$str;\n return $this;\n }", "public function limit(int $limit): Discover\n {\n $this->paramLimit = $limit;\n return $this;\n }", "public function set_item_limit($limit = 0)\n {\n }", "public function limit( $value )\n {\n if( is_numeric( $value ))\n $this->query('limit', $value);\n }" ]
[ "0.81219804", "0.79419124", "0.77808213", "0.7770052", "0.76889074", "0.7651885", "0.7651885", "0.75919634", "0.75635266", "0.7561895", "0.75475895", "0.7519979", "0.75022775", "0.74591655", "0.7432741", "0.73800737", "0.736906", "0.7367217", "0.735809", "0.7290261", "0.7234131", "0.7217661", "0.7196602", "0.7185037", "0.7174671", "0.71547896", "0.7150468", "0.71297985", "0.71279657", "0.7124992", "0.7124249", "0.70537", "0.7053561", "0.7031622", "0.7026611", "0.70215863", "0.6982646", "0.6958815", "0.69245714", "0.69158137", "0.6888243", "0.6881015", "0.68689173", "0.68681616", "0.68666303", "0.68523353", "0.6848833", "0.6845427", "0.68007255", "0.6790868", "0.6767924", "0.6754435", "0.6747822", "0.6746906", "0.674569", "0.67404187", "0.6737906", "0.6728899", "0.6717074", "0.6705985", "0.66957414", "0.6687357", "0.6687293", "0.66817665", "0.66716075", "0.6663187", "0.66601855", "0.66455835", "0.6634356", "0.662663", "0.662663", "0.662663", "0.66262525", "0.662389", "0.6619481", "0.66190577", "0.66142243", "0.6613736", "0.66127956", "0.66123056", "0.66122323", "0.66122323", "0.66122323", "0.66122323", "0.66122323", "0.6610989", "0.6601493", "0.6597825", "0.6597681", "0.6593831", "0.65791017", "0.6569242", "0.65636665", "0.6559894", "0.6559894", "0.6553095", "0.6547928", "0.6546502", "0.65456766", "0.6541531" ]
0.704147
33
Add an "offset" to the query.
public function offset($offset) { $this->offset = $offset; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addOffset($offset) {}", "public function addOffset($offset);", "public function offset($offset) {\r\n\t\t$this->query .= \" OFFSET \" . $offset;\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $this;\r\n\t}", "function _sf_query_offset(&$query) {\n\t\tif(!isset($query->query['offset'])) { return; }\n\t\tif(!$query->query['offset']) { return; }\n\t\n\t\t///// FIRST OUR DESIRED OFFSET\n\t\t$offset = $query->query['offset'];\n\t\t\n\t\t///// NEXT HOW MANY POSTS PER PAGE WE ACTUALLY WANT\n\t\t$ppp = $query->query['posts_per_page'];\n\t\t\n\t\t///// LETS DETECT AND HANDLE PAGINATION\n\t\tif($query->is_paged) {\n\t\n\t\t\t//Manually determine page query offset (offset + current page (minus one) x posts per page)\n\t\t\t$page_offset = $offset + ( ($query->query_vars['paged']-1) * $ppp );\n\t\n\t\t\t//Apply adjust page offset\n\t\t\t$query->set('offset', $page_offset );\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t//// ITS OUR FIRST PAGE, JUST USE THE OFFSET\n\t\t\t$query->set('offset',$offset);\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function offset($offset = \"\"){\n\t\t\tif(is_numeric($offset)){\n\t\t\t\t$this->offset = \" OFFSET :offset\";\n\t\t\t\t$this->addParam(\"offset\", $offset);\n\t\t\t}else{\n\t\t\t\t$this->offset = false;\n\t\t\t\tunset($this->parameters[\"offset\"]);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function offset($offset)\n\t{\n\t\t\t\t\t$this->_query['offset']=(int)$offset;\n\t\t\t\t\treturn $this;\n\t}", "public function offset($offset)\n\t{\n\t\t$this->query->offset = $offset;\n\t\treturn $this;\n\t}", "public function offset($offset)\n\t{\n\t\tempty($offset) OR $this->qb_offset = (int) $offset;\n\t\treturn $this;\n\t}", "public function offset($offset)\r\n {\r\n $this->query->offset($offset);\r\n \r\n return $this;\r\n }", "public function setOffset($offset) {}", "public function setOffset($offset);", "public function setOffset($offset);", "public function setOffset($var)\n {\n GPBUtil::checkInt64($var);\n $this->offset = $var;\n }", "private function _sql_offset() {\n\t\tif ( $this->limit && $this->offset ) {\n\t\t\treturn ' OFFSET '. $this->offset;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t}", "public function setOffset($offset)\r\n {\r\n $this->offset = intval($offset);\r\n }", "public function setOffset($offset) { $this->_offset = $offset; }", "public function setOffset($var)\n {\n GPBUtil::checkInt32($var);\n $this->offset = $var;\n }", "private function setCustomOffset()\n\t{\n\t\tif (!$this->useDataProvider) {\n\t\t\tif ($this->customQuery->offset) {\n\t\t\t\t$this->offset = $this->customQuery->offset;\n\t\t\t} else {\n\t\t\t\tif (Yii::$app->request->get('page') <= 1) {\n\t\t\t\t\t$this->offset = 0;\n\t\t\t\t} else {\n\t\t\t\t\t$this->offset = $this->limit * (Yii::$app->request->get('page') - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setOffset($offset) {\n\t\t$this->offset = $offset;\n\t}", "public function offsetClause(){\n try {\n // Sparql11query.g:171:3: ( OFFSET INTEGER ) \n // Sparql11query.g:172:3: OFFSET INTEGER \n {\n $this->match($this->input,$this->getToken('OFFSET'),self::$FOLLOW_OFFSET_in_offsetClause612); \n $this->match($this->input,$this->getToken('INTEGER'),self::$FOLLOW_INTEGER_in_offsetClause614); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function offset( $offset )\n\t{\n\t\t$this->parameters['offset'] = $offset;\n\n\t\treturn $this;\n\t}", "public function testOffset()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->offset(10));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(10, $elasticQuery['from']);\n\n $this->assertSame($query, $query->offset(20));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(20, $elasticQuery['from']);\n }", "public function setOffset($offset)\n {\n $this->offset = $offset;\n\n return $this;\n }", "private function setOffset()\n {\n $this->offset = ($this->limit * $this->currentPage) - $this->limit;\n }", "public function setOffset($offset)\n {\n $this->offsetStart = max(0, intval($offset));\n\n return $this;\n }", "protected function compileOffset(Builder $query, int $offset)\n {\n return 'offset ' . (int)$offset;\n }", "public function setOffset($offset) {\n $this->offset = (int)$offset;\n }", "protected function compileOffset(Builder $query, $offset)\r\n {\r\n return 'AND '.(int) $offset;\r\n }", "public function applyLimitOffset($sql, $limit=-1, $offset=-1)\n\t{\n\t\t$limit = $limit!==null ? intval($limit) : -1;\n\t\t$offset = $offset!==null ? intval($offset) : -1;\n\t\tif($limit > 0 || $offset > 0)\n\t\t{\n\t\t\t$limitStr = ' LIMIT '.$limit;\n\t\t\t$offsetStr = $offset >= 0 ? ' OFFSET '.$offset : '';\n\t\t\treturn $sql.$limitStr.$offsetStr;\n\t\t}\n\t\telse\n\t\t\treturn $sql;\n\t}", "public function addLimit($amt, $offset = \"0\") {\n $this->sql .= \" LIMIT $offset, $amt\";\n }", "public function setOffset(int $offset) : self\n {\n $this->offset = $offset;\n\n return $this;\n }", "public function offset(int $offset): self\n {\n $this->offset = intval($offset);\n\n return $this;\n }", "public function setOffset($offset)\n {\n $this->vkarg_offset = $offset;\n\n return $this;\n }", "private function calculateOffset() {\n $this->offset = ($this->currentpage - 1) * $this->limit;\n }", "public function offset(?int $offset): self;", "function setOffset($offset) {\n\t\t$this->_offset = 3600 * $offset;\n\t}", "public function testFindByQWithOffset()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'offset' => 0];\n $this->filterTest($filters, [$all[0]]);\n }", "function setOffset($value) {\n $this->offset = $value;\n }", "protected function getOffsetQuery()\n {\n return $this->offsetQuery;\n }", "function _limit_offset ($limit, $offset) {\n\t\t$statement = '';\n\t\tif (isset($limit) && $limit) {\n\t\t\tif (is_integer($limit)) {\n\t\t\t\t$statement .= \" LIMIT {$limit}\";\n\t\t\t} else {\n\t\t\t\t$statement .= \" LIMIT \" . intval($limit);\n\t\t\t}\n\t\t} else {\n\t\t\t$statement .= \" LIMIT 0\";\n\t\t}\n\t\tif (isset($offset) && $offset) {\n\t\t\tif (is_integer($offset)) {\n\t\t\t\t$statement .= \" OFFSET {$offset} \";\n\t\t\t} else {\n\t\t\t\t$statement .= \" OFFSET \" . intval($offset) . \" \";\n\t\t\t}\n\t\t}\n\t\treturn $statement;\n\t}", "public function offset($offset)\n\t{\n\t\t$this->offset = (int) $offset;\n\n\t\treturn $this;\n\t}", "public function offset($offset) {\n\t\t\t$this->builder->offset($offset);\n\t\t\treturn $this;\n\t\t}", "public function setOffset($value){\n \n $this->offset = $value;\n\n return $this;\n\n }", "function AddLimit($offset=-1, $numtofetch=-1)\n\t{\n\t\t$this->offset = $offset;\n\t\t$this->numtofetch = $numtofetch;\n\t\treturn ' ';\n\t}", "protected function compileOffset(Builder $query, $offset)\n {\n return 'SKIP '.(int) $offset;\n }", "public function setCurrentOffset($offset) {\n $this->setCurrentPage(floor($offset / $this->_itemsPerPage) + 1);\n $this->reset();\n }", "function limit_offset($limit = 0, $offset = 0) {\r\n \tif (!$limit) return false;\r\n\r\n \tif ($offset) {\r\n \t\treturn \" LIMIT $offset, $limit\";\r\n \t} else {\r\n \t\treturn \" LIMIT $limit\";\r\n \t}\r\n }", "public function offset($offset) {\n $this->_offset = (int) $offset;\n\n return $this;\n }", "function setPageNumberingOffset($offset) {\n $this->fields['page_numbering_offset'] = $offset;\n return $this;\n }", "function setOffset($offset) {\n if ($offset !== ($oldOffset = $this->offset)) {\n $this->offset = $offset;\n $this->updateDataControlRecords();\n }\n }", "public function offset( $offset ) {\n\t\t$this->isDirty( true );\n\t\t$this->_offset = $offset;\n\t\treturn $this;\n\t}", "public function offset(int $offset): self\n {\n $this->offset = $offset;\n\n return $this;\n }", "public static function offsetToCursor($offset)\n {\n }", "function offset($offset)\r\n\t{\r\n\t\t$this->db->offset($offset);\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function from($offset)\n {\n $this->from = $offset;\n return $this;\n }", "public function testOffset()\n {\n $obj_query = new \\Search\\Query();\n $this->assertEquals(0, $obj_query->getOffset());\n $obj_query->offset(121);\n $this->assertEquals(121, $obj_query->getOffset());\n $obj_query->offset(-10);\n $this->assertEquals(0, $obj_query->getOffset());\n $obj_query2 = $obj_query->offset(2001);\n $this->assertEquals(1000, $obj_query->getOffset());\n $this->assertSame($obj_query, $obj_query2);\n }", "public function setOffset($offset)\n {\n if ($offset < 1 || !is_int($offset)) {\n throw new \\InvalidArgumentException('setOffset() accepts only integers greater 0.', 1263387252);\n }\n $this->offset = $offset;\n\n return $this;\n }", "public function setOffset($offset)\n {\n if (is_integer($offset)) {\n $this->request->appendToParameter('options', 'skp-' . $offset);\n }\n\n return $this;\n }", "public function setMatchOffset($offset)\n {\n return $this->setOption('matchoffset', $offset);\n }", "protected abstract function getLimitOffsetClause($limit, $offset = 0);", "public function offset($offset = null)\n {\n if(null === $offset)\n {\n return $this->property('offset');\n }\n return $this->property('offset', (int) $offset);\n }", "private function setOffset($offset = null) {\n if ($offset !== null && Number::isNegative($offset)) {\n throw new DatabaseException('Provided offset is negative');\n }\n\n $this->offset = $offset;\n }", "public function offset($offset = null) {\n\t\tif ($offset !== null) {\n\t\t\t$this->_config['offset'] = (integer) $offset;\n\t\t\treturn $this;\n\t\t}\n\t\treturn $this->_config['offset'];\n\t}", "public function increment($field, $offset=1)\n {\n $offset = intval($offset);\n if ($offset == 0) {\n return 0;\n }\n $from_str = $this->getFromStr();\n $sql = \"UPDATE {$from_str} SET `{$field}` = `$field` + {$offset} WHERE {$this->where_str}\";\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $result = $this->execute($sql);\n return $result;\n }", "function mOFFSET(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$OFFSET;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:191:3: ( 'offset' ) \n // Tokenizer11.g:192:3: 'offset' \n {\n $this->matchString(\"offset\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function skip($value)\n {\n $this->extraQuery[\"offset\"] = $value;\n\n return $this;\n }", "public function from(int $offset): self\n\t{\n\t\t$this->offset = $offset;\n\n\t\treturn $this;\n\t}", "function offset($count) {\n\t\t$this->appendStmt('offset', \"OFFSET ?\", [$count]);\n\t\treturn $this;\n\t}", "public function offset(int $offset): self\n\t{\n\t\tif (!isset($offset))\n\t\t{\n\t\t\t$this->offset = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($offset < 0)\n\t\t\t{\n\t\t\t\t$this->error('Offset can not be lower than 0', __METHOD__);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->offset = $offset;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function offset($number)\n {\n return $this->newQuery([\n 'offset' => $number\n ]);\n }", "public function offset($offset)\n {\n if ( ! empty($offset)) {\n $this->builderCache->offset = (int)$offset;\n }\n\n return $this;\n }", "public function offset(int $offset): self\n {\n $this->offset = $offset;\n $this->rewind();\n\n return $this;\n }", "public function setOffset(int $value): GetSuggestions\n {\n $this->offset = $value;\n return $this;\n }", "public function preceding(int $offset): mixed;", "function addLimit( $limit , $offset )\n{\n\tif(!empty($limit))\n\t{\n\t\t$limit = ($limit < 0)?0:$limit;\n\t\tif(!empty($offset) )\n\t\t{\n\t\t\t$offset = ($offset < 0)?0:$offset;\n\t\t\treturn \" LIMIT $offset , $limit \" ;\n\t\t}\n\t\telse\n\t\t\treturn \" LIMIT 0 , $limit \" ;\n\t}\n\telse\n\t\treturn \" LIMIT 0 , 10 \" ;\n}", "public function __construct(int $offset)\n {\n $this->offset = $offset;\n }", "public function testFindByQWithOffsetAndLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'offset' => 0, 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'offset' => 1, 'limit' => 1];\n $this->filterTest($filters, [$all[1]]);\n }", "public function get_offset()\n {\n }", "function calculate_record_offset()\n\t{\n\t\treturn $this->results_per_page * ($this->page_number - 1);\n\t}", "public function offset($offset);", "function pagenationv3($offset) {\r\n\r\n \r\n $this->offset = NULL;\r\n $this->offset = $offset;\r\n $allrecord = $this->offset + 1;\r\n $extra = $allrecord +$this->limit-1;\r\n if ($allrecord > $this->countRecord) {\r\n $string=\"No Record\";\r\n } else {\r\n $string=\"<li><a href=\\\"#\\\" >\" . $allrecord . \" to \".$extra.\" from \" . $this->countRecord . \"</a></li>\";\r\n }\r\n return $string;\r\n }", "public static function offset($offset);", "public function setOffsetFor($objectId, $generation, $offset) {}", "private function setLimitAndOffset()\n {\n $this->offset = ($this->page - 1) * $this->config->limit;\n if ($this->config->limit == 0) {\n $this->config->limit = count(self::$needles);\n }\n }", "public function increment($key, $offset = 1);", "public function testFetchPageIntegerOffset(){\n $str_gql = \"SELECT * FROM Kind\";\n $obj_request = $this->getBasicFetchRequest();\n $obj_gql_query = $obj_request->mutableGqlQuery();\n $obj_gql_query->setAllowLiteral(TRUE);\n $obj_gql_query->setQueryString($str_gql . \" LIMIT @intPageSize OFFSET @intOffset\");\n\n $obj_arg = $obj_gql_query->addNameArg();\n $obj_arg->setName('intPageSize');\n $obj_arg->mutableValue()->setIntegerValue(11);\n\n $obj_arg_offset = $obj_gql_query->addNameArg();\n $obj_arg_offset->setName('intOffset');\n $obj_arg_offset->mutableValue()->setIntegerValue(22);\n\n $this->apiProxyMock->expectCall('datastore_v4', 'RunQuery', $obj_request, new \\google\\appengine\\datastore\\v4\\RunQueryResponse());\n\n $obj_store = $this->createBasicStore();\n $obj_result = $obj_store->query($str_gql)->fetchPage(11, 22);\n\n $this->assertEquals($obj_result, []);\n $this->apiProxyMock->verify();\n }", "public function skip($offset = 0);", "public function addLimit($_params , $_query)\n {\n \n $_query->setMaxResults($_params['length'])\n ->setFirstResult($_params['offset']);\n\n return $_query;\n }", "public function testFetchPageCursorOffset(){\n $str_gql = \"SELECT * FROM Kind\";\n $obj_request = $this->getBasicFetchRequest();\n\n $obj_gql_query = $obj_request->mutableGqlQuery();\n $obj_gql_query->setAllowLiteral(TRUE);\n $obj_gql_query->setQueryString($str_gql . \" LIMIT @intPageSize OFFSET @startCursor\");\n\n $obj_arg = $obj_gql_query->addNameArg();\n $obj_arg->setName('intPageSize');\n $obj_arg->mutableValue()->setIntegerValue(11);\n\n $obj_arg_offset = $obj_gql_query->addNameArg();\n $obj_arg_offset->setName('startCursor');\n $obj_arg_offset->setCursor('some-cursor-string');\n\n $this->apiProxyMock->expectCall('datastore_v4', 'RunQuery', $obj_request, new \\google\\appengine\\datastore\\v4\\RunQueryResponse());\n\n $obj_store = $this->createBasicStore();\n $obj_result = $obj_store->query($str_gql)->fetchPage(11, 'some-cursor-string');\n\n $this->assertEquals($obj_result, []);\n $this->apiProxyMock->verify();\n }", "protected function compileOffset(Builder $query, $offset)\n\t{\n\t\treturn '';\n\t}", "protected function getOffset(\\codename\\core\\model\\plugin\\offset $offset) : string {\r\n if ($offset->offset > 0) {\r\n return \" OFFSET \" . $offset->offset . \" \";\r\n }\r\n return '';\r\n }", "public function seekAhead(int $offset = 0): self\n {\n if ($this->validateSource()) {\n fseek($this->source->getStream(), $offset, SEEK_CUR);\n }\n return $this;\n }", "public function setLeaderLineOffset($offset) {}", "public function setCustomOffset($offset){\n try{\n if($offset<0){\n $this->customOffset = 0;\n return true;\n }\n $this->customOffset= (int)$offset;\n }catch (Exception $ex){\n $errorObj = new ErrorObj();\n\n $errorObj->params = \"offset\";\n $errorObj->msg = \"offset int required\";\n\n array_push($this->errorManager->errorObj,$errorObj);\n return false;\n }\n\n }", "public function offset(?int $offset = null) : int;", "protected function compileOffset(Builder $builder, $offset): string\n {\n return 'offset '.(int) $offset;\n }", "public function enableOffset();", "public function setOffset(int $value): GetAllComments\n {\n $this->offset = $value;\n return $this;\n }", "public function setOffset(int $value): Get\n {\n $this->offset = $value;\n return $this;\n }", "public function buildLimitOffset($limit = null, $offset = null)\n {\n $sql = [];\n\n if ($this->adapter instanceof Mssql) {\n if ($offset !== null || $limit !== null) {\n // If offset is null, sprintf will convert it to 0\n $sql[] = sprintf('OFFSET %d ROWS', $offset);\n }\n\n if ($limit !== null) {\n // FETCH FIRST n ROWS ONLY for OFFSET 0 would be an alternative here\n $sql[] = \"FETCH NEXT $limit ROWS ONLY\";\n }\n } else {\n if ($limit !== null) {\n $sql[] = \"LIMIT $limit\";\n }\n\n if ($offset !== null) {\n $sql[] = \"OFFSET $offset\";\n }\n }\n\n return implode($this->separator, $sql);\n }" ]
[ "0.776355", "0.7626903", "0.74018466", "0.7367883", "0.72331244", "0.71742326", "0.71242875", "0.7079999", "0.6908442", "0.6874884", "0.6871863", "0.6871863", "0.6815095", "0.67553097", "0.67488873", "0.6737942", "0.67322063", "0.67184025", "0.66726625", "0.6657502", "0.66472036", "0.6548081", "0.6528948", "0.65196615", "0.65046453", "0.6492422", "0.64917076", "0.64629763", "0.6377813", "0.63694024", "0.63441885", "0.63327384", "0.6331224", "0.6290515", "0.6277486", "0.62752384", "0.62742144", "0.6270188", "0.62644464", "0.62478125", "0.6245716", "0.6242015", "0.62334806", "0.6230116", "0.6220161", "0.6205733", "0.6202515", "0.61903715", "0.6186861", "0.6181916", "0.61718744", "0.61718315", "0.6170726", "0.61640364", "0.6162032", "0.6146174", "0.6142867", "0.61058605", "0.6065327", "0.6057684", "0.60539335", "0.60407895", "0.603776", "0.6036057", "0.5985799", "0.5951341", "0.5942749", "0.59348273", "0.59283286", "0.59100306", "0.590326", "0.5899426", "0.5895032", "0.5872939", "0.58491373", "0.58477145", "0.58181965", "0.5778989", "0.576604", "0.57536316", "0.5753395", "0.5741875", "0.5723298", "0.56805545", "0.56798023", "0.56439763", "0.5632028", "0.562759", "0.5627198", "0.5616167", "0.5591154", "0.5587832", "0.55848783", "0.55670905", "0.5561677", "0.5559744", "0.5557536", "0.55207765", "0.55048925", "0.5502793" ]
0.62857294
34
Insert a new record into the database.
public function insert(array $rows, Query $query = null) { $this->type = 'insert'; if ($query instanceof Query) { return $this->insert_select($rows, $query); } $this->rows = is_multiple($rows) ? $rows : array($rows); $this->columns = array_keys(reset($this->rows)); $this->set_binds(array_values_recursive($rows)); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}", "public function insert()\n {\n $this->id = insert($this);\n }", "public function insert($data);", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "abstract public function insertRecord($tableName, $record);", "public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\n\t}", "function insert($data)\n {\n $this->db->insert($this->table, $data);\n }", "public function insert() {\r\n\r\n\t\t// Does the Genre object already have an ID?\r\n\t\tif ( !is_null( $this->id ) ) trigger_error ( \"Genre::insert(): Attempt to insert an Genre object that already has its ID property set (to $this->id).\", E_USER_ERROR );\r\n\r\n\t\t// Insert the Genre\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$sql = \"INSERT INTO :table ( id, name ) VALUES ( :id, :name )\";\r\n\t\t$st = $conn->prepare ( $sql );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->bindValue( \":name\", $this->name, PDO::PARAM_STR );\r\n\t\t$st->execute();\r\n\t\t$this->id = $conn->lastInsertId();\r\n\t\t$conn = null;\r\n\t}", "public function insertRecord ($sqlString);", "public function _insert($data)\n {\n $this->insert($data);\n }", "public function insert()\n\t{\n\t\t$crud = $this->crud->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->insert();\n\t\t$this->redirect('crud');\n\t}", "public function insert(){\n\n global $db;\n\n /** Insert sql query */\n $sql = \"INSERT INTO tbl_calculator (num1, num2, oper, answer)\n VALUES (\" . $this->num1 .\", \" . $this->num2 . \", '\" .$this->oper. \"', \" .$this->answer. \" )\";\n\n /** insert result maintain in log file */ \n error_log($sql);\n\n if ($db->query($sql) === TRUE) {\n error_log(\"New record created successfully\");\n } else {\n error_log(\"Error: \" . $sql . \"<br>\" . $db->error);\n }\n return;\n }", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "public function insert() {\n\n // Does the Course object already have an ID?\n if ( !is_null( $this->courseId ) ) trigger_error ( \"Course::insert(): Attempt to insert course object that already has its ID property set (to $this->courseId).\", E_USER_ERROR );\n\n // Insert the course\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO course ( courseCode, courseName, description, headTeacher )\n VALUES (:courseCode,:courseName,:description,:headTeacher)\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":courseCode\", $this->courseCode, PDO::PARAM_STR );\n $st->bindValue( \":courseName\", $this->courseName, PDO::PARAM_STR );\n $st->bindValue( \":description\", $this->description, PDO::PARAM_STR );\n $st->bindValue( \":headTeacher\", $this->headTeacher, PDO::PARAM_STR );\n\n $st->execute();\n $this->courseId = $conn->lastInsertId();\n $conn = null;\n }", "public function insert() {\n \n }", "function insert_record () {\n // validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // insert data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"INSERT INTO customers (name,email,mobile) values(?, ?, ?)\";\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->create_record();\n }\n }", "public function save_new_record() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$db_data = $this->get_db_data();\r\n\r\n\t\t$table_name = $wpdb->prefix . CTF_POSTS_TABLE;\r\n\t\t$data = array(\r\n\t\t\t'twitter_id' => $db_data['twitter_id'],\r\n\t\t\t'created_on' => $db_data['created_on'],\r\n\t\t\t'last_requested' => $db_data['last_requested'],\r\n\t\t\t'time_stamp' => $db_data['time_stamp'],\r\n\t\t\t'json_data' => $db_data['json_data'],\r\n\t\t\t'media_id' => $db_data['media_id'],\r\n\t\t\t'sizes' => $db_data['sizes'],\r\n\t\t\t'aspect_ratio' => $db_data['aspect_ratio'],\r\n\t\t\t'images_done' => $db_data['images_done']\r\n\t\t);\r\n\t\t$format = array(\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%d',\r\n\t\t\t'%d'\r\n\t\t);\r\n\t\t$error = $wpdb->insert( $table_name, $data, $format );\r\n\r\n\t\tif ( $error !== false ) {\r\n\t\t\t$insert_id = $wpdb->insert_id;\r\n\r\n\t\t\t$this->db_id = $insert_id;\r\n\t\t\t$this->insert_ctf_feeds_posts();\r\n\t\t} else {\r\n\t\t\t// log error\r\n\t\t}\r\n\t}", "public abstract function insert();", "public function insert($data)\n {\n if (isset($this->columns[\"created\"])) {\n $data[\"created\"] = date(\"Y-m-d H:i:s\");\n }\n return $this->schema->insert($this->name, $data);\n }", "public abstract function Insert();", "protected function insert()\n {\n $insert = 'INSERT INTO users (first_name, last_name, email, password)\n VALUES (:first_name, :last_name, :email, :password)';\n $statement = self::$dbc->prepare($insert);\n unset($this->attributes['id']);\n foreach ($this->attributes as $key => $value) {\n $statement->bindValue(\":$key\", $value, PDO::PARAM_STR);\n }\n $statement->execute();\n $this->attributes['id'] = self::$dbc->lastInsertId();\n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "public static function insert()\n {\n }", "public function insert() {\n if($this->id != 0){\n return null;\n }\n // Connect to db\n $db = Db::instance();\n\n // Build query\n $q = sprintf(\"INSERT INTO `%s` (`user_id`, `story_id`, `comment`) VALUES (%d, %d, %s);\", self::DB_TABLE, $db->escape($this->user_id), $db->escape($this->story_id), $db->escape($this->comment));\n\n // Execute query\n $db->query($q);\n\n // Set the ID for the new object\n $this->id = $db->getInsertID();\n return $this->id;\n }", "public function insert() {\n\n // Does the program object already have an ID?\n if ( !is_null( $this->programID ) ) trigger_error ( \"program::insert(): Attempt to insert an program object that already has its ID property set (to $this->id).\", E_USER_ERROR );\n\n // Insert the program\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO programs ( programName, programStart, programFrequency ) VALUES ( :programName, :programStart, :programFrequency )\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":programName\", $this->programName, PDO::PARAM_STR );\n $st->bindValue( \":programStart\", $this->programStart, PDO::PARAM_STR );\n\t$st->bindValue( \":programFrequency\", $this->programFrequency, PDO::PARAM_STR );\n $st->execute();\n $this->programID = $conn->lastInsertId();\n $conn = null;\n }", "protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }", "public function insert()\n {\n \n }", "protected function saveInsert()\n {\n }", "function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}", "public function recInsert($record) {\n $conn = Query::connect();\n $col = $conn->SelectLimit(\"select*from \".static::getTable(),1);\n $sql = $conn->GetInsertSQL($col,$record);\n $rs = $conn->Execute($sql);\n return $conn->ErrorNo();\n }", "public function insert($data)\r\n {\r\n \r\n }", "abstract public function insert();", "public function insertAction()\r\n\t{\r\n\t\tif ($this->request->getPost('submit')) {\r\n\t\t\t$name = $this->request->getPost('name');\r\n\t\t\t$phone = $this->request->getPost('phone');\r\n\t\t\t$arrPost = array('name' => $name, 'phone' => $phone);\r\n\t\t\t$room = new Room();\r\n\t\t\tif ($room->save($arrPost)) {\r\n\t\t\t\t$this->response->redirect(\"/users/index\", true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function insert($data)\n {\n return $this->db->insert($this->name, $data);\n }", "public function insert()\n {\n # code...\n }", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public static function insert()\n {\n if (isset($_POST['name'], \n $_POST['telephone'],\n $_POST['mobile'],\n $_POST['email'],\n $_POST['clientid'])) {\n ContactDAO::create($_POST['name'], \n $_POST['telephone'],\n $_POST['mobile'],\n $_POST['email'],\n $_POST['clientid']);\n }\n }", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function insert()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->newItemEntry();\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $this->getEntry()->setItemType($this->_getItemType());\n $entry = $service->insertGbaseItem($this->getEntry());\n $this->setEntry($entry);\n $entryId = $this->getEntry()->getId();\n $published = $this->gBaseDate2DateTime($this->getEntry()->getPublished()->getText());\n $this->getItem()\n ->setGbaseItemId($entryId)\n ->setPublished($published);\n\n if ($expires = $this->_getAttributeValue('expiration_date')) {\n $expires = $this->gBaseDate2DateTime($expires);\n $this->getItem()->setExpires($expires);\n }\n }", "public function insert(Table $table, $row);", "protected function _insert()\n\t{\n\t}", "public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }", "public function NewRecord()\n {\n global $g_BizSystem;\n $this->SetDisplayMode(MODE_N);\n $recArr = $this->GetNewRecord();\n if (!$recArr)\n return $this->ProcessDataObjError();\n $this->UpdateActiveRecord($recArr);\n // TODO: popup message of new record successful created\n return $this->ReRender();\n }", "public function insert() {\n\t\t$insert_array = $this->toDbArray(true, true);\n\t\tif (array_key_exists('_id', $insert_array)) { unset($insert_array['_id']); }\n\t\t$ret_val = $this->getCollection()->save($insert_array);\n\t\tif (isset($insert_array['_id'])) {\n\t\t\t$this->setId($insert_array['_id']);\n\t\t}\n\t\treturn $this->getId();\n\t}", "public final function insert()\n {\n // Run beforeCreate event methods and stop when one of them return bool false\n if ($this->runBefore('create') === false)\n return false;\n\n // Create tablename\n $tbl = '{db_prefix}' . $this->tbl;\n\n // Prepare query and content arrays\n $fields = array();\n $values = array();\n $keys = array();\n\n // Build insert fields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n // Regardless of all further actions, check and cleanup the value\n $val = $this->checkFieldvalue($fld, $val);\n\n // Put fieldname and the fieldtype to the fields array\n $fields[$fld] = $this->getFieldtype($fld);\n\n // Object or array values are stored serialized to db\n $values[] = is_array($val) || is_object($val) ? serialize($val) : $val;\n }\n\n // Add name of primary key field\n $keys[0] = $this->pk;\n\n // Run query and store insert id as pk value\n $this->data->{$this->pk} = $this->db->insert('insert', $tbl, $fields, $values, $keys);\n\n return $this->data->{$this->pk};\n }", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "function insert($data)\n {\n $this->db->insert($this->table, $data);\n }", "function insert()\n\t{\n\t\t$this->edit(true);\n\t}", "public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}", "public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }", "public function create($insert)\n\t\t{\n\t\t\t$ret = $this->db->insert($this->record, $insert);\n\t\t\treturn $ret;\n\t\t}", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function insert_entry()\r\n\t{\r\n\t\t$this->db->insert(\"email_workflow\", $this);\r\n\t}", "public function insert(){\n\t\t// $post->title = 'A post from the insert method';\n\t\t// $post->body = 'Some random ghibberrish';\n\t\t// $post->save();\n\n\t\t$data = array(\n\t\t\t'title' => 'A post from the insert method, using the data array',\n\t\t\t'body' => 'Some random ghibberrish, using the data array',\n\t\t\t'user_id' => 1\n\t\t);\n\n\t\tPost::create($data);\n\n\t\tdd('post inserted');\n\t}", "public function insertProduct(Product $product);", "public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }", "public static function Insert(){\r\n }", "function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}", "function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }", "public function insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }", "public function insert() {\n\t\t$db = self::getDB();\n\t\t$sql = \"INSERT INTO posts\n\t\t\t\t\t(nome, conteudo, fk_idUsuario, fk_idTopico)\n\t\t\t\tVALUES\n\t\t\t\t\t(:nome, :conteudo, :fk_idUsuario, :fk_idTopico)\";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':nome' => $this->getNome(),\n\t\t\t':conteudo' => $this->getConteudo(),\n\t\t\t':fk_idUsuario' => $this->getFkIdUsuario(),\n\t\t\t':fk_idTopico' => $this->getFkIdTopico()\n\t\t]);\n\t\t$this->idPost = $db->lastInsertId();\n\t}", "public function insert(DataObject $insertObject, Database_Config $databaseConfig = NULL);", "function insert() {\n\t\tglobal $_DB_DATAOBJECT; //Indicate to PHP that we want to use the already-defined global, as opposed to declaring a local var\n\t\t//Grab the database connection that has already been made by the parent's constructor:\n\t\t$__DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];\n\t\tif ($this->reg_type != null) {\n\t\t\t$this->badge_number = $__DB->nextId('badge_number'); //Fetch the next id in the sequence. To set the sequence to a specifc value, use phpMyAdmin to tweak the value in the badge_number_seq table\n\t\t}\n\t\treturn DB_DataObject::insert();\n\t}", "public function insert($tableName, $data);", "public function insert(stubObject $entity);", "public function createRecord()\n {\n $sql = sprintf(\n \"INSERT INTO %s (%s) values (%s)\", \"Cubans\",\n implode(\", \", array_keys($this->arrayKeysValues())),\n \":\" . implode(\", :\", array_keys($this->arrayKeysValues()))\n );\n $statement = $this->connect->prepare($sql);\n\t\t$statement->execute($this->arrayKeysValues());\n }", "protected function performInsert()\n {\n $attributes = $this->getAttributes();\n $updatedField = $this->getApi()->{'create'.ucfirst($this->getEntity())}($attributes);\n $this->fill($updatedField);\n $this->exists = true;\n $this->wasRecentlyCreated = true;\n\n return true;\n }", "public function insert() {\r\n // Rôle : insérer l'objet courant dans la base de données\r\n // Retour : true / false\r\n // Paramètre : aucun\r\n \r\n // Vérification de l'id\r\n if (!empty($this->getId())) {\r\n debug(get_class($this).\"->insert() : l'objet courant a déjà un id\");\r\n return false;\r\n }\r\n \r\n // Construction de la requête\r\n $sql = \"INSERT INTO `\".$this->getTable().\"` SET \";\r\n $param = [];\r\n $start = true;\r\n \r\n foreach ($this->getChamps() as $nom => $champs) {\r\n if ($nom === $this->getPrimaryKey() or !$champs->getAttribut(\"inBdd\")) {\r\n continue;\r\n }\r\n if ($start) {\r\n $sql .= \"`$nom` = :$nom\";\r\n $start = false;\r\n } else {\r\n $sql .= \", `$nom` = :$nom\";\r\n }\r\n \r\n $param[\":$nom\"] = $champs->getValue();\r\n }\r\n \r\n $sql .= \";\";\r\n \r\n // Préparation de la requête\r\n $req = self::getBdd()->prepare($sql);\r\n \r\n // Exécution de la requête\r\n if (!$req->execute($param)) {\r\n debug(get_class($this).\"->insert() : échec de la requête $sql\");\r\n return false;\r\n }\r\n \r\n // Assignation de l'id\r\n if ($req->rowCount() === 1) {\r\n $this->set($this->getPrimaryKey(), self::getBdd()->lastInsertId());\r\n return true;\r\n } else {\r\n debug(get_class($this).\"->insert() : aucune entrée, ou bien plus d'une entrée, créée\");\r\n return false;\r\n }\r\n }", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function insert($data){\n $url = $this->urlWrapper() . URLResources::INSERT;\n return $this->makeRequest($url, \"POST\", 1, $data);\n }", "public function insert(array $params);", "function insert() {\n if(!$this->valid):\n return;\n endif;\n \n $this->name = mysql_real_escape_string($this->name);\n $this->brief = mysql_real_escape_string($this->brief);\n $this->description = mysql_real_escape_string($this->description);\n $this->games = mysql_real_escape_string($this->games);\n $this->headquarter = mysql_real_escape_string($this->headquarter);\n \n $sql = \"INSERT INTO companies\n (name, brief, description, date_founded, headquarter, website, imageURL, games, num_likes)\n VALUES\n ('$this->name', '$this->brief', '$this->description', '$this->date_founded', '$this->headquarter', '$this->website', '$this->imageURL', '$this->games', '$this->num_likes')\";\n \n if(!mysqli_query($this->con, $sql)) {\n die('Error: ' . mysqli_error($this->con));\n }\n \n //mysqli_close($con);\n \n echo \"<br>Insertion Successful!<br>\";\n }", "public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }", "public function Do_insert_Example1(){\n\n\t}", "public function insert($attributes);", "public function insert(){\n\n }", "public function insert()\n\t{\n\t\tif (isset($this->item->params) && $this->item->params instanceof CRegistry) {\n\t\t\t$this->item->params = $this->item->params->toString();\n\t\t}\n\n\t\t$ret = $this->db->insertObject('#__'.$this->table, $this->item);\n\n\t\t//Get the new record id\n\t\t$id = (int)$this->db->insertid();\n\n\t\t$this->setKey($id);\n\n\t\treturn $this;\n\t}", "public function insertRow($row);", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "public function insert($post);", "public function testInsert()\n {\n // todo create this in other database or maybe create mockup\n \n /*\n $arr = array (\n 'head' => 'Hello World!!',\n 'body' => 'Hello this is my world..',\n 'created' => date('Y-m-d H:i:s')\n );\n\n $this->noteTable->insert($arr);\n */\n }", "public function insert()\n\t{\n\t\t$sql_array = array();\n\t\tforeach ($this->object_config as $name => $null)\n\t\t{\n\t\t\t$sql_array[$name] = $this->validate_property($this->$name, $this->object_config[$name]);\n\t\t}\n\n\t\t$sql = 'INSERT INTO ' . $this->sql_table . ' ' . $this->db->sql_build_array('INSERT', $sql_array);\n\t\t$this->db->sql_query($sql);\n\n\t\tif ($id = $this->db->sql_nextid())\n\t\t{\n\t\t\t$this->{$this->sql_id_field} = $id;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "public static function insertRecord(string $table, array $data)\n {\n try {\n return Capsule::table($table)->insert($data);\n } catch (Exception $ex) {\n logActivity(\"Can not insert data into {$table}, error: {$ex->getMessage()}\");\n }\n }", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "protected function insert()\n\t{\n\t\t//prepare placeholders for SQL query\n\t\t$placeholders = implode(\",\", array_fill(0, count($this->attributes), \"?\"));\n\t\t//prepare columns names for SQL query\n\t\t$columns = implode( \"`,`\", array_keys($this->attributes) );\n\t\t\n\t\t$methodAttributes = array_values($this->attributes);\n\t\t// add first method attribute - query\n\t\tarray_unshift($methodAttributes, \"INSERT INTO `\" . static::$table . \"` (`$columns`) VALUES ($placeholders)\");\n\t\t\n\t\t// inserting\n\t\t$result = call_user_func_array(\"Database::insert\", $methodAttributes);\n\t\tif( $result )\n\t\t{\n\t\t\t$this->isExist = true;\n\t\t\t// set PK\n\t\t\t$this->attributes[static::$primaryKey] = Database::lastInsertId();\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function insert_() {\n\n\n\t\t\t$podcast = Model\\Podcast::get_instance();\n\n\t\t}", "protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }" ]
[ "0.7520839", "0.7298838", "0.7285979", "0.7129996", "0.699895", "0.6936164", "0.6877725", "0.6872298", "0.6809344", "0.6807599", "0.6762673", "0.6745741", "0.673836", "0.6731293", "0.6711848", "0.6711357", "0.67056656", "0.66840106", "0.6654863", "0.6651107", "0.6649941", "0.66228163", "0.6602031", "0.65990025", "0.6591043", "0.65762836", "0.65727526", "0.6568241", "0.65660596", "0.65593326", "0.65593326", "0.6544119", "0.6539506", "0.65214837", "0.6514496", "0.6511506", "0.6502525", "0.6500435", "0.64999074", "0.64821446", "0.64806384", "0.6480431", "0.64713204", "0.6462176", "0.64609206", "0.64586204", "0.6444487", "0.64412856", "0.6435535", "0.64071417", "0.63993967", "0.6388093", "0.63851845", "0.63816476", "0.6372352", "0.63534206", "0.63534206", "0.6346135", "0.634277", "0.6338438", "0.63307774", "0.632998", "0.6326032", "0.6316048", "0.6314285", "0.6311013", "0.6296935", "0.6295324", "0.6287497", "0.6264454", "0.62631774", "0.6248556", "0.62455744", "0.6243818", "0.62237793", "0.6214411", "0.620569", "0.62053984", "0.62047315", "0.6201708", "0.6197164", "0.6195315", "0.6192781", "0.6189903", "0.6179364", "0.61663294", "0.61548334", "0.61523193", "0.61517465", "0.6146705", "0.6146117", "0.61459816", "0.6140905", "0.6133485", "0.6132661", "0.6128114", "0.611659", "0.6113577", "0.6110136", "0.6085466", "0.6084857" ]
0.0
-1
Copy all records returned by query
public function insert_select(array $columns, Query $query) { $this->columns = $columns; $this->set_binds($query->binds); $this->rows = $query; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rowsBackup()\n {\n $this->rowsBackup = $this->pObj->rows;\n }", "public function cleanCopy()\n {\n $clone = clone $this;\n $clone->setEagerLoader(clone $this->getEagerLoader());\n $clone->triggerBeforeFind();\n $clone->enableAutoFields(false);\n $clone->limit(null);\n $clone->order([], true);\n $clone->offset(null);\n $clone->mapReduce(null, null, true);\n $clone->formatResults(null, true);\n $clone->setSelectTypeMap(new TypeMap());\n $clone->decorateResults(null, true);\n\n return $clone;\n }", "private function transfer_data()\n\t{\n\t\t$num_rows = db::select_one(\"select count(*) from {$this->table}\");\n\t\t\n\t\tfor ($i = 0; $i < $num_rows; $i += BATCH_SIZE)\n\t\t{\n\t\t\techo \"$i / $num_rows (select {$this->before_alter_select_query} from {$this->table})\\n\";\n\t\t\t$r = mysql_query(\"select {$this->before_alter_select_query} from {$this->table} limit $i, \".BATCH_SIZE);\n\t\t\twhile ($d = mysql_fetch_assoc($r))\n\t\t\t{\n\t\t\t\tif ($this->renamed_cols)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->renamed_cols as $before_key => $after_key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d[$after_key] = $d[$before_key];\n\t\t\t\t\t\tunset($d[$before_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdb::insert($this->temp_table, $d);\n\t\t\t}\n\t\t}\n\t}", "public function copy();", "public function __clone()\n {\n $this->query = clone $this->query;\n }", "function copylist()\n\t{\n\t\t$companydetails=\"SELECT * from company\";\n\t\t$getcompanydetails=$this->get_results( $companydetails );\n\t\treturn $getcompanydetails;\n\t}", "public function getCopy();", "public function getCopy();", "function copy(){ return $this->_copy(); }", "function Copy(&$data){\n // -- get storage\n $storageName = $this->listSettings->GetItem(\"MAIN\", \"TABLE\");\n $this->Kernel->ImportClass(\"data.\" . $storageName, $storageName);\n $Storage = new $storageName($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $storageName));\n\n //return;\n //-- get copy field name\n if ($this->listSettings->HasItem(\"MAIN\", \"COPY_NAME_FIELD\")) {\n $_name_field = $this->listSettings->GetItem(\"MAIN\", \"COPY_NAME_FIELD\");\n }\n else {\n $_name_field = TableHelper::GetFirstNotKeyColumn($Storage);\n }\n\n $this->copy_Storage = $Storage;\n // insert loop\n foreach ($data as $i => $item_id) {\n //get record\n $record = $Storage->Get(array(\n $this->key_field => $item_id));\n //get copy records count\n $_count = $Storage->GetCount(array(\n $_name_field => $record[$_name_field] . \" (%)\"));\n\n $_count ++;\n $record[$_name_field] = $record[$_name_field] . \" ($_count)\";\n //insert record\n\n\n $Storage->Insert($record);\n\n // get ID of inserted record\n $insert_id = $Storage->getInsertId();\n // get priority column\n if ($this->listSettings->HasItem(\"Main\", \"COPY_NAME_FIELD\")) {\n $priority_column = $this->listSettings->GetItem(\"Main\", \"COPY_NAME_FIELD\");\n }\n elseif ($Storage->HasColumn(\"_priority\")) {\n $priority_column = \"_priority\";\n }\n\n if (strlen($priority_column)) { // if priority column exists\n $priority_data = array(\n $this->key_field => $insert_id ,\n $priority_column => $insert_id);\n if (count($unique_fields)) { // if unique fields is found\n foreach ($unique_fields as $i => $ufield) {\n if ($ufield != $_name_field)\n $priority_data[$ufield] = $record[$ufield] . \" (\" . $insert_id . \")\";\n }\n }\n // update priority and unique field\n $Storage->Update($priority_data);\n }\n\n if ($this->listSettings->HasItem(\"MAIN\", \"USE_SUB_CATEGORIES\")) {\n $use_sub_categories = $this->listSettings->GetItem(\"MAIN\", \"USE_SUB_CATEGORIES\");\n }\n else {\n $use_sub_categories = false;\n }\n\n //--if library use subcategories\n if ($use_sub_categories) {\n $message = \"\";\n $sub_categories_count = $this->listSettings->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n // subcategories loop\n for ($i = 0; $i < sizeof($sub_categories_count); $i ++) {\n // get library settings\n $library = $this->listSettings->GetItem(\"sub_category_\" . $i, \"APPLY_LIBRARY\");\n $link_field = $this->listSettings->GetItem(\"sub_category_\" . $i, \"LINK_FIELD\");\n // get subcategory library config\n $sub_listSettings = Engine::getLibrary($this->Kernel, $library, \"sub_ListSettings_\" . $library);\n\n //-- get subcategory storage\n $sub_table = $sub_listSettings->GetItem(\"MAIN\", \"TABLE\");\n $this->Kernel->ImportClass(\"data.\" . strtolower($sub_table), $sub_table);\n $sub_Storage = new $sub_table($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $sub_table));\n\n //--get subcategory items\n $list = $sub_Storage->GetList(array(\n $link_field => $item_id));\n\n //-- get priority column\n $priority_column = \"\";\n if ($sub_listSettings->HasItem(\"Main\", \"COPY_NAME_FIELD\")) {\n $priority_column = $sub_listSettings->GetItem(\"Main\", \"COPY_NAME_FIELD\");\n }\n elseif ($sub_Storage->HasColumn(\"_priority\")) {\n $priority_column = \"_priority\";\n }\n //--get unique columns\n $unique_fields = array();\n if ($sub_listSettings->HasItem(\"MAIN\", \"UNIQUE_FIELDS\")) {\n $unique_fields = explode(\",\", $sub_listSettings->GetItem(\"MAIN\", \"UNIQUE_FIELDS\"));\n }\n // get subcategory key field\n $sub_keyfields = $sub_Storage->getKeyColumns();\n $sub_keyfield = $sub_keyfields[0][\"name\"];\n\n if ($list->RecordCount != 0) {\n while ($sub_item = $list->Read()) {\n $sub_item[$link_field] = $insert_id;\n\n // insert subcategory\n $sub_Storage->Insert($sub_item);\n\n //get inserted subcategory ID\n $sub_list = $sub_Storage->GetList(array(), array(\n $sub_keyfield => 0), 1, 0);\n $sub_item = $sub_list->Read();\n $sub_insert_id = $sub_item[$sub_keyfield];\n if (strlen($priority_column)) { // if priority column exists\n $priority_data = array(\n $sub_keyfield => $sub_insert_id ,\n $priority_column => $sub_insert_id);\n if (count($unique_fields)) { // if unique fields is found\n foreach ($unique_fields as $i => $ufield) {\n if ($ufield != $_name_field)\n $priority_data[$ufield] = $sub_item[$ufield] . \" (\" . $sub_insert_id . \")\";\n }\n }\n // update priority and unique fields\n $sub_Storage->Update($priority_data);\n }\n }\n }\n } // for\n }\n $this->OnAfterCopy($item_id, $insert_id);\n }\n }", "public function CopyRecord()\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n foreach ($rec as $k=>$v)\n $rec[$k] = addslashes($v);\n global $g_BizSystem;\n // get new record array\n $recArr = $this->GetDataObj()->NewRecord();\n\n $rec[\"Id\"] = $recArr[\"Id\"]; // replace with new Id field. TODO: consider different ID generation type\n $this->m_RecordRow->SetRecordArr($rec);\n $ok = $this->GetDataObj()->InsertRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n return $this->ReRender();\n }", "public function copy() {\n\n\t\t// check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// check type\n\t\t$responseType = (KRequest::getString('show_list') == '1') ? 'list' : 'json';\n\n\t\t// set ids or just one id\n\t\t$id = KRequest::getInt('id');\n\t\t$ids = KRequest::getString('ids');\n\n\t\t// The system takes in 'id' or 'ids'. In either case, we make an array $ids for looping later\n\t\tif(!empty($ids)) {\n\t\t\t$ids = explode(',', $ids);\n\t\t}\n\t\telseif($id){\n\t\t\t$ids = [$id];\n\t\t}\n\t\telse $ids = [];\n\n\t\t// Cast all IDs to int for sanitation\n\t\tforeach ($ids as &$id) {\n\t\t\t$id = intval($id);\n\t\t}\n\t\tunset($id);\n\n\t\t// Set the mime type for the response for JSON response\n\t\tif($responseType == 'json') {\n\t\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\t\t}\n\n\t\t// Bounce if no record ID came in\n\t\tif(empty($ids)) {\n\n\t\t\tif($responseType == 'json') {\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'errors' => array(KText::_('Please select a record to copy')),\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$error = KText::_('Please select a record to copy');\n\t\t\t\tKenedoPlatform::p()->sendSystemMessage($error, 'error');\n\t\t\t\tKenedoViewHelper::addMessage($error, 'error');\n\t\t\t\t$this->display();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tKLog::log('Starting copying data for Controller \"' . get_class($this) . '\". - ' . KLog::time('ModelCopyMethod'), 'custom_copying');\n\n\t\t// Start a transaction, if any record fails to copy, we roll back all DB changes.\n\t\tKLog::log('Controller '.get_class($this). ' starts its transaction.', 'custom_copying');\n\t\tKenedoPlatform::getDb()->startTransaction();\n\n\t\ttry {\n\n\t\t\t$newId = null;\n\t\t\t$newIds = array();\n\n\t\t\t// Get the model and the record we gotta copy\n\t\t\t$model = $this->getDefaultModel();\n\t\t\t// Prepare the language tags\n\t\t\t$languageTags = KenedoLanguageHelper::getActiveLanguageTags();\n\n\t\t\t// loop trough ids\n\t\t\tforeach ($ids as $id) {\n\n\t\t\t\t$record = $model->getRecord($id);\n\n\t\t\t\t// Until we got a better way, assume there is a title (or otherwise a name) and append 'Copy' to it\n\t\t\t\tforeach ($languageTags as $languageTag) {\n\n\t\t\t\t\tif (!empty($record->{'title-' . $languageTag})) {\n\t\t\t\t\t\t$record->{'title-' . $languageTag} = $record->{'title-' . $languageTag} . ' (' . KText::_('COPY_NOUN') . ')';\n\t\t\t\t\t}\n\t\t\t\t\telseif (!empty($record->{'name-' . $languageTag})) {\n\t\t\t\t\t\t$record->{'name-' . $languageTag} = $record->{'name-' . $languageTag} . ' (' . KText::_('COPY_NOUN') . ')';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Copy the record, $response will be false or the ID of the new record\n\t\t\t\t$response = $model->copy($record);\n\n\t\t\t\t// If things went bad, report (logging already happened in the model)\n\t\t\t\tif ($response === false) {\n\t\t\t\t\t$error = 'Record '.$record->id.' failed to copy, error messages from model are: ' . implode(', ', $model->getErrors());\n\t\t\t\t\tthrow new Exception($error);\n\t\t\t\t}\n\n\t\t\t\t// Prepare new record id and controller name\n\t\t\t\t$newIds[] = $newId = $response;\n\n\t\t\t}\n\n\t\t\t// success\n\t\t\tKLog::log('Controller '.get_class($this). ' commits its transaction.', 'custom_copying');\n\t\t\tKenedoPlatform::getDb()->commitTransaction();\n\n\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\n\t\t\t// Purge the cache\n\t\t\t$this->purgeCache();\n\n\t\t\t// Deliver the good news\n\t\t\tif($responseType == 'json') {\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'success' => true,\n\t\t\t\t\t'messages'=>array(KText::_('Records copied')),\n\t\t\t\t\t'newId' => $newId,\n\t\t\t\t\t'newIds' => $newIds,\n\t\t\t\t\t'redirectUrl' => KLink::getRoute('index.php?option=' . $this->component . '&controller=' . $controllerName . '&task=edit&id=' . $newId, false),\n\t\t\t\t));\n\t\t\t}\n\t\t\telseif($responseType == 'list'){\n\t\t\t\t$msg = KText::_('Records copied.');\n\t\t\t\tKenedoPlatform::p()->sendSystemMessage($msg, 'notice');\n\t\t\t\tKenedoViewHelper::addMessage($msg, 'notice');\n\t\t\t\t$this->display();\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\t\tcatch (Exception $e) {\n\n\t\t\tKLog::log($e->getMessage(), 'error');\n\t\t\tKLog::log($e->getMessage(), 'custom_copying');\n\t\t\tKLog::log('Controller '.get_class($this). ' rolls back its transaction.', 'custom_copying');\n\n\t\t\tKenedoPlatform::getDb()->rollbackTransaction();\n\n\t\t\t// Purge the cache\n\t\t\t$this->purgeCache();\n\n\t\t\t$errorMsg = KText::_('A system error occurred during copying. Diagnostic data is in the ConfigBox error log. Please notify your service provider.');\n\t\t\t// error response\n\t\t\tif ($responseType == 'json') {\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'errors' => [$errorMsg],\n\t\t\t\t));\n\t\t\t} elseif ($responseType == 'list') {\n\t\t\t\tKenedoPlatform::p()->sendSystemMessage($errorMsg, 'error');\n\t\t\t\tKenedoViewHelper::addMessage($errorMsg, 'error');\n\t\t\t\t$this->display();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n }", "function &copy( )\n {\n $new = $this;\n $new->unsetID();\n $new->store();\n\n return $new;\n }", "public function copycurrentrow()\n\t{\n\t\t// 1005 = Copy Profile\n\t\t$reasonID = 1005; // copy profile\n\t\treturn $this->copyrow($this->id, $reasonID);\n\t}", "public function __clone()\n {\n $this->table = clone $this->table;\n }", "public function testCopySaveAll() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\t\t$before = $this->Article->copyFindData(1);\n\t\t$save = $before;\n\t\tunset($save['Tag']);\n\t\t$saved = $this->Article->copySaveAll($save);\n\t\t$this->assertTrue($saved);\n\n\t\t$id = $this->Article->id;\n\t\t$this->assertEquals($id, 1);\n\n\t\t$after = $this->Article->copyFindData(1);\n\t\t$this->assertEquals($before, $after);\n\n\t\t$this->assertEquals(\n\t\t\tarray(\n\t\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t\t),\n\t\t\t$initialCounts\n\t\t);\n\t}", "function get_copy()\r\n\t{\r\n\t\t$copy = clone($this);\r\n\r\n\t\t$copy->id = NULL;\r\n\r\n\t\treturn $copy;\r\n\t}", "public function __clone()\r\n {\r\n $this->document = [];\r\n $this->document_id = 0;\r\n\r\n $this->documentTotal = 0;\r\n $this->documentExchageTotal = 0;\r\n\r\n $this->associatedDocuments = [];\r\n }", "public function reset() {\r\n\t\tforeach ($this->_metadata->getNames() as $name){\r\n\t\t\tif($this->isPrimaryKey($name)){\r\n\t\t\t\t$this->_record[$name] = $this->getPrimaryKey() ;\r\n\t\t\t}else{\r\n\t\t\t\t$this->_record[$name] = $this->{$name} ;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->_record ;\r\n\t}", "abstract protected function copy();", "public function getArrayCopy();", "public function copy(): self;", "public function copy()\n {\n $set = clone $this;\n return $set;\n }", "function remake()\n {\n $result = parent::select($this->table, '*', null);\n parent::closeConection();\n \n return $result;\n }", "function &postCopy () {\n \t\t/* override to copy fields as necessary to complete the full copy. */\n \t\treturn $this;\n \t}", "private function copyData()\n {\n $connection = Yii::app()->db;\n $transaction = $connection->beginTransaction();\n try {\n $connection->createCommand('INSERT INTO ' . $connection->quoteTableName($this->tableMemory) . ' SELECT * FROM ' . $connection->quoteTableName($this->table))->execute();\n $transaction->commit();\n return true;\n } catch (Exception $e) {\n Yii::log('Transaction error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n $transaction->rollback();\n }\n }", "public static function cloneResultMap($base, array $data, $columnMap, $dirtyState, $keepSnapshots=null) {}", "public function all()\n {\n $sql = $this->get();\n $this->query = $sql;\n }", "private static function duplicateRecord($from, $to) {\n $fields = $from->as_array();\n unset($fields['id']);\n foreach ($fields as $name => $value) {\n $to->$name = $value;\n }\n\n return $to;\n }", "public function __clone()\n {\n $this->select = clone $this->select;\n }", "public function __clone() {\n if ($this->_where) {\n $this->_where = clone $this->_where;\n }\n\n if ($this->_having) {\n $this->_having = clone $this->_having;\n }\n }", "public function cleanCopy();", "public static function batchCopy() {\n $result = array();\n $copied = lC_Products_Admin::batchCopy($_GET['batch'], $_GET['new_category_id'], $_GET['copy_as']);\n if ($copied) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "function clone_record($db_table) {\n $db_obj = new db_class();\n $typeHash = $db_obj->columnTypeHash($this->table_title);\n \n $sql = 'INSERT INTO ' . $this->table_title ;\n $typeList = '';\n $columns = ' (' ;\n $values = '(' ;\n $paramList = array();\n $count = 0;\n \n foreach($db_table as $key => $value) {\n if($count > 0){ \n $columns .= ',' ; \n $values .= ',';\n }\n $columns .= $key;\n $values .= '?';\n $paramList[] = $value;\n $typeList .= $typeHash[$key];\n \n $count++;\n }\n \n $columns .= ')';\n $values .= ')';\n $sql .= $columns . ' VALUES ' . $values;\n \n showArray(array($sql, $typeList, $paramList));\n \n $db_obj->closeDB();\n \n }", "public function clone() {\n\t\t\t$class = get_called_class();\n\t\t\t$obj = new $class($this->_db);\n\t\t\t$obj->setFromArray($this->toArray());\n\t\t\t$obj->setChanged($this->hasChanged());\n\t\t\treturn $obj;\n\t\t}", "function db_select_into_array( $statement ) {\n\n $this->db_run_query( $statement );\n\n if( ! is_object( $this->dataset_obj )) return NULL;\n\n while( $this->db_fetch_next_row() ) {\n $this->dataset_array[] = $this->curr_row_array;\n }\n\n $this->dataset_obj->free(); # We don't need this any more as we have all the same data in an array\n\n return $this->dataset_array;\n }", "function db_copy_data($conn, $table, $where, $fields=\"ID\", $values=\"0\") {\n\t$sql = \"select * from $table where $where\";\n\t$result = db_exec($conn, $sql);\n\t$n = mysql_num_fields($result);\n\t$except_fields = explode(',', $fields);\n\t$set_values = explode(',', $values);\n\t$c = count($except_fields);\n\tfor ($i=0; $i<$n; $i++) {\n\t\t$f = mysql_field_name($result, $i);\n\t\t$except = false;\n\t\tfor ($j=0; $j<$c; $j++) {\n\t\t\tif ($f==trim($except_fields[$j])) {\n\t\t\t\t$except = true;\n\t\t\t\t$field_array[] = $set_values[$j].\" as `\".$f.\"`\";\n\t\t\t}\n\t\t}\n\t\tif (!$except) $field_array[] = \"`\".$f.\"`\";\n\t}\n\tdb_free($result);\n\t$field_list = implode(\",\", $field_array);\n\t$sql = \"insert into $table select $field_list from $table where $where\";\n\tdb_exec($conn, $sql);\n\treturn mysql_insert_id();\n}", "protected function hydrateAllData()\n {\n return $this->_stmt->fetchAll(PDO::FETCH_KEY_PAIR);\n }", "protected final function fetchRecords()\n {\n $this->query->setLimit(\n (($this->parameters->getCurrentPage() - 1) * $this->parameters->getResultsPerPage()),\n $this->parameters->getResultsPerPage()\n );\n\n $this->data = $this->query->execute()->getAssociative();\n }", "public function populate()\n\t{\n\t\tif (!$this->index)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$records = $this->model->find(array_keys($this->index));\n\n\t\tforeach ($records as $nid => $record)\n\t\t{\n\t\t\t$this->index[$nid]->record = $record;\n\t\t}\n\n\t\treturn $records;\n\t}", "function pg_copy_from($connection, string $table_name, array $rows, string $delimiter = null, string $null_as = null): void\n{\n error_clear_last();\n if ($null_as !== null) {\n $result = \\pg_copy_from($connection, $table_name, $rows, $delimiter, $null_as);\n } elseif ($delimiter !== null) {\n $result = \\pg_copy_from($connection, $table_name, $rows, $delimiter);\n } else {\n $result = \\pg_copy_from($connection, $table_name, $rows);\n }\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n}", "function copy_article($newlyPlanId,$plan_id){\n \n {//Plan_Article Block\n \n $queryPlanArticle = \"SELECT * FROM plan_article WHERE status = 1 AND plan_id = '{$plan_id}' \" ;\n $resultPlanArticle = $this->execute_query($queryPlanArticle);\n \n if($this->num_rows($resultPlanArticle)!= 0)\n {\n while($row = $this->fetch_array($resultPlanArticle))\n { \n \n $insertArr = array(\n 'plan_id'=> $newlyPlanId,\n 'article_id' => $row['article_id'], \n 'creation_date' => date('Y-m-d H:i:s',time()), \n 'status'=> $row['status'] \n );\n \n $result = $this->insert('plan_article',$insertArr);\n \n }\n }\n }\n }", "function &copy () {\n \t\t$newObject =& $this->shallowCopy();\n \t\treturn $newObject->postCopy();\n \t}", "protected function get_results_from_query() \n\t\t{\n \t\t\t$this->open_connection();\n \t\t\t$result = $this->conn->query($this->query);\n \t\t\twhile ($this->rows[] = $result->fetch_assoc());\n \t\t\t$result->close();\n \t\t\t$this->close_connection();\n \t\t\tarray_pop($this->rows);\n\t\t}", "function copy ()\n {\n return clone $this;\n }", "function copy() {\n\t\tdefined('_JEXEC') or die('Invalid Token');\n\t\t$option = clm_core::$load->request_string('option', '');\n\t\t$section = clm_core::$load->request_string('section', '');\n\t\t$this->setRedirect('index.php?option=' . $option . '&section=' . $section);\n\t\t$cid = clm_core::$load->request_array_int('cid');\n\t\t$db = JFactory::getDBO();\n\t\t$table = JTable::getInstance('saisons', 'TableCLM');\n\t\t$user = JFactory::getUser();\n\t\t$n = count($cid);\n\t\tif ($n > 0) {\n\t\t\tforeach ($cid as $id) {\n\t\t\t\tif ($table->load((int)$id)) {\n\t\t\t\t\t$table->id = 0;\n\t\t\t\t\t$table->name = 'Kopie von ' . $table->name;\n\t\t\t\t\t$table->published = 0;\n\t\t\t\t\tif (!$table->store()) {\n\t\t\t\t\t\t$this->setMessage($table->getError(), 'warning');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->setMessage($table->getError(), 'warning');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->setMessage(JText::_('SAISON_NO_SELECT'), 'warning');\n\t\t\treturn;\n\t\t}\n\t\tif ($n > 1) {\n\t\t\t$msg = JText::_('SAISON_MSG_ENTRYS_COPY');\n\t\t} else {\n\t\t\t$msg = JText::_('SAISON_MSG_ENTRY_COPY');\n\t\t}\n\t\t// Log schreiben\n\t\t$clmLog = new CLMLog();\n\t\t$clmLog->aktion = JText::_('SAISON_AKTION_SEASON_COPY');\n\t\t$clmLog->params = array('sid' => $cid[0], 'cids' => implode(',', $cid));\n\t\t$clmLog->write();\n\t\t$this->setMessage(JText::_($n . $msg));\n\t}", "public function __clone();", "public function __clone();", "public function fetchAllToArray()\n {\n $resultSet = $this->getDbTable()->fetchAll()->toArray();\n return $resultSet;\n }", "public function copy()\n {\n return new static($this->items, $this->params, $this->pages);\n }", "protected function adodb_recordset_to_array($rs) {\n /// this can not be removed even if we chane db defaults :-(\n if ($result = parent::adodb_recordset_to_array($rs)) {\n foreach ($result as $key=>$row) {\n $row = (array)$row;\n array_walk($row, 'onespace2empty');\n $result[$key] = (object)$row;\n }\n }\n\n return $result;\n }", "public abstract function copy(EntityManager $em);", "public function __clone() {\n\t\t$this->document = clone $this->document;\n\t}", "function flush(){\n\t\t$this->last_result = array();\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "function prepareForCopy() {\n\t\t$this->id = null;\n\t}", "public function copy(): Collection\n {\n return clone $this;\n }", "public function copy(): self\n {\n return $this->immute(true); // force immute\n }", "public function __clone()\n {\n $this->data = clone $this->data;\n }", "public function __clone()\n {\n $array = array();\n\n foreach ($this->data as $key => $value) {\n if ($value instanceof self) {\n $array[$key] = clone $value;\n } else {\n $array[$key] = $value;\n }\n }\n\n $this->data = $array;\n }", "public static function cloneResultMap($base, array $data, $columnMap, int $dirtyState = 0, bool $keepSnapshots = false): ModelInterface;", "public function __clone() {\n $this->items = Arrays::copy($this->items);\n }", "public function getEmptyClone()\n {\n $clone = new Piwik_DataTable;\n $clone->queuedFilters = $this->queuedFilters;\n $clone->metadata = $this->metadata;\n return $clone;\n }", "public function getArrayCopy()\n {\n return $this->toArray();\n }", "private function _loadFromShadowCopy()\n {\n $sql = Doctrine_Query::create();\n $sql->select('c.id_produs, c.cantitate, p.denumire, p.cod_produs, p.stoc_disponibil, g.foto as foto');\n $sql->addSelect('cc.denumire AS categorie, IF(pm.pret_oferta, pm.pret_oferta, p.pret) AS price');\n $sql->from('CartTrack c');\n $sql->innerJoin('c.Produse p');\n $sql->leftJoin('p.Categorii cc');\n $sql->leftJoin('p.MainPhoto g WITH g.main = 1');\n $sql->leftJoin('p.Promotii pm WITH (pm.data_inceput <= DATE(NOW()) AND pm.data_sfarsit >= DATE(NOW()))');\n if(empty($this->_userId)) {\n $sql->where('session_id = ?', $this->_sessionId);\n }\n else {\n $sql->where('membru_id = ?', $this->_userId);\n }\n \n $shadowCopy = $sql->fetchArray();\n foreach($shadowCopy as &$product) {\n $data = $product['Produse'] + array(\n 'categorie' => $product['categorie'],\n 'foto' => $product['foto'],\n 'price' => $product['price']\n );\n $this->_addToBasket($data, $product['cantitate'], false);\n }\n }", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "protected function __clone(){}", "private function resetQuery()\n {\n $this->cols('*');\n }", "public function __clone()\n {\n foreach ($this->data as $key => $value) {\n if ($value instanceof self) {\n $this[$key] = clone $value;\n }\n }\n }", "public function __clone()\n {\n $this->reset(TRUE);\n }", "public function getAll()\n {\n $resultSet = $this->oMapper->getAll();\n\n $className = get_class($this);\n\n// $return = array();\n $dto = new EntityDTO($this->oDb, $this->oLogger);\n foreach ($resultSet as $key => $row) {\n $obj = new $className($dto);\n $obj->fillByObject($row);\n\n $this->aCollection[] = $obj;\n }\n unset($resultSet);\n\n return $this->aCollection;\n }", "public function copy()\n\t\t{\n\t\t\treturn unserialize(serialize($this)); \n\t\t}", "abstract public function get_local_copy();", "public function all()\n {\n return clone $this;\n }", "public function __clone()\n {\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n // do not change the _changed flag here\n }", "public function __clone()\n {\n foreach ($this->_associations as $i => $association) {\n $this->_associations[$i] = clone $association;\n }\n }", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}" ]
[ "0.65891796", "0.63145155", "0.61364263", "0.6000037", "0.5992834", "0.5855765", "0.5758124", "0.5758124", "0.55590206", "0.5558147", "0.5502021", "0.5497085", "0.54739934", "0.5463803", "0.5441597", "0.54370564", "0.5431227", "0.5420661", "0.5416691", "0.54152703", "0.53817034", "0.5361208", "0.53522223", "0.5352157", "0.53239864", "0.53125083", "0.5306375", "0.5290287", "0.5271239", "0.5266508", "0.5257051", "0.5248933", "0.5232854", "0.5221551", "0.5204936", "0.52031064", "0.5184386", "0.518136", "0.51552397", "0.5148993", "0.5148942", "0.51297885", "0.51258177", "0.5112979", "0.5098384", "0.50955546", "0.50901216", "0.50901216", "0.5087063", "0.50825125", "0.50679713", "0.5046184", "0.5044962", "0.5044269", "0.50394547", "0.5033142", "0.5029712", "0.50214773", "0.50209236", "0.50180066", "0.501611", "0.50138015", "0.50136554", "0.50074863", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.5004791", "0.49986035", "0.4996723", "0.49904388", "0.49902666", "0.49880743", "0.498088", "0.49656934", "0.49615407", "0.49563438", "0.49532014", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735", "0.49387735" ]
0.0
-1
Insert a new record into the database and return its id
public function insert_get_id(array $row) { if (is_multiple($row)) { throw new Exception("Inserting multiple records not accepted"); } $this->type = 'insert_get_id'; $this->rows = $row; $this->columns = array_keys($row); $this->set_binds(array_values($row)); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert_id();", "public function insert() {\n if($this->id != 0){\n return null;\n }\n // Connect to db\n $db = Db::instance();\n\n // Build query\n $q = sprintf(\"INSERT INTO `%s` (`user_id`, `story_id`, `comment`) VALUES (%d, %d, %s);\", self::DB_TABLE, $db->escape($this->user_id), $db->escape($this->story_id), $db->escape($this->comment));\n\n // Execute query\n $db->query($q);\n\n // Set the ID for the new object\n $this->id = $db->getInsertID();\n return $this->id;\n }", "public function insert() {\n\t\t$insert_array = $this->toDbArray(true, true);\n\t\tif (array_key_exists('_id', $insert_array)) { unset($insert_array['_id']); }\n\t\t$ret_val = $this->getCollection()->save($insert_array);\n\t\tif (isset($insert_array['_id'])) {\n\t\t\t$this->setId($insert_array['_id']);\n\t\t}\n\t\treturn $this->getId();\n\t}", "abstract public function insert_id();", "function insertId();", "public function insert()\n {\n $this->id = insert($this);\n }", "abstract public function insertId();", "abstract public function insertId();", "abstract public function insertId();", "abstract public function insertID();", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "abstract public function InsertId();", "public static function insertId() {\n\treturn self::$instance->insertId();\n }", "function Insert_ID()\n\t{\n\t\treturn $this->GetOne($this->identitySQL);\n\t}", "public function getInsertId();", "public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function insert($data){\r\n $id = null;\r\n if($d = $this->parseData($data)){\r\n if(db::insert($this->tableName,$d)){\r\n $stmt = db::getPDO();\r\n $id = $stmt->lastInsertId($this->idField);\r\n }\r\n }\r\n return $id;\r\n }", "public function insert()\n {\n $db = $this->getDatabase();\n $sql = \"INSERT INTO \" . $this->getTable() . \" (name) VALUES (:name)\";\n $stm = $db->prepare($sql);\n $stm->bindValue(':name', $this->getName());\n $stm->execute();\n $stm->fetch(\\PDO::FETCH_ASSOC);\n\n return $db->lastInsertId();\n }", "function insert_id();", "abstract protected function _getInsertId();", "public function insertAndGetId($sql, $params = array());", "public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function insertid()\n\t{\n\t\treturn 0;\n\t}", "public function sql_insert_id() {}", "public function sql_insert_id() {}", "function InsertRecord($post) {\n $this->db->insert('purchase',$post);\n $last_id = $this->db->insert_id();\n return $last_id;\n }", "private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }", "public function insert($data = array())\n {\n \n\n $id = parent::insert($data);\n return $id;\n }", "public function new($params)\r\n {\r\n $insert_id = $this->insert($params);\r\n return $insert_id;\r\n }", "function insert($data) {\r\n if( !$data ):\r\n log_message('error', 'data not supplied');\r\n return FALSE;\r\n endif;\r\n\r\n if ( $this->db->field_exists('created', $this->_table) ) $data->created = date('Y-m-d H:i:s');\r\n $this->db->insert($this->_table, $data);\r\n $id = $this->db->insert_id();\r\n unset($data);\r\n\r\n return $id;\r\n }", "public function getInsertId(){\n return $this->sqli->insert_id;\n }", "function insert_id() {\n\t\treturn $this->mysql_client->insert_id;\n\t}", "public function Insert_Id()\n {\n $this->init();\n return $this->db->Insert_Id();\n }", "public function getInsertId()\n {\n\n if ($this->isNew)\n return $this->id;\n else\n return null;\n\n }", "public function insertData()\n {\n try {\n// print_r($this->insertUpdateArray);exit;\n $id = DB::table($this->dbTable)->insertGetId($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n return $id;\n }", "function insert($data) {\n $this->db->insert($this->table, $data);\n $idOfInsertedData = $this->db->insert_id();\n return $idOfInsertedData;\n }", "function insert($data) {\n $this->db->insert($this->table, $data);\n $idOfInsertedData = $this->db->insert_id();\n return $idOfInsertedData;\n }", "public function insert_id(){\n\t\treturn $this->insert_id;\n\t}", "public function insertId() {\n\t\treturn $this->_dbh->lastInsertId();\n\t}", "public function insert()\n {\n\n $query = 'insert into manager (userid, projectid)\n values (:userid, :projectid)';\n\n $result = $this->conn->prepare($query);\n\n $result->bindValue(':userid', $this->value['userid'],PDO::PARAM_INT);\n $result->bindValue(':projectid', $this->value['projectid'], PDO::PARAM_INT);\n\n $result->execute();\n\n $this->projectid = $this->conn->lastInsertId();\n\n return ;\n }", "public static function insert_id(){\n return self::$connection->insert_id;\n }", "public function insert_id(){\n\t\t\treturn mysqli_insert_id($this->connection);\n\t\t}", "public function insert_id(){\n\t\t\treturn mysqli_insert_id($this->connection);\n\t\t}", "public function insertId()\r\n\t{\r\n\t\treturn (int) mysqli_insert_id($this->link);\r\n\t}", "function insert($taak) {\n $this->db->insert('taak', $taak);\n return $this->db->insert_id();\n }", "public function insertId() {\r\n\t\treturn mysql_insert_id ( $this->_conn );\r\n\t}", "function insert_id($table) {\r\n\t\treturn $this->dbh->insert_id($table);\r\n\t\t\r\n\t}", "public function insertId() {\n return mysqli_insert_id($this->link);\n }", "public function insertRecord($fields) {\r\n $this->db->insert(USERS, $fields);\r\n\r\n return $this->db->insert_id();\r\n }", "function identity()\n {\n return $this->db->insert_id();\n }", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function insert() {\n if($this->topic_id != 0)\n return null;\n\n $db = Db::instance(); // connect to db\n $q = sprintf(\"INSERT INTO profiles (`firstname`, `lastname`, `username`, `password`, `photo`, `number_posts`)\n VALUES (%s, %s, %s, %s, %s, %d);\",\n $db->escape($this->firstname),\n $db->escape($this->lastname),\n $db->escape($this->username),\n $db->escape($this->password),\n $db->escape($this->photo),\n $db->escape($this->number_posts)\n );\n\n $db->query($q); // execute query\n return $db->getInsertID();\n }", "function InsertRecord($tabel_name='',$param)\n {\n $this->db->insert($tabel_name, $param);\n $last_id = $this->db->insert_id();\n\n return $last_id;\n }", "public function insertId() {\n return $this->insertId;\n }", "public function insertId()\r\n\t{\r\n\t\t//orcal_last_inserted_id($this->link)\r\n\t}", "public function insertId()\r\n\t{\r\n\t\t//mysql_insert_id($this->link)\r\n\t}", "public function getInsertId(){\n\t\treturn $this->con->insert_id;\n\t}", "function insert( $sql ){\n\t\tif( $this->db == null ){\n\t\t\treturn false;\n\t\t}\n\t\t$insert_id = $this->db->query( $sql );\n\n\t\treturn $insert_id;\n\t}", "public function insert_id() {\n return mysql_insert_id($this->connection);\n }", "public function insert_id() {\r\n return mysql_insert_id($this->connection);\r\n }", "public function insert_id(){\n return mysql_insert_id($this->connection);\n }", "public function insertId()\n\t{\n\t\treturn mysqli_insert_id($this->conn);\n\t}", "function insert($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\treturn $this->pdo->lastInsertId();\n\t}", "function insert_id() {\r\n\t\treturn mysql_insert_id($this->link);\r\n\t}", "function insert_id()\r\n {\r\n return mysql_insert_id($this->link);\r\n }", "public function insert_id(){\n return mysqli_insert_id($this->connection);\n }", "public function insert_id() {\n\t\treturn $this->db->lastInsertId();\n\t}", "function getInsertId(){\r\n\t\treturn $this->m_insertId;\r\n\t}", "public function insert_id(){\n \treturn $this->_insert_id;\n }", "function db_insert_id() {\n return mysql_insert_id();\n }", "public function insertId(){\n return (int) mysql_insert_id($this->connection);\n }", "public function add() {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"\n INSERT INTO lessons (title, subject, description, resources, persons_ID, \n date_created, search_field)\n VALUES (?,?,?,?,?,?,?)\");\n \n $stmt->bind_param('ssssiss', $this->title, $this->subject, $this->description, \n $this->resources, $this->personsID, $this->dateCreated, $this->searchField);\n \n $stmt->execute();\n $stmt->close();\n $insertID = $mysqli->insert_id;\n $mysqli->close();\n \n // Return ID of inserted record.\n return $insertID;\n }", "function insertId()\n\t{\n\t\treturn mysql_insert_id($this->conn);\n\t}", "public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }", "private function _insert($data){\n \t\n \tif(isset($data['date_established'] )){\n \t\t$data['date_established'] = Application_Core_Utilities::ukDateToMysql($data['date_established']);\n \t}\n \t\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }", "public function insert_id()\n {\n return mysqli_insert_id($this->connection);\n }", "function create($data)\r\n\t{\t\t\r\n\t\t$this->db->insert($this->table, $data); \r\n\t\t\r\n\t\tif ($this->db->affected_rows() === 1)\r\n\t\t{\r\n\t\t\treturn $this->db->insert_id();\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "public function insertId() {\n return mysqli_insert_id($this->connection);\n }", "public function insert()\n { if (!is_null($this->id))\n trigger_error(\"User::insert(): Attempt to insert a User object that already has its ID property set (to $this->id).\", E_USER_ERROR); \n // Insert the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"INSERT INTO users ( user_name, user_password_hash, user_email, orcid, orcid_code, orcid_access_token ) VALUES ( :user_name , :user_password_hash , :user_email, :orcid, :orcid_code, :orcid_access_token)\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n\t$st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR); \n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR); \n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR); \n $st->execute();\n $this->id = $conn->lastInsertId();\n $conn = null;\n return $this->id;\n }", "function add() {\r\n $sql = \"INSERT into student_researchers VALUES();\";\r\n global $db;\r\n if($db->Execute($sql) === false) {\r\n throw new Exception('SQL error. Unable to add a new researcher.');\r\n }\r\n $_REQUEST['id']=mysql_insert_id();\r\n\r\n edit();\r\n}", "public function insertAndReturnID($sql){\n\t\t$this->query($sql);\n\t\treturn $this->insert_id();\n\t}", "public function insert_id(){\n\t\treturn @mysql_insert_id($this->conn);\n\t}", "public function insert() {\r\n\r\n\t\t// Does the Genre object already have an ID?\r\n\t\tif ( !is_null( $this->id ) ) trigger_error ( \"Genre::insert(): Attempt to insert an Genre object that already has its ID property set (to $this->id).\", E_USER_ERROR );\r\n\r\n\t\t// Insert the Genre\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$sql = \"INSERT INTO :table ( id, name ) VALUES ( :id, :name )\";\r\n\t\t$st = $conn->prepare ( $sql );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->bindValue( \":name\", $this->name, PDO::PARAM_STR );\r\n\t\t$st->execute();\r\n\t\t$this->id = $conn->lastInsertId();\r\n\t\t$conn = null;\r\n\t}", "public static function sql_insertid() {\n return 0;\n\t\t}", "public function insert_id() {\n return mysqli_insert_id($this->connection);\n }", "public function getInsertId()\n {\n return $this->insertId;\n }", "public function insert( )\n {\n $sql_insert_string = $this->formatInsertCommand( );\n if ( $sql_insert_string == false )\n return false;\n\n $l_result = $this->query( $sql_insert_string );\n $this->clearDataBuffer( );\n if($l_result)\n return @mysql_insert_id(underQL::$db_handle);\n\n return false;\n }", "function insert_id()\n\t{\n\t\treturn mysql_insert_id($this->link);\n\t}", "function get_created_id()\n {\n return mysql_insert_id();\n }", "public function insert( $data ) {\n if ( $this->db->insert( $this->table(), $data ) ) {\n return $this->db->insert_id();\n } else return false;\n }", "public function save(){\n if($this->id == 0) {\n // Object is new and needs to be created\n return $this->insert();\n }\n }", "public function insert($query) {\n $connection = $this -> connect();\n\n // Query the database\n $connection -> query($query);\n\t // Get inserted id\n\t $insertid = $connection -> insert_id;\n\n return $insertid;\n }", "function getInsertId() {\r\n return $this->m_insertId;\r\n }", "public function insertGetId()\n {\n return $this->lastId;\n }", "public function insertGetId()\n {\n return $this->lastId;\n }", "function insert($rit) {\n $this->db->insert('rit', $rit);\n return $this->db->insert_id();\n }", "public function insertId () {\n\n return $this->_lastInsertId;\n }", "public function create() {\n global $db;\n $this->_precreate();\n $sql_keys = ''; $sql_values = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_keys .= \"`\".addslashes($key).\"`,\";\n $sql_values .= \"?,\";\n $data[] = $value;\n }\n $sql_keys = substr($sql_keys, 0, -1);\n $sql_values = substr($sql_values, 0, -1);\n\n $query = \"INSERT INTO {$this->table} ($sql_keys) VALUES ($sql_values);\";\n $result = $db->query($query,$data);\n if (!isset($this->_magicProperties['id']) || !$this->_magicProperties['id']) {\n $id = $db->lastInsertId();\n $this->{'set'.$this->id_field}($id);\n }\n $this->loaded = true;\n $this->_postcreate($result);\n return $this->id;\n }", "public function insertid()\n {\n $this->connect();\n\n return $this->connection->lastInsertId();\n }", "public function save()\n {\n $this->data = $this->toArray();\n if (empty($this->id)) {\n unset($this->data[self::ID]);\n $this->insert();\n } else {\n $this->update();\n }\n try {\n $this->query->execute($this->data);\n\n if ($this->pdo->lastInsertId()) {\n $this->id = $this->pdo->lastInsertId();\n }\n\n return ($this->pdo->lastInsertId() != null) ? (int)$this->pdo->lastInsertId() : null;\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n }", "public function insert_id()\n\t{\n\t\tif ($this->db_type == 'pgsql')\n\t\t{\n\t\t\treturn $this->execute('SELECT lastval() as id')->current()->id;\n\t\t}\n\t\treturn $this->conn->lastInsertId();\n\t}" ]
[ "0.7902554", "0.7840919", "0.78008544", "0.7770098", "0.77244186", "0.7710721", "0.7682452", "0.7682452", "0.7682452", "0.75700593", "0.7554644", "0.7535006", "0.75112003", "0.7482985", "0.74556977", "0.7355622", "0.7353107", "0.7344674", "0.734322", "0.722999", "0.7228676", "0.7194896", "0.71744716", "0.71700215", "0.7169403", "0.716516", "0.7155247", "0.7133647", "0.7120452", "0.71018547", "0.7086186", "0.70554155", "0.70550424", "0.70274425", "0.70060974", "0.6964204", "0.6964204", "0.6958538", "0.6947022", "0.6942668", "0.69399977", "0.6922241", "0.6922241", "0.69109076", "0.6904975", "0.690284", "0.69026554", "0.6890168", "0.6882977", "0.688241", "0.6878643", "0.6871465", "0.68657166", "0.686443", "0.68634236", "0.6858883", "0.68493813", "0.68424064", "0.68399596", "0.68341374", "0.6828811", "0.68190235", "0.6818469", "0.68177336", "0.68148655", "0.6814282", "0.6812595", "0.68116814", "0.6810435", "0.68055713", "0.68037295", "0.68027663", "0.6802304", "0.68008584", "0.67988056", "0.67979324", "0.6797807", "0.67967963", "0.6792533", "0.67921996", "0.67887557", "0.67829907", "0.6782244", "0.6776278", "0.6769107", "0.6767155", "0.6763374", "0.67627", "0.6749218", "0.67437476", "0.674005", "0.67340785", "0.67325425", "0.67170584", "0.67170584", "0.6716598", "0.6715384", "0.67130864", "0.6706363", "0.6694971", "0.66895974" ]
0.0
-1
Update a record in the database.
public function update(array $values) { $this->type = 'update'; $this->rows = $values; $this->set_binds(array_values($values), 'update'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($record);", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function updateRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getEditRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// update\n\t\t\t\t$this->getHandler()->update($record);\n\n\n\t\t\t\t$msg = new Message('You have successful edit a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "function update($idMedicalRecord) // Implementation \r\n\t\t{\r\n\t\t\t$this->idMedicalRecord = $idMedicalRecord;\r\n\t\t\t$dbo = database::getInstance(); // pass back that database object already created perhaps\r\n\t\t\t$sql = $this->buildQuery('update'); // what we want to do (update records)\r\n\r\n\t\t\t$dbo->doQuery($sql); // execute query statement\r\n\t\t}", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function updateRecord(){\n\t\tglobal $db;\n $data = array('email'=>$this->email);\n\t\t\t\t$response = $db->update($this->table,$data,\"id = $this->id\");\n\t\treturn $response;\n\t}", "function update_record () {\n\t\t\n\t\t// validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // update data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"UPDATE customers SET name = ?, email = ?, mobile = ? WHERE id=\".$_GET['id'];\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->update();\n }\n\t\n\t}", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function db_update() {}", "public function update($entity){ \n //TODO: Implement update record.\n }", "public function update(){\r\n\t\tif (!$this->hasChanged) return self::RES_UNCHANGED;\r\n\t\t$table = $this->getTable();\r\n\t\tif ($this->new){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the record doesn't exist.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\tif (!$table->hasPrimaryKey()){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the table does not have a primary key.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$where = array();\r\n\t\t$changeCount = 0;\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\tif ($value->hasChanged()){\r\n\t\t\t\t$vals[] = \"`$name` = \".$value->getSQLValue();\r\n\t\t\t\t$changeCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\t$where[] = \"`$name` = \".$this->values[$name]->getSQLValue();\r\n\t\t}\r\n\t\t$sql = 'UPDATE '.$this->getFullTableName().' SET '.implode(', ',$vals).' WHERE '.implode(' AND ',$where).' LIMIT 1';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to update record in '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "private function update(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check permission to update.\n\t\t$result = $this->clsAccessPermission->toUpdate();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to update!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute Update.\n\t\tif (! $this->objAccessCrud->update ()) {\n\t\t\t$this->msg->setError (\"There were issues on update the record!\");\n\t\t\treturn;\n\t\t}\n\t\t$this->msg->setSuccess (\"Updated the record with success!\");\n\t\treturn;\n\t}", "function update($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\t\t// update the collection appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\tif (isset($this->_data[$key]))\n\t\t{\n\t\t\t$this->_data[$key] = $record;\n\t\t\t$this->store();\n\t\t}\n\t}", "public function update()\n\t{\n\t\t$this->user->db_update();\n\t}", "public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "public function update(Tinebase_Record_Interface $_record) {\n }", "public function update(Request $request, Record $record)\n {\n //\n }", "function updateRecord($id, $name, $position, $team, $age, $dateofarticle, $projdraftround, $injsus, $href, $newssrc, $notes, $status)\n\t {\n\t\t //open database connection\n\t\t $conn = $this->openDBConnection();\n\t\t\t\n\t\t\t//update record in database\n\t\t\t$query = \"UPDATE players SET\n \t\tname='$name', \n\t\t\t\t\tposition='$position',\n\t\t\t\t\tteam='$team',\n\t\t\t\t\tage='$age',\n\t\t\t\t\tdateofarticle='$dateofarticle',\n\t\t\t\t\tprojdraftround='$projdraftround',\n\t\t\t\t\tinjsus='$injsus',\n\t\t\t\t\thref='$href',\n\t\t\t\t\tnewssrc='$newssrc',\n\t\t\t\t\tnotes='$notes',\n\t\t\t\t\tstatus='$status'\n\t\t WHERE id = {$id}\";\n\t\t\n\t\t \n\t\t\tif(mysqli_query($conn, $query))\n\t\t\t{\n\t\t\t\t//echo '<script type=\"text/javascript\">eval(alert(\"Success, '.$name.'\\'s record has been updated. You will be notified on '.$this->createTargetDate($timespan).' to contact this person!\"));</script>';\n\t\t\t\t//header('Location: http://localhost/FantasyFootballDraft/');\n\t\t\t} else {\n\t\t\t echo 'Error: '. mysqli_error($conn);\t\n\t\t\t}\n\t\t\t\n\t\t\t//close connection\n\t\t mysqli_close($conn);\n\t\t \n\t }", "public function update($data) {}", "public function update($data) {}", "protected function update() {\n if ($this->_isLoaded()) {\n $this->db->where('id', $this->id);\n $this->db->update($this->tableName, $this->mapToDatabase());\n } else {\n throw new Exception(\"Model is not loaded\");\n }\n }", "protected function update()\n\t{\n\t\t//append ID to fields\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tupdate Booth\n\t\t\tset BoothNum = ?\n\t\t\twhere BoothID = ?\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "public function update() {\n // Get the values that are currently in the database\n $curr_vals = $this->read_single();\n\n // Set the values that will be added to the table\n foreach ($curr_vals as $key => $value) {\n // Convert key from the Database's capitalization to\n // this model's attribute capitalization style (all lowercase)\n $local_key = strtolower($key);\n // If user didn't specify property\n if (($this->attr[$local_key] === \"\") || ($this->attr[$local_key] === null)){\n // Then use the value that's already in the database\n $this->attr[$local_key] = $curr_vals[$key];\n }\n }\n\n // Create query\n $query = \"UPDATE \" . $this->table .\n \" SET = \" .\n \" WHERE MID = :mid AND Spot = :spot \";\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the data (reduce malicious SQL injection, etc.)\n foreach ($this->attr as $key => $value) {\n $this->attr[$key] = htmlspecialchars(strip_tags($value));\n }\n \n // Bind the data to a variable for an SQL attribute\n foreach ($this->attr as $key => $value) {\n $stmt->bindValue((\":\" . $key), $value);\n }\n\n // Execute the prepared statement and check for errors in running it\n return $this->runPrepStmtChkErr($stmt);\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email1=\\\"$this->email1\\\",address1=\\\"$this->address1\\\",lastname=\\\"$this->lastname\\\",phone1=\\\"$this->phone1\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function updateRecord ($sqlString);", "public function update(Record $record)\n {\n request()->validate([\n 'title' => 'required',\n 'content' => 'required',\n ]);\n\n $success = $record->update([\n 'title' => request('title'),\n 'content' => request('content'),\n ]);\n\n return [\n 'success' => $success\n ];\n }", "public function updateRow($row);", "abstract public function updateRecord($tableName, $record, $where = '');", "public function update() {\n\t\tTournamentDBClient::update($this);\n\t}", "function updateRecord()\n\t{\n\t\t$data['roleName'] = $this->roleName;\n\t\t$data['roleDesc'] = $this->roleDesc;\n\t\t\n\t $this->db->where('roleID', $this->roleID);\n\t\t$this->db->update('roles', $data); \n\t\t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function update(UpdatePatientRecordRequest $request, PatientRecord $patientRecord)\n {\n //\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "function update(){\n\t\t$this->model->update();\n\t}", "public function testUpdate()\n {\n $id = $this->tester->grabRecord('common\\models\\Comentario', ['id_receita' => 2]);\n $receita = Comentario::findOne($id);\n $receita->descricao = 'novo Comentario';\n $receita->update();\n $this->tester->seeRecord('common\\models\\Comentario', ['descricao' => 'novo Comentario']);\n }", "public function update($id);", "public function update($id);", "private function crud_put($record = null)\n {\n $key = $record['id'];\n // Make sure the new record has an ID\n if (!isset($key))\n {\n $this->response(array('error' => 'Update: No item specified'), 406);\n return;\n }\n // make sure the item is real\n if (!$this->supplies->exists($key))\n {\n $this->response(array('error' => 'Update: Item ' . $key . ' not found'), 406);\n return;\n }\n // proceed with update\n $this->supplies->update($record);\n // check for DB errors\n $oops = $this->db->error();\n if (empty($oops['code']))\n $this->response(array('ok'), 200);\n else\n $this->response($oops, 400);\n }", "public function update() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE $this->sqlTable SET \";\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$sql .= \"lp_userid = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$sql .= \"lp_random = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$sql .= \"lp_deadline = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = preg_replace ( '/, $/', '', $sql);\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\t\t\t$arrBindings[] = $this->id;\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "public function update()\n\t{\n\t\t$crud = $this->crud->find($_POST['id']);\n\t\t$curd->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->update();\n\t\t$this->redirect('crud');\n\t}", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "protected function update()\n {\n $database = cbSQLConnect::connect('object');\n if (isset($database))\n {\n $fields = self::$db_fields;\n foreach($fields as $key)\n {\n $flag = $database->SQLUpdate(\"place\", $key, $this->{$key}, \"id\", $this->id);\n if ($flag == \"fail\")\n {\n break;\n }\n }\n if ($flag == \"fail\")\n {\n return false;\n }\n else\n return $this->id;\n }\n }", "public function update($entity);", "public function update($entity);", "public function update() {\n\n // Does the course object have an ID?\n if ( is_null( $this->courseId ) ) trigger_error ( \"Course::update(): Attempt to update Course object that does not have its ID property set.\", E_USER_ERROR );\n\n // Update the course\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE course SET courseCode=:courseCode, courseName=:courseName, description=:description, headTeacher=:headTeacher WHERE courseId = :courseId\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":courseCode\", $this->courseCode, PDO::PARAM_INT );\n $st->bindValue( \":courseName\", $this->courseName, PDO::PARAM_INT );\n $st->bindValue( \":description\", $this->description, PDO::PARAM_STR );\n $st->bindValue( \":headTeacher\", $this->headTeacher, PDO::PARAM_STR );\n\n//\n $st->bindValue( \":courseId\", $this->courseId, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update()\n {\n $userId = Helper::getIdFromUrl('user');\n\n // Save post data in $user\n $user = $_POST;\n \n // Save record to database\n UserModel::load()->update($user, $userId);\n\n View::redirect('user/' . $userId);\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function testUpdateSingleRecord() {\r\n // Create record\r\n $po = new test_persistence_AbstractPersistenceAdapterTestPersistentObject();\r\n $po->booleanValue = true;\r\n $po->intValue = 2147483647;\r\n $po->stringValue = 'Hallo Welt!';\r\n // Store new record\r\n $this->getPersistenceAdapter()->save($po);\r\n // Remember UUID\r\n $uuid = $po->uuid;\r\n // Update values;\r\n $po->booleanValue = false;\r\n $po->intValue = -2147483646;\r\n $po->stringValue = 'Guten Morgen!';\r\n // Update record\r\n $this->getPersistenceAdapter()->save($po);\r\n // Get record back from database\r\n $result = $this->executeQuery('select * from POTEST where UUID=\\''.$uuid.'\\'');\r\n // Records must be unique\r\n $this->assertEquals($po->booleanValue, (bool)$result[0]['BOOLEAN_VALUE'], 'Boolean value from database differs from the boolean value of the persistent object.');\r\n $this->assertEquals($po->intValue, intval($result[0]['INT_VALUE']), 'Integer value from database differs from the int value of the persistent object.');\r\n $this->assertEquals($po->stringValue, $result[0]['STRING_VALUE'], 'String value from database differs from the string value of the persistent object.');\r\n }", "public function update()\n {\n return $this->save();\n }", "public function update($database, CouchDBObject $object);", "public function Update()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$user = GetUser();\n\t\t$userid = $user->userid;\n\t\t$where = 'id = ' . $this->id;\n\n\t\t$surveys_data = $this->data;\n\n\t\tif (isset($surveys_data['_columns'])) {\n\t\t\tunset($surveys_data['_columns']);\n\t\t}\n\n\t\tif (isset($surveys_data['id'])) {\n\t\t\tunset($surveys_data['id']);\n\t\t}\n\n\t\t$surveys_data['updated'] = $this->GetServerTime();\n\n\t\t$this->Db->UpdateQuery('surveys', $surveys_data, $where);\n\t}", "function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function update()\n\t{\n\t\t$mytable = WikiRevision::$table;\n\t\t$buf = \"UPDATE $mytable SET \";\n\t\tfor ($i = 0; $i < count(WikiRevision::$fields); $i++) {\n\t\t\t$buf .= WikiRevision::$fields[$i] . \" = '\" . DBConnection::get()->handle()->real_escape_string($this->data[$fields[$i]]) . \"'\" . ($i == count(WikiRevision::$fields) - 1)?(', '):(' ');\n\t\t}\n\t\t$buf .= \"WHERE rev_id = \" . $data['rev_id'];\n\t\tDBConnection::get()->handle()->query($buf);\n\t}", "public function update(Entity $entity);", "public function DoUpdate()\n\t{\n\n\t\treturn db_update_records($this->fields, $this->tables, $this->values, $this->filters);\n\t}", "public function update($id, Model $model);", "public function update() {\n global $db;\n $this->_preupdate();\n $sql_set = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_set .= \"`\".addslashes($key).\"`=\";\n $sql_set .= \"?,\";\n $data[] = $value;\n }\n $sql_set = substr($sql_set, 0, -1);\n\n $query = \"UPDATE {$this->table} SET $sql_set WHERE \".$this->id_field.\"=?;\";\n $data[] = $this->{'get'.$this->id_field}();\n\n $result = $db->query($query,$data);\n $this->_postupdate($result);\n return $result;\n }", "function update($id, $data)\n {\n $this->db->where($this->id,$id);\n $this->db->update($this->table, $data);\n }", "function updateRecord()\n{\n\n // Connect to DB\n require('connect.php');\n\n //User inputs for id, idiom, occurence and translation \n // in the record they'd like to edit \n\n $id = $_POST['update-id'];\n $idiom = $_POST['update-idiom'];\n $occurence = $_POST['update-occurence'];\n $translation = $_POST['update-translation'];\n\n // Update query\n $sql = \"UPDATE `meno` \n SET\n `idiom` = '$idiom',\n `occurence` = '$occurence',\n `translation` = '$translation',\n `commentary` = '$commentary'\n WHERE `id` = '$id' \";\n\n $update_query = mysqli_query($connection, $sql);\n\n if (!$update_query) {\n echo \"Error: \" . $sql . mysqli_error($connection);\n }\n\n mysqli_close($connection);\n\n header('Location: index.php');\n\n // check if save button has been clicked \n}", "function update($id, $data)\n\t{\n\t\t$this->db->where($this->id, $id);\n\t\treturn $this->db->update($this->table, $data);\n\t}", "public function update_student($row)\n\t\t{\n\t\t\t$student = new Student();\n\t\t\t$student->setId($row['id']);\n\t\t\t$student->setFirstName($row['firstName']);\n\t\t\t$student->setLastName($row['lastName']);\n\t\t\t$student->setGender($row['gender']);\n\t\t\t$student->setAge($row['age']);\n\t\t\t$student->setGroup($row['sgroup']);\n\t\t\t$student->setFaculty($row['faculty']);\n\t\t\t$this->conn->update($student);\n\t\t}", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "public function SQL_UPDATE() {\r\n\t}", "public function testUpdate()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $newModel = $this->makeFactory();\n\n $this->json('PUT', static::ROUTE . '/' . $model->id, $newModel->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($newModel->toArray());\n }", "public function update_record($data, $id){\n\t\t$this->db->where('training_id', $id);\n\t\tif( $this->db->update('training',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function update() {\n\n //GETS TASK, DEPENDING ON TASK ID (ID)\n $data=Tasks::find(request('task_id'));\n\n //GETS REQUEST AND REPLACES TASK TITLE & DESCRIPTION\n $data->task=request('task');\n $data->description=request('description');\n\n //SAVES DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$data->NotepadID\");\n }", "public function update(UpdateRecordRequest $request, Record $record)\n {\n $input = $request->all();\n $record->update($input);\n return response()->json([\n 'res' => true,\n 'message' => 'Registro actualizado correctamente'\n ], 201);\n }", "public function update()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$sql = 'UPDATE class SET ';\n\n\t\t\tif(isset($this->_year))\n\t\t\t\t$sql.=' year = :year,';\n\n\t\t\tif(isset($this->_section))\n\t\t\t\t$sql.=' section = :section';\n\t\t\telse\n\t\t\t\t$sql = substr_replace($sql, '', -1);\n\t\t\t\n\t\t\t$sql.=' WHERE id = :id';\n\n \t\t$data = [\n\t\t\t 'id' => $this->_id,\n\t\t\t 'year' => $this->_year,\n\t\t\t 'section' => $this->_section,\n\t\t\t];\n\n\t \t$stmt = $this->db->prepare($sql);\n\t \t$stmt->execute($data);\n\t\t\t$status = $stmt->rowCount();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\theader(\"HTTP/1.0 400 Bad request\");\n\t\t\techo $e;\n\t\t}\n\t}", "function update(){\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t//Variables for holding entity data\n\t\t\t\t$i = $_POST['i'];\n\t\t\t\t$cr = $_POST['creator'];\n\t\t\t\t$ti = $_POST['title'];\n\t\t\t\t$ty = $_POST['type'];\n\t\t\t\t$id = $_POST['identifier'];\n\t\t\t\t$da = $_POST['date'];\n\t\t\t\t$la = $_POST['language'];\n\t\t\t\t$de = $_POST['description'];\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\t\tif($conn){\n\t\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE eBook_MetaData SET creator='$cr', title='$ti', type='$ty', identifier='$id', date='$da', language='$la', description='$de' WHERE id='$i'\";\n\t\t\t\t\t$data = mysqli_query($conn, $sql);\n\n\t\t\t\t\tif(!$data){\n\t\t\t\t\t\techo \"error\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"data updated\";\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$conn = null;\n\t\t\t\t}", "public function update($id) {\r\n //\r\n }", "public function update()\n {\n update($this->id, $article);\n }", "public function update() {\r\n\r\n // get database connection\r\n\r\n \r\n \r\n $sql_update = \"update employees SET fname = '$this->firstName', lname = '$this->lastName', email = '$this->email' where id = '$this->id'\";\r\n if ($this->dbc->query($sql_update)) {\r\n\r\n echo \"<p> User Successfully Updated </p>\";\r\n return true;\r\n } else {\r\n\r\n echo \"<p> Could not run query </p>\";\r\n return false;\r\n }\r\n }", "public function testUpdate(): void { }", "public function update($id) {\n \n }", "public function update($id) {\n \n }", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function update()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_POST['id']);\n $tacgia->anh = $_POST['anh'];\n $tacgia->ten = $_POST['ten'];\n $tacgia->thongtin = $_POST['thongtin'];\n $tacgia->update();\n\n go_back();\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",short_name=\\\"$this->short_name\\\",is_active=\\\"$this->is_active\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update($row)\n\t{\n\t\t$this->db->where('tournamentId', $row['tournamentId']);\n\t\treturn $this->db->update('tournaments', $row);\n\t}", "public function update_record($data, $id){\n\t\t$this->db->where('award_id', $id);\n\t\tif( $this->db->update('awards',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "function UpdateRecord($id,$param) {\n $this->db->where('id_form_bd',$id);\n $this->db->update('form_bd',$param);\n }", "public function update() {\n if (!$this->id) {\n //echo \"No se tiene referencia al ID del objeto a actulizar.\";\n throw new Exception(\"No se tiene referencia al ID del objeto a actulizar.\");\n }\n\n $sql = \"UPDATE contratos SET numero_contrato=:numero_contrato, objeto_contrato=:objeto_contrato, presupuesto=:presupuesto, fecha_estimada_finalizacion=:fecha_estimada_finalizacion WHERE id=:id\";\n $args = array(\n \":id\" => $this->id,\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n return !$stmt ? false : true;\n }", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(!in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function update($id)\n {\n /*\n |--------------------------------------------------------------------------\n |\n | This is an example which edits a particular row. \n | You can un-comment it to use this example\n |\n */\n // $row = Quizz::find($id);\n // $row->column = requestData(\"column\");\n // $row->save();\n }" ]
[ "0.8344116", "0.7514802", "0.72379154", "0.7236517", "0.72147876", "0.7133847", "0.7127252", "0.7116964", "0.7106278", "0.6977638", "0.6969579", "0.69513804", "0.6944324", "0.68623734", "0.68076575", "0.67951584", "0.6786218", "0.678067", "0.67802346", "0.6756669", "0.67317903", "0.67317903", "0.6727066", "0.66879207", "0.665282", "0.66456187", "0.66320664", "0.66267896", "0.66258276", "0.6614374", "0.6592811", "0.6587434", "0.6571952", "0.65607274", "0.6560425", "0.6560425", "0.6560425", "0.6560425", "0.6560425", "0.6547859", "0.65470034", "0.65437376", "0.65437376", "0.6540535", "0.6532744", "0.64806557", "0.6465005", "0.6459374", "0.6448045", "0.64415604", "0.64415604", "0.64321196", "0.643028", "0.6429938", "0.6397821", "0.63930225", "0.63886726", "0.63882786", "0.63871604", "0.6385011", "0.63640827", "0.63629115", "0.63616925", "0.6360334", "0.6355948", "0.6346056", "0.6339897", "0.63395077", "0.6328116", "0.632494", "0.63211614", "0.6318645", "0.6315756", "0.63117105", "0.63008964", "0.6293189", "0.62895304", "0.62777597", "0.62731993", "0.6259408", "0.6256197", "0.62519735", "0.62506884", "0.62501067", "0.62451136", "0.62391216", "0.62391216", "0.6227334", "0.62259537", "0.6225844", "0.6225844", "0.6225844", "0.6225844", "0.6218139", "0.62128735", "0.62111896", "0.6208228", "0.62069273", "0.6198561", "0.61932963", "0.6192251" ]
0.0
-1
Delete any record matching the conditions.
public function delete_where($query, $params = array()) { $this->type = 'delete'; return $this->where($query, $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deleteAll($condition = null){}", "function delete_by( $conds = array() )\n\t{\n\t\t// where clause\n\t\t$this->custom_conds( $conds );\n\t\t// delete the record\n\t return $this->db->delete( $this->table_name );\n\t //print_r($this->db->last_query());die;\n\t \n \t}", "public function delete(array $conditions = []): bool;", "public function delete($conditions=[])\n {\n $conditionsArray = isset($conditions)?$this->bindParamsConditionProcess($conditions):\"\"; \n $str_condition = isset($conditionsArray[0])?$conditionsArray[0]:\"\";\n $vals =isset($conditionsArray[1])?$conditionsArray[1]:\"\"; \n $vals['@collection'] = $this->_table;\n $q = 'FOR c IN @@collection '.$str_condition.' REMOVE c IN @@collection RETURN OLD'; \n //exit;\n $response = ['query'=> $q, 'bindVars'=> $vals];\n $result = $this->customQueryWithParams($response);\n return $result; \n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function deleteAll($conditions=''){\n\t\tCoreType::assertString($conditions);\n\t\t$this->_connect();\n\t\tif($this->_schema){\n\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$table = $this->_source;\n\t\t}\n\t\t$numberArguments = func_num_args();\n\t\t$params = Utils::getParams(func_get_args(), $numberArguments);\n\t\tif(isset($params['limit'])){\n\t\t\t$conditions = $this->_limit($params[0], $params['limit']);\n\t\t}\n\t\tif(isset($params[0])){\n\t\t\treturn $this->_db->delete($table, $params[0]);\n\t\t} else {\n\t\t\treturn $this->_db->delete($table);\n\t\t}\n\t}", "function delete($table, array $conditions);", "public function delete($table, $conditions, $bind = []);", "public function delete($records = '')/*# : DeleteStatementInterface */;", "public function deleteMatch(){\n\t\t$this->getDbTable()->delete(\"\");\n\t}", "public function delete($ids){\n \n $filter = $this->primaryFilter; \n $ids = ! is_array($ids) ? array($ids) : $ids;\n \n foreach ($ids as $id) {\n $id = $filter($id);\n if ($id) {\n $this->db->where($this->primary_key, $id)->limit(1)->delete($this->table_name);\n }\n }\n }", "public function deleteAll($conditions=[])\n { \n //Ref:- FOR u IN users FILTER u.active == false REMOVE { _key: u._key } IN backup\n //$data = json_encode($data); \n /*$str_condition = isset($conditions)?$this->conditionProcess($conditions):\"\"; \n $q = \"FOR c IN \".$this->_table.\" \".$str_condition.\" REMOVE { _key: c._key } IN \".$this->_table.\"\"; \n $result = $this->customQuery($q);\n return $result; */ \n $conditionsArray = isset($conditions)?$this->bindParamsConditionProcess($conditions):\"\"; \n $str_condition = isset($conditionsArray[0])?$conditionsArray[0]:\"\";\n $vals =isset($conditionsArray[1])?$conditionsArray[1]:\"\"; \n $vals['@collection'] = $this->_table;\n $q = 'FOR c IN @@collection '.$str_condition.' REMOVE c IN @@collection RETURN OLD'; \n //exit;\n $response = ['query'=> $q, 'bindVars'=> $vals];\n $result = $this->customQueryWithParams($response);\n return $result;\n\n }", "public function deleteSelected()\n {\n PatientRecord::whereIn('id', $this->selectedKeys())->delete();\n }", "public function delete(string $table, array $conditions): bool;", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public static function delete_where($model, $conditions){\t\t\n $table = self::table_for($model);\n $condition_string = self::make_conditions($conditions);\n return self::do_query(\"DELETE FROM \" . $table . \" WHERE \" . $condition_string);\t\n\t}", "public static function deleteAll($condition = NULL, $params = []) {\n return parent::updateAll([\n 'isdeleted' => 1,\n 'deletedtime' => date(\"Y-m-d H:i:s\"),\n 'deleteduser' => \\Yii::$app->user->getId()\n ], $condition, $params);\n }", "public function delteRecords(){\n // Get the sql statement\n $sql = $this->deleteSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n \n $stmt->execute();\n \n return true;\n \n }", "public function delete(array $where);", "private function deleteRecords(){\r\n\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t// remove imagerecords which are not used anymore\r\n\t\tforeach($this->images as $filename => $image){\r\n\t\t\tif(array_search($filename, $fileNames) === false){\r\n\t\t\r\n\t\t\t\t$this->db->exec_DELETEquery('tx_gorillary_images', \"image='$filename' AND collection='\".$this->collection['uid'].\"'\");\r\n\t\t\t\t//unset ($this->images[$filename]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function delete(){\n // Delete subclauses\n foreach($this->subClause as $clause){\n $clause->delete();\n }\n \n mysql_query(\"DELETE FROM resolution WHERE id='$this->clauseId'\") or die(mysql_error());\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function deleteWhere(array $data)\n {\n return $this->model->where($data)->delete();\n }", "public function delete() {\n $where = func_get_args();\n $this->_set_where($where);\n\n $this->_callbacks('before_delete', array($where));\n\n $result = $this->db->delete($this->_table());\n\n $this->_callbacks('after_delete', array($where, $result));\n\n return $this->db->affected_rows();\n }", "abstract public function deleteAll();", "function deleteRecordByCondition($tablename, $condition) {\n $ci = & get_instance();\n $ci->load->database();\n $ci->db->delete($tablename, $condition);\n}", "private function Delete()\n {\n $return = false;\n $action = $this->Action();\n $table = $this->Table();\n $where = $this->Where();\n if($action && $table && Checker::isArray($where, false) && isset($where[Where::VALUES]))\n {\n $return[Where::QUERY] = \"$action FROM $table\".$where[Where::QUERY];\n $return[Where::VALUES] = $where[Where::VALUES];\n }\n return $return;\n }", "public function deleteAllRaw($conditions = true) {\n\t\treturn $this->getDataSource()->delete($this, $conditions);\n\t}", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "public function delete($where);", "public function delete(array $conditions)\n\t{\n\t\t$sql = \"DELETE FROM \" . static::$_table;\n\n\t\tforeach ($conditions as $col => $val) {\n\t\t\t$where[] = $col . ' = :' . $col;\n\t\t}\n\n\t\t$sql .= (!empty($where) ? \" WHERE \" . implode(\" AND \", $where) : '');\n\n\t\t$stmt = $this->_execute($sql, $conditions)[0];\n\t\treturn $stmt->rowCount();\n\t}", "public function delete(array $conditions)\n\t{\n\t\t$sql = \"DELETE FROM \" . $this->table . \"\";\n\t\t$sql = $this->getSqlFromConditions($sql, $conditions);\n\t\t$result = $this->query($sql, $this->getBindsFromConditions($conditions));\n\t\treturn true;\n\t}", "public function deleteAll($conditions): int\n {\n return $this->query()->delete()->where($conditions)->execute();\n }", "abstract public function deleteRecord($tableName, $where);", "public function delete() \n {\n $this->_data['query'] = 'DELETE';\n $this->_data['from'] = ' FROM '.$this->_data['from'];\n $this->_data['query'] .= $this->_data['from'];\n if (func_num_args() > 0) {\n $this->where(func_get_args());\n }\n return $this;\n }", "public function deleteAll(Closure|array|string|null $conditions): int;", "public function deleteAll(array $condition)\n {\n Comment::updateAll(['deleted' => true], $condition);\n }", "public function delete()\n {\n return $this->query->batchDelete($this->filter);\n }", "public function cleanRecords(){\n\t\tOpendocs::model()->deleteAll(\" createTime<=(NOW()-1)\");//oracle\n\t}", "public function deleteRecords(IFilterable $filter) {\n return $this->_dataHandler->delete($this->_table, $filter->resultFilter());\n }", "public function delete() {\n $events = $this->getEventsCreatedHere(); # we will need to write this method\n foreach ($events as $record) {\n $record->delete();\n }\n\n # delete the calendar_has_event records\n $has_events = $this->getCalendarHasEvents();\n foreach ($has_events as $record) {\n $record->delete();\n }\n\n # delete the user_has_permission records\n $permissions = $this->getAllPermissions();\n foreach ($permissions as $record) {\n $record->delete();\n }\n\n # delete the subscriptions on the calendar\n $subscriptions = $this->getSubscriptions();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n # delete the subscription_has_calendar records (remove calendar from subscriptions that subscribe to it)\n $subscriptions = $this->getSubscriptionHasCalendarRecords();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n return parent::delete();\n }", "function deleteRecords($table, $where)\n\t{ \n\t\t$query = \"DELETE FROM $table WHERE $where\";\n\t\t$this->db->query($query);\n\t}", "public function delete_by()\n\t{\n\t\t$where = func_get_args();\n\t\t$this->_set_where($where);\n\n\t\t$where = $this->trigger('before_delete', $where);\n\n\t\tif($this->soft_delete)\n\t\t{\n\t\t\t$result = $this->db->update($this->_table, array($this->soft_delete_key => TRUE));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->delete($this->_table);\n\t\t}\n\n\t\t$this->trigger('after_delete', $result);\n\n\t\treturn $result;\n\t}", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function deleteBy(array $params)\n {\n return $this ->model ->where($params) ->delete();\n }", "function deleteRecord($table,$where) \t{\n\t\t$query = \"DELETE FROM \".$this->tablePrefix .$table.' WHERE '.$where ;\n $res = $this->execute($query);\n\n\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function eraseAll() {\n $where = '1';\n return $this->delete($where);\n }", "public function delete() {\n if ($this->_is_new) return false;\n\n if (isset($this->_data[$this->_key_field])) {\n $where = array($this->_key_field=>$this->_data[$this->_key_field]); \n } elseif ($this->_load_criteria) {\n $where = $this->_load_criteria;\n } else {\n return false;\n }\n\n Q::create($this->_structure['table'])->delete($where)->exec();\n if (isset($this->_structure['relations'])) {\n foreach($this->_structure['relations'] as $relation_name=>$info) {\n $this->detach(null, $relation_name);\n }\n }\n if (isset($this->_structure['abilities'])) {\n foreach($this->_structure['abilities'] as $ability_name=>$info) {\n $ability_name = ucfirst($ability_name);\n if (!is_object($this->_loaded_abilities[$ability_name])) continue;\n $objects = array(&$this);\n $this->_loaded_abilities[$ability_name]->unlink($objects);\n }\n }\n return null;\n }", "public function deleteAll()\n {\n $this->record->entries()->delete();\n $this->record->status = 'pending';\n $this->record->is_opened = 'false';\n $this->is_finished = false;\n $this->is_current = false;\n\n return $this->buildResponse();\n }", "public function deleteall()\n\t{\n\t\t$ids = $this->input->post('records');\n\t\t$slider_cat = $this->SqlModel->getSingleField('slider_cat','slider',array('slider_id'=>$ids[0]));\n\t\tif(!empty($ids))\n\t\t{\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t$this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\t\n\t\t\t}\n\t\t}\n\t\tredirect(base_url().'manage/'.$this->controller.'/index/deletesuccess/'.$slider_cat,'location');\t\t\n\t\t\n\t}", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "public function delete($table,$conditions){\r\n $whereSql = '';\r\n if(!empty($conditions)&& is_array($conditions)){\r\n $whereSql .= ' WHERE ';\r\n $i = 0;\r\n foreach($conditions as $key => $value){\r\n $pre = ($i > 0)?' AND ':'';\r\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\r\n $i++;\r\n }\r\n }\r\n $sql = \"DELETE FROM \".$table.$whereSql;\r\n $delete = $this->db->exec($sql);\r\n return $delete?$delete:false;\r\n }", "public function delete($table,$conditions){\r\n $whereSql = '';\r\n if(!empty($conditions)&& is_array($conditions)){\r\n $whereSql .= ' WHERE ';\r\n $i = 0;\r\n foreach($conditions as $key => $value){\r\n $pre = ($i > 0)?' AND ':'';\r\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\r\n $i++;\r\n }\r\n }\r\n $sql = \"DELETE FROM \".$table.$whereSql;\r\n $delete = $this->db->exec($sql);\r\n return $delete?$delete:false;\r\n }", "public function delete_all($where)\n {\n if (!is_array($where) || !count($where))\n {\n $this->_set_error(\"Invalid Objects selection!\");\n return FALSE;\n }\n\n $this->obj->where($where)->get();\n\n foreach ($this->obj->all as $obj)\n {\n $obj->delete();\n }\n\n return TRUE;\n }", "public function clearRecordsData()\n {\n $defaultMaxAge = 60*60*24; // 24 hours\n $maxAge = craft()->config->get('registrationStorageDuration') ?? $defaultMaxAge; // in seconds\n\n $affectedRows = TobiasAx_RegistrationRecord::model()\n ->updateAll(['data' => null], '(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(dateCreated)) > :age', [':age' => $maxAge]);\n\n return $affectedRows;\n }", "public function delete() {\n\t\ttry {\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$sql = 'DELETE FROM ' . self::sanitize($this->_table->getProperty('name')) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t\t\\Bedrock\\Common\\Logger::info('Deleting record with query: ' . $sql); echo $sql;\n\t\t\t\t$this->_connection->exec($sql);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_CHANGED) {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Unsaved changes found, cannot delete record.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Record not found in database.');\n\t\t\t}\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('A database error was encountered, the record could not be deleted.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The record could not be deleted.');\n\t\t}\n\t}", "public function deletion($data, Model $model)\n { \n $this->table = $model->table;\n\n foreach($data as $record) {\n $this->unsetQuery();\n $this->delete('message_id = ?', [$record]);\n }\n }", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "function deleteRecords($table, $where)\n\t{ \n\t\t$this->db->delete($table, $where);\n\t\treturn $this->db->affected_rows();\n\t}", "public function deleteByCondition($table, $condition) \n\t{\n\t\tforeach($condition as $key=>$value)\n\t\t{\n\t\t\t$i++;\n\t\t\tif(count($condition)>$i)\n\t\t\t{\n\t\t\t\t$conditionSets[] = $key.'='.$value.' AND';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditionSets[] = $key.'='.$value;\n\t\t\t}\n\t\t}\n\t\t$conditionSets = implode(' ', $conditionSets);\n\t $sql = \"DELETE from $table WHERE $conditionSets\"; \n mysql_query($sql);\n }", "public function deleteByAttributes(array $conditions) {\n $query = $this->db->getQuery(true);\n\n $where = array();\n foreach ($conditions as $ckey => $cvalue) {\n $where[] = $this->quoteName($ckey) . ' = ' . (is_numeric($cvalue) ? intval($cvalue) : $this->quote($cvalue));\n }\n\n $query->delete($this->quoteName($this->tableName));\n $query->where($where);\n\n $this->db->setQuery($query);\n\n return $this->db->execute();\n }", "public function delete($arguments = []) {\n $this->dbh->query($this->query_array['delete'], $arguments);\n }", "public function deleteBy($criteria, $params = false)\n {\n $query = $this->model->query();\n\n /*== FILTER ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;\n\n if (isset($filter->field))//Where field\n $field = $filter->field;\n }\n\n /*== REQUEST ==*/\n $model = $query->where($field ?? 'id', $criteria)->first();\n $model ? $model->delete() : false;\n }", "function deleteItems($cond)\n {\n $this->db->where($cond);\n $this->db->delete(\"feedback\");\n return true;\n }", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "public function erase() {\n\t\tif ($this->empty) {\n\t\t\ttrigger_error(self::TEXT_AxonEmpty);\n\t\t\treturn;\n\t\t}\n\t\tif (method_exists($this,'beforeErase'))\n\t\t\t// Execute beforeErase event\n\t\t\t$this->beforeErase();\n\t\t$_cond=$this->criteria;\n\t\tF3::sql(\n\t\t\t'DELETE FROM '.$this->table.\n\t\t\t\t(is_null($_cond)?'':(' WHERE '.$_cond)).';',\n\t\t\t$this->db\n\t\t);\n\t\t$this->reset();\n\t\tif (method_exists($this,'afterErase'))\n\t\t\t// Execute afterErase event\n\t\t\t$this->afterErase();\n\t}", "function delete($tab, $cond)\n{\n\t$args = (func_num_args() > 2)? array_slice(func_get_args(),2) : null;\n\t$where = $this->getWhereSql($cond, $args);\n\n\t$sql = \"DELETE FROM $tab WHERE $where\";\n\t$res = $this->query($sql);\n\treturn $res;\n}", "public function deleteWhere($where, Database_Config $databaseConfig = NULL);", "public function forceDeleteWhere(array $data)\n {\n return $this->model->where($data)->forceDelete();\n }", "public function removeDeletedRecords() \n {\n // this algorythm should be a fair bit\n // faster than calling DataSet::removeRecord()\n $new_recs = array();\n foreach($this->records as $rec) {\n if (!$rec->isAZombie()) {\n $new_recs[] = $rec;\n }\n }\n $this->records = $new_recs;\n }", "public function delete(array $param = array('table'=>'','condition'=>[])) {\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n // (OPTIONAL) multi dimensional array e.g. [['key','operator','value'],['key','operator','value'],...]\n $arrCondition = isset($param['condition']) ? $param['condition'] : [];\n\n if( empty( $tableName ) ) {\n echo \"table name missing\";\n die;\n }\n\n $insert_values = [];\n $strWhere = \"\";\n\n if( count($arrCondition) > 0 ) {\n foreach( $arrCondition as $col ) {\n if( count( $col ) == 2 ) {\n array_push( $insert_values, $col[1] );\n $strWhere .= \"`\" . $col[0] . \"` = ?\";\n } else if( count( $col ) == 3 ) {\n array_push( $insert_values, $col[2] );\n $strWhere .= \"`\" . $col[0] . \"` \" . $col[1] . \" ?\";\n } else {\n // error\n }\n $strWhere .= \" AND \";\n }\n $strWhere = ' WHERE ' . substr($strWhere, 0, -5);\n }\n\n $strQry = \"DELETE FROM `\".$tableName.\"`\" . $strWhere . \";\";\n\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n $executed = $this->stmt->execute($insert_values);\n if( $executed ) {\n $count = $this->stmt->rowCount(); // effected rows if deleted records\n if( $count > 0 ) {\n echo $count . ' record(s) deleted successfully.';\n } else {\n echo 'fails to delete record(s)';\n }\n } else {\n echo 'fails to update record(s)';\n }\n $this->stmt = null;\n }", "public function delete($where = array()) {\n // if (!is_array()) {\n // $where = array(self::PRI_INDEX => $where);\n // }\n $this->db->delete(self::TABLE_NAME, $where);\n return $this->db->affected_rows();\n }", "public function deleteAll(): void;", "function DeleteRows() {\n\t\tglobal $conn, $Security, $patient_detail;\n\t\t$DeleteRows = TRUE;\n\t\t$sWrkFilter = $patient_detail->CurrentFilter;\n\n\t\t// Set up filter (Sql Where Clause) and get Return SQL\n\t\t// SQL constructor in patient_detail class, patient_detailinfo.php\n\n\t\t$patient_detail->CurrentFilter = $sWrkFilter;\n\t\t$sSql = $patient_detail->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setMessage(\"No records found\"); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\n\t\tif ($rs) $rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $patient_detail->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;\n\t\t\t\t$sThisKey .= $row['DetailNo'];\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\t$DeleteRows = $conn->Execute($patient_detail->DeleteSQL($row)); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($patient_detail->CancelMessage <> \"\") {\n\t\t\t\t$this->setMessage($patient_detail->CancelMessage);\n\t\t\t\t$patient_detail->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setMessage(\"Delete cancelled\");\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call recordset deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$patient_detail->Row_Deleted($row);\n\t\t\t}\t\n\t\t}\n\t\treturn $DeleteRows;\n\t}", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public function deleteTestEntities() {\n $statement = sprintf(\"DELETE FROM %s WHERE %s < 0 AND %s < 0\", static::TABLE, static::FIELDS[0], static::FIELDS[1]);\n\n $this->db->exec($statement);\n }", "public function delete($params=''){\n\t\t$this->_connect();\n\t\tif($this->_schema){\n\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$table = $this->_source;\n\t\t}\n\t\t$conditions = '';\n\t\tif(is_array($params)){\n\t\t\t$numberArguments = func_num_args();\n\t\t\t$params = Utils::getParams(func_get_args(), $numberArguments);\n\t\t\tif(isset($params['conditions'])){\n\t\t\t\t$conditions = $params['conditions'];\n\t\t\t}\n\t\t} else {\n\t\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t\tif(is_numeric($params)){\n\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t$conditions = $primaryKeys[0].\" = '\".$params.\"'\";\n\t\t\t\t} else {\n\t\t\t\t\tthrow new ActiveRecordException('Número de parámetros insuficientes para realizar el borrado');\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tif($params){\n\t\t\t\t\t$conditions = $params;\n\t\t\t\t} else {\n\t\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t\t$primaryKeyValue = $this->readAttribute($primaryKeys[0]);\n\t\t\t\t\t\t$conditions = $primaryKeys[0].\" = '\".$primaryKeyValue.\"'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$conditions = array();\n\t\t\t\t\t\tforeach($primaryKeys as $primaryKey){\n\t\t\t\t\t\t\t$primaryKeyValue = $this->readAttribute($primaryKey);\n\t\t\t\t\t\t\t$conditions[] = $primaryKey.\" = '\".$primaryKeyValue.\"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$conditions = join(' AND ', $conditions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->_callEvent('beforeDelete')===false){\n\t\t\treturn false;\n\t\t}\n\t\t$success = $this->_db->delete($table, $conditions);\n\t\t$this->_operationMade = self::OP_DELETE;\n\t\tif($success==true){\n\t\t\t$this->_callEvent('afterDelete');\n\t\t}\n\t\treturn $success;\n\t}", "public function delete($table, array $where);", "public function delete_all()\n {\n }", "public function delete($table,$conditions){\n $whereSql = '';\n if(!empty($conditions)&& is_array($conditions)){\n $whereSql .= ' WHERE ';\n $i = 0;\n foreach($conditions as $key => $value){\n $pre = ($i > 0)?' AND ':'';\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\n $i++;\n }\n }\n $query = \"DELETE FROM \".$table.$whereSql;\n $delete = $this->db->query($query);\n return $delete?true:false;\n }", "public function delete($table,$conditions){\n $whereSql = '';\n if(!empty($conditions)&& is_array($conditions)){\n $whereSql .= ' WHERE ';\n $i = 0;\n foreach($conditions as $key => $value){\n $pre = ($i > 0)?' AND ':'';\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\n $i++;\n }\n }\n $query = \"DELETE FROM \".$table.$whereSql;\n $delete = $this->db->query($query);\n return $delete?true:false;\n }", "public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }", "public function delete($where = null, array $markers = []);", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function deleteall()\r\n {\r\n $ids = $this->input->post('records');\r\n if(!empty($ids))\r\n {\r\n foreach($ids as $id)\r\n {\r\n $this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\r\n }\r\n }\r\n $this->session->set_flashdata('alert','deletesuccess');\r\n redirect(base_url('manage/'.$this->controller));\r\n\r\n }", "public function delete($where = array()) {\n\n $where = array(self::PRI_INDEX => $where);\n \n $this->db->delete(self::TABLE_NAME, $where);\n return $this->db->affected_rows();\n }", "function deleteAllData() {\n $successObservers = $this->databaseDeleteRecord($this->tableObservers, NULL);\n $successActions = $this->databaseDeleteRecord($this->tableActions, NULL);\n $successGroups = $this->databaseDeleteRecord($this->tableGroups, NULL);\n if ($successObservers !== FALSE && $successActions !== FALSE && $successGroups !== FALSE) {\n return TRUE;\n }\n return FALSE;\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function delete() {\n // Fail due to double delete\n assert(!$this->hasBeenDeleted);\n\n // Initialize delete record cache, if nonextant\n if (!isset(self::$deleteRecordPreparedStatementCache)) {\n self::$deleteRecordPreparedStatementCache = array();\n }\n \n // Initiate implicit tx, if nonextant explicit tx \n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail due to invalid database connection\n assert(isset(self::$databaseHandle));\n\n // Delete this record and all child records \n $table_name = static::getFullyQualifiedTableName();\n \n try {\n // Fetch prepared statement from cache, if present. Otherwise, create it.\n if (isset(self::$deleteRecordPreparedStatementCache[$table_name])) {\n // Fetch delete query from cache\n $delete_record_stmt = self::$deleteRecordPreparedStatementCache[$table_name];\n } else {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $delete_query = \"DELETE FROM {$fully_qualified_table_name} \"\n . $this->genPrimaryKeyWhereClause();\n\n $delete_record_stmt = self::$databaseHandle->prepare($delete_query);\n self::$deleteRecordPreparedStatementCache[$table_name] = $delete_record_stmt;\n }\n \n // Delete children, schedule assets for deletion\n $this->deleteChildren();\n self::$assetDeletors = array_merge(self::$assetDeletors, $this->getAssets());\n\n // Bind record's 'id' to delete-query\n $this->bindId($delete_record_stmt);\n\n // Remove record\n $delete_record_stmt->execute();\n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit transaction\n if ($is_implicit_tx) {\n self::endTx();\n }\n\n // Indicate object's deletion\n $this->hasBeenDeleted = true;\n }", "function delete(&$model, $conditions = null) {\n\t\tif (!$this->_useAlias) {\n\t\t\treturn parent::delete($model, $conditions);\n\t\t}\n\t\t$alias = $this->name($model->alias);\n\t\t$table = $this->fullTableName($model);\n\t\t$joins = implode(' ', $this->_getJoins($model));\n\n\t\tif (empty($conditions)) {\n\t\t\t$alias = $joins = false;\n\t\t}\n\t\t$complexConditions = false;\n\t\tforeach ((array)$conditions as $key => $value) {\n\t\t\tif (strpos($key, $model->alias) === false) {\n\t\t\t\t$complexConditions = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$complexConditions) {\n\t\t\t$joins = false;\n\t\t}\n\n\t\t$conditions = $this->conditions($this->defaultConditions($model, $conditions, $alias), true, true, $model);\n\t\tif ($conditions === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->execute($this->renderStatement('delete', compact('alias', 'table', 'joins', 'conditions'))) === false) {\n\t\t\t$model->onError();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function delete(array $where) {\r\n $this->checkGateway();\r\n\r\n // Query\r\n $sql = \"DELETE FROM {$this->name} WHERE \";\r\n foreach ($where as $column => $value) {\r\n\r\n // Parameter\r\n $sql .= $column . \" = :\" . $column . \" AND \";\r\n\r\n // Safe query\r\n $this->db->bind($column, $value);\r\n }\r\n $sql = preg_replace(\"/\\sAND\\s$/\", '', $sql);\r\n\r\n // Result\r\n return (bool) $this->db->query($sql);\r\n }", "public function delete($table, $conditions = false)\n\t{\n\t\t$ret = new Db_Query_Delete($this, $table);\n\t\t\n\t\tif($conditions)\n\t\t{\n\t\t\t$ret->where($conditions);\n\t\t\t\n\t\t\treturn $ret->execute();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $ret;\n\t\t}\n\t}", "public function testDeleteDiseaseModelCondition()\n {\n //$user = factory(User::class)->create();\n\n $condition = $this->diseaseModel->conditions()->create([\n 'disease_model_id' => $this->diseaseModel->id,\n 'clsf_weather_parameter' => ClsfWeatherParameters::Temperature,\n 'start_range' => 10,\n 'end_range' => 20,\n 'time' => 60\n ]);\n\n $this->seeInDatabase('disease_conditions', [\n 'id' => $condition->id,\n 'clsf_weather_parameter' => $condition->clsf_weather_parameter,\n 'start_range' => $condition->start_range,\n 'end_range' => $condition->end_range,\n 'time' => $condition->time\n ]);\n\n DiseaseCondition::find($condition->id)->delete();\n\n $this->notSeeInDatabase('disease_conditions', [\n 'id' => $condition->id,\n 'clsf_weather_parameter' => $condition->clsf_weather_parameter,\n 'start_range' => $condition->start_range,\n 'end_range' => $condition->end_range,\n 'time' => $condition->time\n ]);\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function delete($where=array())\n {\n return $this->db->where($where)->delete($this->tableName);\n }", "function deleteAll() {\n\t\t$dbh=$this->getdbh();\n\t\t$sts = $dbh->exec('DELETE FROM '.$this->enquote($this->tablename));\n\t\treturn $sts;\n\t\n\t}" ]
[ "0.7360172", "0.6932612", "0.6864547", "0.68125576", "0.6811774", "0.67802054", "0.6730054", "0.6696092", "0.66188514", "0.6600928", "0.6597353", "0.65894824", "0.65231895", "0.6472426", "0.64361906", "0.6426549", "0.6422816", "0.6416026", "0.6404252", "0.6390568", "0.63800085", "0.63771445", "0.6346352", "0.6314569", "0.6284589", "0.6276027", "0.6266084", "0.6261591", "0.6235311", "0.6217499", "0.6210573", "0.6208505", "0.6207456", "0.6198786", "0.61985713", "0.61680996", "0.6162609", "0.61445117", "0.61382794", "0.6137381", "0.6124141", "0.6111631", "0.6084141", "0.607371", "0.6070652", "0.6064112", "0.6063878", "0.60604674", "0.60604674", "0.60604674", "0.6045706", "0.6027582", "0.60189074", "0.6017696", "0.60115755", "0.5999988", "0.5999988", "0.59945023", "0.59909666", "0.59730595", "0.59701717", "0.5969807", "0.59692585", "0.5958958", "0.5958278", "0.59546196", "0.59418017", "0.5941451", "0.59379756", "0.59265816", "0.59097403", "0.59093827", "0.5901763", "0.590037", "0.5889956", "0.5888546", "0.5887617", "0.58870274", "0.58866626", "0.5882729", "0.58813626", "0.5879318", "0.5868286", "0.5868059", "0.5868059", "0.5866385", "0.58649975", "0.5858848", "0.58523166", "0.58477664", "0.5845934", "0.5840598", "0.58334464", "0.5833098", "0.582081", "0.5820264", "0.58005214", "0.5798346", "0.5793882", "0.5793053", "0.5787041" ]
0.0
-1
Delete all record that match with id.
public function delete($id, $primary_key = 'id') { $this->type = 'delete'; return $this->delete_where(array($primary_key => $id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteRecord ($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteRecord($id){\n\t}", "function delete($id){\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete($this->table);\n }", "abstract public function deleteById($id);", "public function deleteById($id)\n {\n if(!is_array($id)) $id = [$id];\n return $this->baseQuery()->whereIn('id', $id)->delete();\n }", "public function delete($id) \r\n {\r\n $this->load(array('id=?',$id));\r\n $this->erase();\r\n }", "public function delete($id){\n return $this->findById($id)->delete();\n }", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete_data($id)\n {\n $this->builder->where('id', $id);\n $this->builder->delete();\n }", "public function delete($id) {\n\t\treturn $this->model->findFirst(\"id = '$id'\")->delete();\n\t}", "function delete($id) {\r\n $this->db->where('id', $id);\r\n $this->db->delete($this->tbl);\r\n }", "public function delete($id)\n {\n $query=\"DELETE FROM recording WHERE id=\".$id;\n\n $this->executeQuery($query);\n }", "public function deleteRecords($id)\n {\n $this->db->where('id', $id);\n $result = $this->db->delete('tbl_request');\n return $result;\n }", "public function destroy($id)\n {\n //delete specific record\n }", "public function deleteById($id)\r\n {\r\n return $this->deleteByPk($id);\r\n }", "public function delete($id){\n\t\t$sql = \"DELETE FROM {$this->table} WHERE {$this->primaryKey} = $id\";\n\t\t$this->db->query($sql);\n\t}", "function delete($id) {\n $this->db->where('id', $id);\n $this->db->delete('rit');\n }", "public function delete( $id );", "public function delete($id) {\n return $this->model->find($id)->delete();\n }", "public function deleteById($id) {\r\n \t$obj = $this->find($id)->current();\r\n \tif (!empty($obj)) {\r\n \t\t$obj->delete();\r\n \t}\r\n }", "abstract public function delete($id);", "abstract public function delete($id);", "abstract public function delete($id);", "public function deleteRecords($id){\n \n $this->deleteId = $id;\n\n $result = $this->delteRecords();\n\n return array (\n 'success' => true,\n 'results' => $result != false ? $this->deleteRecords : $this->noRecords\n );\n }", "function delete($id) {\n return $this->db->deleteParameters(self::TABLA, array('id' => $id));\n }", "public function delete($id)\n {\n }", "protected static function _delete(array $id) {\n global $db;\n $q = sprintf(\"DELETE FROM \".TABLE.\" WHERE %s\", splitArray($id, \" AND \"));\n $res = $db->query($q);\n return $res;\n }", "public function delete($id)\n\t {\n\t //\n\t }", "function delete($id = null) {\n\t\t\tif($this->id > 0 && is_null($id)) {\n\t\t\t\t$id = $this->id;\n\t\t\t}\n\n\t\t\tif(is_null($id)) {\n\t\t\t\t$this->errors[] = \"No id specified to delete on.\";\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->before_delete();\n\t\t\t$result = $this->delete_all(\"id IN ($id)\");\n\n\t\t\tif($this->is_i18n) {\n\t\t\t\t$this->i18n_delete_record($id);\n\t\t\t}\n\n\t\t\tif($this->auto_delete_habtm) {\n\t\t\t\tif(is_string($this->has_and_belongs_to_many)) {\n\t\t\t\t\t$habtms = explode(\",\", $this->has_and_belongs_to_many);\n\t\t\t\t\tforeach($habtms as $other_table_name) {\n\t\t\t\t\t\t$this->delete_all_habtm_records(trim($other_table_name), $id);\n\t\t\t\t\t}\n\t\t\t\t} elseif(is_array($this->has_and_belongs_to_many)) {\n\t\t\t\t\tforeach($this->has_and_belongs_to_many as $other_table_name => $values) {\n\t\t\t\t\t\t$this->delete_all_habtm_records($other_table_name, $id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->after_delete();\n\n\t\t\tif (is_array($this->cache)) {\n\t\t\t\t$this->rebuild_cache();\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "function delete($id)\n\t{\n\t\t$this->db->where($this->id, $id);\n\t\treturn $this->db->delete($this->table);\n\t}", "public function delete(int $id);", "public function delete($id){\n\t\t$this->db->delete($this->_table_name, array('id'=>$id));\n }", "public function deleteAll($id)\n\t{\n\t\tif(! intval( $id )){ return false;\t}\n\t\t$id = $this->db->real_escape_string($id);\n\t\t$sql = \"DELETE FROM servicio_paquete WHERE id_serviciopaquete=\".$id.\";\";\n\t\t$row = $this->db->query($sql);\n\t\tif(!$row){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public static function delete($id)\n {\n self::_delete(self::tableName(), 'id = '. $id);\n }", "public function delete($id){\n $this->db->where('id', $id)\n ->delete($this->tabela);\n }", "public abstract function delete($id);", "public function deleteById($id) {\n $this->db->delete($this->table_name, ['id' => $id]);\n }", "function delete( $id )\n\t{\n\t\t// where clause\n\t\t$this->db->where( $this->primary_key, $id );\n\n\t\t// delete the record\n\t\treturn $this->db->delete( $this->table_name );\n\t\t// print_r($this->db->last_query());die;\n \t}", "public function deleteById($id)\n {\n return $this->deleteByPk($id);\n }", "public function deleteById($id)\n {\n return $this->deleteByPk($id);\n }", "public function delete($id)\n {\n error_log(\"aqui delete\");\n // TODO: Implement delete() method.\n }", "public function deleteSet($id) {\n return parent::delete($id);\n }", "public function forceDelete($id);", "public function forceDelete($id);", "public function delete($id)\n {\n return $this->model->where('id', $id)->delete();\n }", "public function delete($id)\n {\n return $this->model\n ->where('field', $id)\n ->delete();\n }", "function delete($id);", "public function delete($id) {\r\n\r\n }", "public function forceDeleteAll($id)\n\t{\n\t\treturn $this->model->where('task_id', '=', $id)\n\t\t\t\t\t\t\t->forceDelete();\n\t}", "public function deleteById($id)\r\n {\r\n return $this->delete($id);\r\n }", "public function del($id)\n {\n }", "public function delete( $table, $id ) {\n\t\t$this->last_error = null;\n\n\t\t$this->fetchAll($table);\n\t\t$all = $this->get_last_result();\n\n\t\t$found = false;\n\n\t\tforeach ($all as $key => $row) {\n\t\t\t// Force both to integers. TODO -notes\n\t\t\tif ( isset($row['id']) AND intval($row['id']) === intval($id) ) {\n\t\t\t\tunset($all[$key]);\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( $found ) {\n\t\t\t$this->commit($table, $all);\n\t\t} else {\n\t\t\t$this->last_error = 'ID_NOT_FOUND';\n\t\t}\n\t}", "public function delete($ids){\n \n $filter = $this->primaryFilter; \n $ids = ! is_array($ids) ? array($ids) : $ids;\n \n foreach ($ids as $id) {\n $id = $filter($id);\n if ($id) {\n $this->db->where($this->primary_key, $id)->limit(1)->delete($this->table_name);\n }\n }\n }", "public function delete($id) \n\t{\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete($this->Table);\n\t}", "public function delete($id)\r\n {\r\n $id = $this->sanitize($id);\r\n\r\n return $this->db->table($this->table)->where('id', $id)->delete();\r\n }", "public function delete($id)\n\t{\n\t}", "public function delete($id)\n\t{\n\t}", "public function deleteById($id): bool;", "public function destroy($id)\n {\n //\\\n $result = ScanResults::find($id);\n\n $result->delete();\n\n //ScanResults::destroy(1); //it can delete the record directly instead of calling then delete\n }", "public function delete($id)\n {\n //\n }", "public function delete($id)\n {\n //\n }", "public function delete(int $id): void;", "public function delete(int $id): void;", "public function delete(int $id): void;" ]
[ "0.7516177", "0.7370026", "0.7370026", "0.7370026", "0.7370026", "0.7370026", "0.7370026", "0.7326582", "0.7270083", "0.724362", "0.72399384", "0.7218106", "0.71824455", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7170826", "0.7168273", "0.7135108", "0.71072745", "0.7098862", "0.70879525", "0.70806944", "0.70806265", "0.7068618", "0.70629555", "0.704806", "0.7031828", "0.70286006", "0.70082176", "0.70082176", "0.70082176", "0.7007072", "0.69961756", "0.6944124", "0.6940589", "0.69390327", "0.6936919", "0.692873", "0.692022", "0.6914635", "0.6902816", "0.69023824", "0.68963015", "0.68954444", "0.68941975", "0.68789905", "0.6871072", "0.6871072", "0.6867708", "0.6862531", "0.68590546", "0.68590546", "0.6855767", "0.68554384", "0.6852746", "0.68451893", "0.68442595", "0.6837016", "0.68348676", "0.6833842", "0.6833196", "0.68310124", "0.6829338", "0.6825007", "0.6825007", "0.6806023", "0.6802452", "0.67960495", "0.67960495", "0.67875415", "0.67875415", "0.67875415" ]
0.0
-1
ALIASES Alias of "select"
public function columns($columns = array('*')) { return call_user_func_array(array($this,'select'), func_get_args()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function select();", "public function select();", "public function select();", "public function select()\n\t{\n\t\treturn call_user_func_array([$this->queryFactory->__invoke('select'), 'select'], func_get_args());\n\t}", "protected static function select()\n {\n }", "public function getSelect();", "public function getSelect();", "public function getSelectAliases();", "function select() {\n\t\t// PHP doesn't allow direct use as function argument\n\t\t$args=func_get_args();\n\t\treturn call_user_func_array(array($this,'lookup'),$args);\n\t}", "public function select() {\n\t\t// PHP doesn't allow direct use as function argument\n\t\t$_args=func_get_args();\n\t\treturn call_user_func_array(array($this,'lookup'),$_args);\n\t}", "function adv_select($table, array $where = null, array $fields = null, $order = '', $limit = null, $offset = null);", "public function select()\n {\n\n }", "public function Do_select_Example1(){\n\n\t}", "public function select($field);", "public function select()\n {\n return $this->_db->factory('select', $this);\n }", "public function select( $select ) {\n $args = func_get_args();\n\n $this->_type = self::TYPE_SELECT;\n\n foreach( $args AS $arg ) {\n $this->_select[] = $arg;\n }\n\n return $this;\n }", "public function createSelectSql(): \\Hx\\Db\\Sql\\SelectInterface;", "protected function parse_select( $alias = 'q' ) {\n\n\t\tif ( $this->args['return_value'] == 'relationships' ) {\n\t\t\treturn new Select( Select::ALL, $alias );\n\t\t} else {\n\t\t\treturn parent::parse_select( $alias );\n\t\t}\n\t}", "protected abstract function getSelectStatement();", "protected abstract function getSelectStatement();", "public function select($query, $bindings = []);", "public function select($query, $bindings = []);", "public function select($query, $bindings = []);", "public function select()\n {\n return new QueryProxy('select', $this);\n }", "public function select(callable $function);", "function select ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tselect');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function select()\n\t{\n\t\t$this->_query['select'] = func_get_args();\n\n\t\treturn $this;\n\t}", "public static function select($name = \"\")\n\t{\n\t\treturn new Select($name);\n\t}", "protected function select(): Select\n {\n return $this->select;\n }", "function select($spec) {\n\t\t$spec['select'] = array_unique($spec['select']);\n\t\tif(isset($spec['modifiers'])) {\n\t\t\t$spec['select'][0] = implode(' ', $spec['modifiers']) . ' ' . $spec['select'][0];\n\t\t\t$spec['modifiers'] = null;\n\t\t}\n\t\tif(isset($spec['join'])) {\n\t\t\t$spec['from'] = $spec['from'] . \" \" . implode(' ',$spec['join']);\n\t\t\t$spec['join'] = null;\n\t\t}\n\t\treturn $this->quoteIdentifiers($this->aliasFields($this->compile($spec), true));\n\t}", "protected function RetSelect() {\n\n $return = \"SELECT\";\n\n if ($this->\n distinct) {\n\n $return .= \" DISTINCT\";\n }\n\n $columnsArr = [];\n\n foreach ($this->\n columns as $key => $value) {\n\n if (is_string($value)) {\n\n $columnsArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $columnsArr[] = \"(\" . $value['subquery']->\n Generate() . \")\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else if (isset($value['value'])) {\n\n $columnsArr[] = \"'{$value['value']}'\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else {\n\n $columnsArr[] = \"{$value['column']}\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n }\n }\n\n if (count($columnsArr)) {\n\n $return .= \" \" . implode($columnsArr, \", \");\n } else {\n\n $return .= \" *\";\n }\n\n\n $tablesStr = \"\";\n\n foreach ($this->\n tables as $key => $value) {\n\n if (is_string($value)) {\n\n $tablesStr .= \", $value\";\n } else {\n\n if (!(isset($value['table']) &&\n $value['table'] != \"\") &&\n isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $value['table'] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n\n if (!isset($value['alias'])) {\n\n throw new \\Exception(\"Error: Alias required in case of subquery to be used in from clause.\");\n }\n } else {\n\n $value['table'] = \"{$value['table']}\";\n }\n\n if (isset($value['alias'])) {\n\n $value['alias'] = \"`{$value['alias']}`\";\n }\n\n if (!isset($value['table']) ||\n $value['table'] == \"\") {\n\n throw new \\Exception(\"Error: Tables not properly provided in QueryHelper.\");\n }\n\n if (!isset($value['jointype'])) {\n\n $tablesStr .= \", \" . $value['table'];\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n } else {\n\n switch ($value['jointype']) {\n case 'j':\n\n $tablesStr .= \" JOIN \" . $value['table'];\n break;\n\n case 'ij':\n\n $tablesStr .= \" INNER JOIN \" . $value['table'];\n break;\n\n case 'cj':\n\n $tablesStr .= \" CROSS JOIN \" . $value['table'];\n break;\n\n case 'sj':\n\n $tablesStr .= \" STRAIGHT_JOIN \" . $value['table'];\n break;\n\n case 'lj':\n\n $tablesStr .= \" LEFT JOIN \" . $value['table'];\n break;\n\n case 'rj':\n\n $tablesStr .= \" RIGHT JOIN \" . $value['table'];\n break;\n\n case 'nj':\n\n $tablesStr .= \" NATURAL JOIN \" . $value['table'];\n break;\n\n case 'nlj':\n\n $tablesStr .= \" NATURAL LEFT JOIN \" . $value['table'];\n break;\n\n case 'nrj':\n\n $tablesStr .= \" NATURAL RIGHT JOIN \" . $value['table'];\n break;\n\n case 'loj':\n\n $tablesStr .= \" LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'roj':\n\n $tablesStr .= \" RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nloj':\n\n $tablesStr .= \" NATURAL LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nroj':\n\n $tablesStr .= \" NATURAL RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n default:\n break;\n }\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n\n if (isset($value['joinconditions']) &&\n count($value['joinconditions'])) {\n\n $tablesStr .= $this->\n WhereClause($value['joinconditions'], 1);\n }\n }\n }\n }\n\n $return .= \" FROM \" . ltrim($tablesStr, \", \");\n\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n\n $groupsArr = [];\n\n foreach ($this->\n group as $key => $value) {\n\n if (is_string($value)) {\n\n $groupsArr[] = \"{$value}\";\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $groupsArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n } else if (isset($value['value'])) {\n\n $value['value'] = $this->\n connection->\n GetConn()->\n real_escape_string($value['value']);\n $groupsArr[] = \"'{$value['value']}'\";\n } else {\n\n $groupsArr[] = \"{$value['column']}\";\n }\n }\n\n if (count($groupsArr)) {\n\n $return .= \" GROUP BY \" . implode($groupsArr, \", \");\n }\n\n\n if (count($this->\n having)) {\n\n $return .= $this->\n WhereClause($this->\n having, 2);\n }\n\n\n $ordersArr = [];\n\n foreach ($this->\n order as $key => $value) {\n\n if (is_string($value)) {\n\n $ordersArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $ordersArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else if (isset($value['value'])) {\n\n $ordersArr[] = \"'{$value['value']}'\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else {\n\n $ordersArr[] = \"{$value['column']}\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n }\n }\n\n if (count($ordersArr)) {\n\n $return .= \" ORDER BY \" . implode($ordersArr, \", \");\n }\n\n if ($this->\n perpage > 0) {\n\n if ($this->\n page < 1) {\n\n $this->\n page = 1;\n }\n\n $startcount = $this->\n perpage * ($this->\n page - 1);\n\n $return .= \" LIMIT {$startcount}, {$this->\n perpage}\";\n }\n\n return $return . \";\";\n }", "public function select($select = null)\n {\n $this->_type = self::SELECT;\n\n if (empty($select)) {\n return $this;\n }\n\n $selects = is_array($select) ? $select : func_get_args();\n\n return $this->add('select', $selects, false);\n }", "function select($id)\n\t{\n\treturn parent::select($id);\n\t}", "function select($id)\n\t{\n\treturn parent::select($id);\n\t}", "public function select(\n $col = '',\n /*# string */ $colAlias = ''\n )/*# : SelectStatementInterface */;", "public function select($what = \"*\"){\n\t\t\tif(is_string($what)){\n\t\t\t\t$this->select = \"SELECT \" . $what . \" FROM \" . $this->table;\n\t\t\t}else{\n\t\t\t\t$this->select = false;\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function getSelect($alias) {\r\n\t\tforeach($this->_salt_fields as $select) {\r\n\t\t\tlist($expr, $aliasName) = $select;\r\n\t\t\tif ($alias === $aliasName) {\r\n\t\t\t\treturn SqlExpr::text(self::escapeName($alias));\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new SaltException(L::error_query_missing_alias($alias));\r\n\t}", "public function createSelect()\n {\n return $this->getConnection()->select();\n }", "public function addSelect($column);", "abstract function selectHook();", "protected function runSelectWithMeta()\n {\n return $this->connection->selectWithMeta(\n $this->toSql(),\n $this->getBindings(),\n ! $this->useWritePdo\n );\n }", "public function select(callable $callback);", "public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }", "public function select($select = '*')\n {\n $this->_type = db::SELECT;\n\n if (is_string($select))\n {\n $select = explode(',', $select);\n }\n elseif (is_object($select))\n {\n $this->_select[] = $select;\n }\n\n foreach ($select as $val)\n {\n if ($val !== '')\n {\n $this->_select[] = $val;\n }\n }\n\n return $this;\n }", "function dmSelect($table, $name, $value=\"\", $all=FALSE, $attrs=NULL, $required=TRUE) {\n $dmQ = new DmQuery();\n $dmQ->connect();\n # Don't use getAssoc() so that we can set the default below\n $dms = $dmQ->get($table);\n $dmQ->close();\n $default = \"\";\n $options = array();\n if ($all) {\n $options['all'] = 'All';\n }\n if (!$required) {\n // Add \"Any\" for the first option.\n $loc = new Localize(OBIB_LOCALE, \"shared\");\n $options[''] = $loc->getText(\"any\");\n }\n foreach ($dms as $dm) {\n $options[$dm->getCode()] = $dm->getDescription();\n if ($dm->getDefaultFlg() == 'Y') {\n $default = $dm->getCode();\n }\n }\n if ($value == \"\") {\n $value = $default;\n }\n if (!$required) {\n // Selected on \"Any\" option.\n $value = \"\";\n }\n return inputField('select', $name, $value, $attrs, $options);\n}", "public function setSelect($select);", "public function select($columns = array('*'));", "protected function _select(string $field, $as = FALSE): string\n\t{\n\t\t// Escape the identifiers\n\t\t$field = $this->driver->quoteIdent($field);\n\n\t\tif ( ! \\is_string($as))\n\t\t{\n\t\t\treturn $field;\n\t\t}\n\n\t\t$as = $this->driver->quoteIdent($as);\n\t\treturn \"({$field}) AS {$as} \";\n\t}", "public static function renderSelect();", "public function addSelect($select = null)\n {\n return $this->queryBuilder->addSelect($select);\n }", "public function Do_Allselect_Example1(){\n\n\t}", "public function select($fields);", "function select($fields = '*', $fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n return call_user_func_array([$this->db, __FUNCTION__], func_get_args());\n }", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "public function select($what, $alias = NULL)\n\t\t{\n\t\t\t$this->setType(self::$TYPE_SELECT);\t\t\t\n\t\t\tif(is_null($alias))\n\t\t\t{\n\t\t\t\t$alias = $what;\n\t\t\t}\n\t\t\t\n\t\t\tif(stripos($what,'distinct'))\n\t\t\t{\n\t\t\t\t$this->hasDistinct = TRUE;\n\t\t\t}\n\t\t\t\n\t\t\t$this->fields[$alias] = $what;\n\t\t\treturn $this;\n\t\t}", "public function select($query = null, array $binds = []) {\n\t\treturn query::create(query::QUERY_SELECT, $this)\n\t\t\t->query($query)\n\t\t\t->binds($binds);\n\t}", "abstract public function prepareSelect();", "function pg_select($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC, int $result_type = PGSQL_ASSOC)\n{\n error_clear_last();\n $result = \\pg_select($connection, $table_name, $assoc_array, $options, $result_type);\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n return $result;\n}", "public function select($table_name, $fields = array(), $where = array(), $order_by = '')\r\n {\r\n }", "function callback_select(array $args)\n {\n }", "public function select($query){\n return pg_fetch_all($this -> query($query));\n }", "public function select($table, array $fields = null);", "function select_option()\r\n{}", "public function select()\n {\n $cols = $this->getColsAsFields();\n return $this->gateway->select($cols);\n }", "public function getSelect(): ?Select;", "public function select($select = '*', $escape = null)\n {\n \t$this->ci->db->select($select, $escape);\n \treturn $this;\n }", "protected function processSelect(\\Zend_Db_Select $select)\n { }", "public function scopeDefaultSelect($query)\n {\n return $query->select(array_keys($this->casts));\n }", "function select($q)\n {\n return $this->dbh->query($q, PDO::FETCH_ASSOC)->fetchAll();\n }", "function select( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_SELECT,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}", "public function select($arg){\n if(is_string($arg)){\n $this->params['SELECT'] = \"$arg\";\n }else if(is_array($arg)){\n $c = \"\";\n $x = 0;\n foreach($arg as $a){//foreach, translate into SQL language\n if($x != 0){\n $c .= \",\";\n }\n $x++;\n $c .= $a;\n }\n $this->params[\"SELECT\"] = $c;//change the select using the arguments\n }else{\n echo 'An error has occured';\n return false;\n }\n return $this;\n }", "function test_select($urabe, $body)\n{\n $sql = $body->sql_select;\n $result = $urabe->select($sql);\n $result->message = \"Urabe test selection query with default parser\";\n return $result;\n}", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\n }", "public function select()\n {\n return new geoTableSelect($this->_name);\n }", "public function newSelect()\n {\n return $this->newInstance('Select');\n }", "static function select ($in = '', $data = []) {\n\t\treturn static::select_common($in, $data, __FUNCTION__);\n\t}", "function wrapper_select_db($dbname) {\n\t\treturn $this->functions['select_db']($dbname, $this->link_id);\n\t}", "public function select($columns);", "public function select(string $table, string $columns, string $where = \"\", array $bindings = array()): PDOStatement;", "public function fromSelectQuery(\\Yana\\Db\\Queries\\IsSelectQuery $query): string;", "public function select($cols = null);", "public function select($select = '*')\n {\n if (empty($select)) {\n return $this;\n }\n if (!is_string($select) && !is_array($select)) {\n throw new \\Exception(\"SELECT argument must be a string or an array of strings\", 100);\n }\n if (is_string($select)) {\n $select = explode(',', $select);\n }\n $this->clauses['select'] = array('select', $select);\n return $this;\n }", "public function addSelect($select = null)\n {\n $this->_type = self::SELECT;\n\n if (empty($select)) {\n return $this;\n }\n\n $selects = is_array($select) ? $select : func_get_args();\n\n return $this->add('select', $selects, true);\n }", "protected function runSelect()\n {\n return $this->connection->select(\n $this->toSql(),\n $this->getBindings(),\n $this->option->setUseWrite($this->useWritePdo)\n );\n }", "public function select($opt) {\n\t\t\n\t\t\t$statement = $this->buildSelect($opt);\n\t\t\t$pdoStatement = $this->prepare($statement);\n\t\t\t$this->__bindValues($pdoStatement);\n\t\t\t\n\t\t\t$pdoStatement->execute();\n\t\t\t$result = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t$pdoStatement->closeCursor();\n\t\t\t$this->__reset();\n\t\t\treturn $result;\n\t\t}", "function select($query)\n\t{\n\t\t\n\t\tglobal $connection;\n\t\t$resuts = $connection->query($query);\n\t\treturn $resuts;\n\t}", "function select_sql($table='', $fields='*', ...$get_args) {\n\t\t$this->select_result = false;\n return $this->selecting($table, $fields, ...$get_args);\t \n }", "public function select($table, $fields, $where, $order, $start);", "public function select($field = '*', $escape = null)\n {\n // If the escape value was not set, we will base it on the global setting\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if (is_string($field)) {\n $field = str_replace(' as ', ' AS ', $field);\n\n if (strpos($field, '+') !== false || strpos($field, '(') !== false) {\n $field = [$field];\n } else {\n $field = explode(',', $field);\n }\n\n foreach ($field as $name) {\n $name = trim($name);\n\n $this->builderCache->select[] = $name;\n $this->builderCache->noEscape[] = $escape;\n }\n } elseif (is_array($field)) {\n foreach ($field as $fieldName => $fieldAlias) {\n if (is_numeric($fieldName)) {\n $fieldName = $fieldAlias;\n } elseif (is_string($fieldName)) {\n if (is_string($fieldAlias)) {\n $fieldName = $fieldName . ' AS ' . $fieldAlias;\n } elseif (is_array($fieldAlias)) {\n $countFieldAlias = count($fieldAlias);\n\n for ($i = 0; $i < $countFieldAlias; $i++) {\n if ($i == 0) {\n $fieldAlias[ $i ] = $fieldAlias[ $i ] . \"'+\";\n } elseif ($i == ($countFieldAlias - 1)) {\n $fieldAlias[ $i ] = \"'+\" . $fieldAlias[ $i ];\n } else {\n $fieldAlias[ $i ] = \"'+\" . $fieldAlias[ $i ] . \"'+\";\n }\n }\n\n $fieldName = implode(', ', $fieldAlias) . ' AS ' . $fieldName;\n } elseif ($fieldAlias instanceof AbstractQueryBuilder) {\n $fieldName = '( ' . $fieldAlias->getSqlStatement() . ' ) AS ' . $fieldName;\n }\n }\n\n $this->select($fieldName, $escape);\n }\n }\n\n return $this;\n }", "public function select($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"SELECT \";\n\t\t$p = $this->clean($params);\n\t\t$statement = $prefix.\" \".$this->genFrom($p['cols']).\" \".$this->genTable($p['tables']).$this->genWhere($p['where']);\t\n\t\treturn $DB->select($statement);\t\n\t}", "function select($column0=null, $_=null){\n $obj = new SelectRule(new Context($this->connection));\n if($column0 == null){\n $args = ['*'];\n }elseif(is_array($column0)){\n $args = $column0;\n }else{\n $args = func_get_args();\n }\n foreach ($args as &$arg){\n $arg = DB::wrap($arg);\n if($arg == '*'){\n continue;\n }\n }\n return $obj->select(implode(',', $args));\n }", "public function select(array $columns = array(), $prefix = null);", "public function selectFields($select='*')\n\t\t{\n\t\t\t$this->reload();\n\t\t\t$this->select = $select;\n\t\t}", "public function testSelect()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->select(['a', 'b']));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b'], $elasticQuery['_source']);\n\n $query->select(['c', 'd']);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b', 'c', 'd'], $elasticQuery['_source']);\n\n $query->select(['e', 'f'], true);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['e', 'f'], $elasticQuery['_source']);\n }", "public function select($columns = '*', $option = '')\n\t{\n\t\tif (is_string($columns) && strpos($columns, '(') !== false)\n\t\t\t$this->_query['select'] = $columns;\n\t\telse\n\t\t{\n\t\t\tif (!is_array($columns))\n\t\t\t\t$columns = preg_split('/\\s*,\\s*/', trim($columns), -1, PREG_SPLIT_NO_EMPTY);\n\n\t\t\tforeach ($columns as $i => $column)\n\t\t\t{\n\t\t\t\tif (is_object($column))\n\t\t\t\t\t$columns[$i] = (string) $column;\n\t\t\t\telse if (strpos($column, '(') === false)\n\t\t\t\t{\n\t\t\t\t\tif (preg_match('/^(.*?)(?i:\\s+as\\s+|\\s+)(.*)$/', $column, $matches))\n\t\t\t\t\t\t$columns[$i] = $this->_connection->quoteColumnName($matches[1]) . ' AS ' . $this->_connection->quoteColumnName($matches[2]);\n\t\t\t\t\telse\n\t\t\t\t\t\t$columns[$i] = $this->_connection->quoteColumnName($column);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_query['select'] = implode(', ', $columns);\n\t\t}\n\t\tif ($option != '')\n\t\t\t$this->_query['select'] = $option . ' ' . $this->_query['select'];\n\t\treturn $this;\n\t}", "public function select($statement, $named_placeholder){\n $statement = $this->dbh->prepare($statement);\n\n $statement->execute($named_placeholder);\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n return $result;\n var_dump($result);\n\n }", "public function selectField($field, $as = NULL) {\r\n\r\n\t\tif ($field instanceof SqlExpr) {\r\n\t\t\t$sqlExpr = $field;\r\n\t\t\t$field = $sqlExpr->getFieldName();\r\n\t\t\tif ($field === NULL) {\r\n\t\t\t\tthrow new SaltException(L::error_query_select_expr);\r\n\t\t\t}\r\n\t\t} else if (!is_string($field)) {\r\n\t\t\tthrow new SaltException(L::error_query_select_fieldname);\r\n\t\t} else {\r\n\t\t\t$sqlExpr = $this->$field;\r\n\t\t}\r\n\r\n\t\tif ($sqlExpr->getType() === FieldType::DATE) {\r\n\t\t\t$sqlExpr->asTimestamp();\r\n\t\t}\r\n\r\n\t\treturn $this->select($sqlExpr, ($as === NULL)?$field:$as);\r\n\t}", "public function select($select_expression, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['SelectExpression'] = $select_expression;\n\n\t\treturn $this->authenticate('Select', $opt, $this->hostname);\n\t}", "public function select($sql) {\n $this->__select__ = $sql;\n return $this;\n }", "public static function select($columns = NULL) : Select\n {\n return new Select(func_get_args());\n }", "function qselect(){\r\n\t\t\r\n\t\r\n\t}" ]
[ "0.7241007", "0.7241007", "0.7241007", "0.68276936", "0.6793332", "0.6682151", "0.6682151", "0.66712", "0.6526877", "0.65237373", "0.64845836", "0.64590424", "0.6448691", "0.6437171", "0.63940203", "0.6372485", "0.6370882", "0.63682455", "0.6341586", "0.6341586", "0.631689", "0.631689", "0.631689", "0.63162076", "0.63099945", "0.6285891", "0.62688124", "0.62601644", "0.62562704", "0.6243509", "0.62306005", "0.6140691", "0.613525", "0.613525", "0.60876167", "0.6072525", "0.60538083", "0.605124", "0.6012002", "0.6009374", "0.5980879", "0.59805363", "0.59804183", "0.5976489", "0.5975587", "0.5973874", "0.59467083", "0.59402615", "0.5938291", "0.59291786", "0.5924942", "0.58960915", "0.58727425", "0.58611137", "0.5857929", "0.58531713", "0.5848748", "0.5838897", "0.5826376", "0.5825217", "0.5809374", "0.5804097", "0.5799628", "0.5791045", "0.5787155", "0.57831043", "0.5766224", "0.57654625", "0.57637405", "0.5746507", "0.57442635", "0.5744072", "0.57234764", "0.5720579", "0.5692356", "0.56722754", "0.5671155", "0.5666708", "0.56612307", "0.5656282", "0.5653191", "0.56526756", "0.5643466", "0.5638185", "0.5627237", "0.5616934", "0.5615586", "0.5613544", "0.5593848", "0.5592723", "0.55871004", "0.5577019", "0.5569577", "0.5569201", "0.5561194", "0.5555722", "0.55521655", "0.5552057", "0.55417544", "0.55352414", "0.55336016" ]
0.0
-1
Select only the columns from table.
public function select_only($columns) { return call_user_func_array(array($this,'select'), func_get_args()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function get_columns($table);", "public function selectAll() {\n\t\treturn $this->select(array_keys($this->table->columns));\n\t}", "public function select($columns);", "function columns($table)\n{\n\treturn $this->drv->columns($table);\n}", "public function select($columns = array('*'));", "abstract public function tableColumns();", "private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }", "public abstract function getColumns($table);", "public function columns($table_name);", "public function get_columns($table)\n\t{\n\t\treturn $this->driver_query($this->sql->column_list($this->prefix_table($table)), FALSE);\n\t}", "public function select($cols = null);", "public function get_columns($table){\n return $this->query(\"SHOW COLUMNS FROM {$table}\")->results();\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function columns($columns = array('*'))\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function getTableColumns(){\n\n $show_columns_statement = $this->grammer->compileShowColumns($this);\n return $this->connection->getTableColumns($show_columns_statement);\n\n }", "public function getColumns()\n\t{\n\t\t\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL COLUMNS FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "function getAllColumns($table){\n\t\t$types=sqlite_fetch_column_types($table,$this->id,SQLITE_ASSOC);\n\t\t$columns=array();\n\t\tforeach($types as $column=>$type){\n\t\t\t$columns[$column]=array(\n\t\t\t\t\"name\"=>$column,\n\t\t\t\t\"key\"=>&$row['Key'],\n\t\t\t\t\"type\"=>&$types[$column],\n\t\t\t\t\"default\"=>&$row['Default'],\n\t\t\t\t\"comment\"=>&$row['Comment']\n\t\t\t\t);\n\t\t}\n\t\treturn $columns;\n\t}", "static function columns($instancia = null) {\n if ($instancia) {\n return fields_of($instancia->_tablename());\n } else {\n return fields_of(self::getInstance()->_tablename());\n }\n }", "public function getTableColumns()\n\t{\n\t}", "function listColumns($tablename);", "public function getTableColumns() { return $this->table->getColumns(); }", "public function columns($columns = '*'): self\n {\n return $this->select($columns);\n }", "public function getColumns()\n {\n if (! is_null($this->columns)) {\n return collect($this->columns);\n }\n\n return $this->columns = collect($this->rows->first())\n ->except(['created_at', 'updated_at', 'deleted_at', 'id'])\n ->keys();\n }", "public function getColumns()\n {\n return $this->select_list;\n }", "private function getAllColumnFromTable(array $except){\n\t\t\t$SQL = \"SHOW COLUMNS FROM {$this->table}\";\n\t\t\t$temp=array();\n\t\t\t\n\t\t\t$result = $this->db->query($SQL);if (!$result) { print_r($this->db->errorInfo()); }\n\t\t\t\n\t\t\twhile($row = $result->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$key=array_search($row['Field'], $except);\n\t\t\t\tif($key>-1){\n\t\t\t\t}else{\n\t\t\t\t\tarray_push($temp,$row['Field']);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $temp;\n\t\t}", "function getColumns($table) {\n return mysql_query(sprintf('SHOW COLUMNS FROM %s', $table), $this->db);\n }", "function _get_columns($only_keys,$extra_cols)\n\t{\n\t\t//echo \"_get_columns() only_keys=\"; _debug_array($only_keys); echo \"extra_cols=\"; _debug_array($extra_cols);\n\t\tif ($only_keys === true)\t// only primary key\n\t\t{\n\t\t\t$cols = $this->db_key_cols;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cols = array();\n\t\t\t$distinct_checked = false;\n\t\t\tforeach(is_array($only_keys) ? $only_keys : explode(',', $only_keys) as $col)\n\t\t\t{\n\t\t\t\tif (!$distinct_checked)\n\t\t\t\t{\n\t\t\t\t\tif (stripos($col, 'DISTINCT ') === 0) $col = substr($col, 9);\n\t\t\t\t\t$distinct_checked = true;\n\t\t\t\t}\n\t\t\t\tif (!$col || $col == '*' || $col == $this->table_name.'.*')\t// all columns\n\t\t\t\t{\n\t\t\t\t\t$cols = array_merge($cols,$this->db_cols);\n\t\t\t\t}\n\t\t\t\telse\t// only the specified columns\n\t\t\t\t{\n\t\t\t\t\tif (stripos($col,'as'))\t// if there's already an explicit naming of the column, just use it\n\t\t\t\t\t{\n\t\t\t\t\t\t$col = preg_replace('/^.*as +([a-z0-9_]+) *$/i','\\\\1',$col);\n\t\t\t\t\t\t$cols[$col] = $col;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (($db_col = array_search($col,$this->db_cols)) !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cols[$db_col] = $col;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$cols[$col] = isset($this->db_cols[$col]) ? $this->db_cols[$col] : $col;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($extra_cols)\t// extra columns to report\n\t\t{\n\t\t\tforeach(is_array($extra_cols) ? $extra_cols : explode(',',$extra_cols) as $col)\n\t\t\t{\n\t\t\t\tif (stripos($col,'as ')!==false) $col = preg_replace('/^.*as +([a-z0-9_]+) *$/i','\\\\1',$col);\n\t\t\t\tif (($db_col = array_search($col,$this->db_cols)) !== false)\n\t\t\t\t{\n\t\t\t\t\t$cols[$db_col] = $col;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$cols[$col] = isset($this->db_cols[$col]) ? $this->db_cols[$col] : $col;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $cols;\n\t}", "abstract protected function columns();", "function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}", "private function getSelectTableColumns($model){\n return $this->querySqlFormatter->getModelTableShowColumns($this->subClassoF($model)->table);\n }", "public function getSpecificColumns()\n {\n return $this->_specificColumns;\n }", "abstract public function columnListQuery($table);", "public function table_columns($table)\n\t{\n\t\tif ($table instanceof Database_Identifier)\n\t\t{\n\t\t\t$schema = $table->namespace;\n\t\t\t$table = $table->name;\n\t\t}\n\t\telseif (is_array($table))\n\t\t{\n\t\t\t$schema = $table;\n\t\t\t$table = array_pop($schema);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$schema = explode('.', $table);\n\t\t\t$table = array_pop($schema);\n\t\t}\n\n\t\tif (empty($schema))\n\t\t{\n\t\t\t$schema = $this->_config['connection']['database'];\n\t\t}\n\n\t\t$result =\n\t\t\t'SELECT column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, numeric_precision, numeric_scale, collation_name,'\n\t\t\t.' column_type, column_key, extra, privileges, column_comment'\n\t\t\t.' FROM information_schema.columns'\n\t\t\t.' WHERE table_schema = '.$this->quote_literal($schema).' AND table_name = '.$this->quote_literal($this->table_prefix().$table);\n\n\t\t$result = $this->execute_query($result)->as_array('column_name');\n\n\t\tforeach ($result as & $column)\n\t\t{\n\t\t\tif ($column['data_type'] === 'enum' OR $column['data_type'] === 'set')\n\t\t\t{\n\t\t\t\t$open = strpos($column['column_type'], '(');\n\t\t\t\t$close = strpos($column['column_type'], ')', $open);\n\n\t\t\t\t// Text between parentheses without single quotes\n\t\t\t\t$column['options'] = explode(\"','\", substr($column['column_type'], $open + 2, $close - 3 - $open));\n\t\t\t}\n\t\t\telseif (strlen($column['column_type']) > 8)\n\t\t\t{\n\t\t\t\t// Test for UNSIGNED or UNSIGNED ZEROFILL\n\t\t\t\tif (substr_compare($column['column_type'], 'unsigned', -8) === 0\n\t\t\t\t\tOR substr_compare($column['column_type'], 'unsigned', -17, 8) === 0)\n\t\t\t\t{\n\t\t\t\t\t$column['data_type'] .= ' unsigned';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "abstract public function getColsFields();", "public function getSelectStatementColumns()\n {\n $columns = array();\n foreach ($this->columns as $column) {\n if (!array_key_exists($column, $this->customColumns)) {\n // Support alias column\n $column = array_key_exists($column, $this->aliases) ? DB::raw($this->aliases[$column]) : $column;\n $columns[] = $column;\n }\n }\n // Add index into columns for situation index is not exist\n foreach ($this->indexes as $index) {\n if (!in_array($index, $columns)) {\n array_unshift($columns, $index);\n }\n }\n if ($columns[0] instanceof \\Illuminate\\Database\\Query\\Expression) {\n $columns[0] = DB::raw(\"SQL_CALC_FOUND_ROWS \" . $columns[0]->getValue());\n } else {\n $columns[0] = DB::raw(\"SQL_CALC_FOUND_ROWS \" . $columns[0]);\n }\n return $columns;\n }", "function _select ($table_name, $select_column_names, $distinct = FALSE) {\n\t\t$statement = $distinct ? 'SELECT DISTINCT ' : 'SELECT ';\n\t\tif ( isset($select_column_names) && $select_column_names ) {\n\t\t\t$count_select_column_names = count($select_column_names);\n\t\t\tfor ($pointer = 0; $pointer < $count_select_column_names; $pointer++) { \n\t\t\t\tif ($pointer == $count_select_column_names - 1 ) {\n\t\t\t\t\t$statement .= '`' . $select_column_names[$pointer] . '` ';\n\t\t\t\t} else {\n\t\t\t\t\t$statement .= '`' . $select_column_names[$pointer] . \"`, \";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$statement .= \"* \";\n\t\t}\n\t\t$statement .= \"FROM `{$table_name}` \" ;\n\t\treturn $statement;\n\t}", "protected function getColumn()\n {\n return DB::select(\n 'SELECT\n\t\t\t\t\t\t\t c.COLUMN_NAME\n\t\t\t\t\t\t\t,c.COLUMN_DEFAULT\n\t\t\t\t\t\t\t,c.IS_NULLABLE\n\t\t\t\t\t\t\t,c.DATA_TYPE\n\t\t\t\t\t\t\t,c.CHARACTER_MAXIMUM_LENGTH\n\t\t\t\t\t\t\t,pk.CONSTRAINT_TYPE AS EXTRA\n\t\t\t\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS AS c\n\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME, tc.CONSTRAINT_TYPE\n\t\t\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc\n\t\t\t\t\t\t\t INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku ON tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME\n\t\t\t\t\t\t\t) AS pk ON c.TABLE_CATALOG = pk.TABLE_CATALOG\n\t\t\t\t\t\t\t AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA\n\t\t\t\t\t\t\t AND c.TABLE_NAME = pk.TABLE_NAME\n\t\t\t\t\t\t\t AND c.COLUMN_NAME = pk.COLUMN_NAME\n\t\t\t\t\t\t\tWHERE c.TABLE_NAME = ? AND c.TABLE_CATALOG = ? ',\n [$this->tableName, $this->databaseName]\n );\n }", "public static function getSelectColumns(){\n\t\t$columns = '';\n\t\t/* getSelectColumns */\n\t\t$columns .= ' `'.UserSetting::FIELD_USER.'`';\n\t\t$columns .= ', `'.UserSetting::FIELD_IDENT.'`';\n\t\t$columns .= ', `'.UserSetting::FIELD_VALUE.'`';\n\t\t/* getSelectColumns end */\n\t\treturn $columns;\n\t}", "protected function get_table_columns($table) {\n\n\t\t$conn_str = 'pgsql:host='.$this->_database['host'];\n\t\t$conn_str.= ';dbname='.$this->_database['database'];\n\t\t$conn = new \\PDO($conn_str, $this->_database['username'], $this->_database['password']);\n\t\t$conn->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n\t\t$sql = \t\"SELECT column_name \n \t\t\t\tFROM information_schema.columns \n\t\t\t\t\tWHERE table_name = :table;\";\n\n $stmt = $conn->prepare($sql);\n $stmt->execute(array('table' => $table));\n\n $struttura = array();\n\n while($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n\t $struttura[] = $row['column_name'];\n\t }\n\n\t return $struttura;\n\t}", "function getColumns($table){\n $sql = 'SHOW COLUMNS FROM ' . $table;\n $names = array();\n $db = $this->prepare($sql);\n\n try {\n if($db->execute()){\n $raw_column_data = $db->fetchAll();\n\n foreach($raw_column_data as $outer_key => $array){\n foreach($array as $inner_key => $value){\n\n if ($inner_key === 'Field'){\n if (!(int)$inner_key){\n $names[] = $value;\n }\n }\n }\n }\n }\n return $names;\n } catch (Exception $e){\n return $e->getMessage(); //return exception\n }\n }", "public function select($columns)\n {\n return $this->columns($columns);\n }", "public function getColumns()\n {\n return $this->allColumns ?: $this->defineListColumns();\n }", "public function getTableColumns() {\n return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n }", "public function select(array $columns = array(), $prefix = null);", "public function getTableColumns()\n {\n $tableColumns = $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n return $tableColumns;\n }", "public static function getColumns($table)\n {\n $pdo = ConnMysql::getConn();\n \n $sth = $pdo->prepare(\"SHOW FULL COLUMNS FROM \" . $table);\n $sth->execute();\n /**\n * [x] => Array\n * [Field] => name\n [Type] => varchar | int | etc.\n [Collation] => utf8_general_ci\n [Null] => YES\n [Key] => PRIM ! MUL |\n [Default] => \n [Extra] => \n [Privileges] => select,insert,update,references\n [Comment] => \n */\n $columns = $sth->fetchAll(\\PDO::FETCH_ASSOC);\n foreach($columns as $k=>$field){\n $columns[$k]['Kind'] = $field['Type'];\n $columns[$k]['Size'] = 0;\n $type = $field['Type'];\n $columns[$k]['Key'] = $field['Key'];\n /*\n * Determine string for index Kind that resume Type literaly\n * (varchar, int, datetime)\n * Determine Size field\n */\n $limit = strstr($type, '(');\n if($limit != false){\n $columns[$k]['Kind'] = str_replace($limit, '', $field['Type']);\n $columns[$k]['Size'] = str_replace(['(',')'], '', $limit);\n } elseif ($field['Type'] == 'date' \n || $field['Type'] == 'time' \n || $field['Type'] == 'datetime' \n || $field['Type'] == 'year') {\n $columns[$k]['Kind'] = 'datetime';\n }\n \n }\n return $columns;\n }", "public function get_selectable_columns()\n\t{\n\t\treturn array();\n\t}", "public function select($table, array $fields = null);", "public function getColumnsFromTable()\n {\n return Zend_Db_Table::getDefaultAdapter()->describeTable($this->_tableName);\n }", "public function getColumns(string $table)\n {\n return $this->callSql(\"EXEC sp_columns $table\");\n }", "public function getSelectColumns(): array\n {\n return [\n 'question_id',\n 'slug',\n 'user_id',\n 'subject',\n 'headline',\n 'message',\n 'views',\n 'views_not_bot_one_month',\n 'answer_count_cached',\n 'created_datetime',\n 'created_name',\n 'created_ip',\n 'modified_user_id',\n 'modified_datetime',\n 'modified_reason',\n 'moved_datetime',\n 'moved_user_id',\n 'moved_country',\n 'moved_language',\n 'moved_question_id',\n 'deleted_datetime',\n 'deleted_user_id',\n 'deleted_reason',\n ];\n }", "public function tableColumns($table,$column);", "static public function getTableColumns($table='services') {\n return DB::getSchemaBuilder()->getColumnListing($table);\n }", "function get_table_columns($table_name, $choosen_fields = [])\n\t{\n\t\t$fields = $this->db->list_fields($table_name);\n\t\t$table_columns = array();\n\t\t\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\tif (!empty($choosen_fields)){\n\t\t\t\tforeach($choosen_fields as $choosen_field){\n\t\t\t\t\tif ($field === $choosen_field){\n\t\t\t\t\t\t$table_columns[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\t\t\t\n\t\t\t\t$table_columns[] = $field;\n\t\t\t}\n\t\t}\n\t\treturn $table_columns; \n\t}", "abstract public function getColNames();", "public function getColumns() {\n\t\treturn( $this->getTable()->getColumns() );\n\t}", "abstract protected function fetchColumnDefsDb(string $table);", "abstract public function listColumns();", "public static function getColumns($table){\n\t\t// get all the column into the table\n\t\t$query = DB::select('column_name')->from('information_schema.columns')->where_open()\n\t\t->where('table_schema', 'fuel_dev')\n\t\t->and_where('table_name', $table)\n\t\t->where_close()\n\t\t->execute()->as_array();\n\n\t\tforeach($query as $k=>$v)\n\t\t\t$columns[$k] = $v['column_name'];\n\t\treturn $columns;\n\t}", "public function selectColumns()\n {\n $this->select(\n [\n ConfigService::$tableComments . '.id as id',\n ConfigService::$tableComments . '.content_id as content_id',\n ConfigService::$tableComments . '.comment as comment',\n ConfigService::$tableComments . '.parent_id as parent_id',\n ConfigService::$tableComments . '.user_id as user_id',\n ConfigService::$tableComments . '.temporary_display_name as display_name',\n ConfigService::$tableComments . '.created_on as created_on',\n ConfigService::$tableComments . '.deleted_at as deleted_at'\n ]\n );\n\n return $this;\n }", "protected function getColumns() {\n $driver = $this->connection->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n // Calculate the driver class. Why don't they do this for us?\n $class = '\\\\Aura\\\\SqlSchema\\\\' . ucfirst($driver) . 'Schema';\n $schema = new $class($this->connection, new ColumnFactory());\n return array_keys($schema->fetchTableCols($this->table));\n }", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "function select($columns)\n{\n\t$this->tryModify();\n\t$this->query['select'] = is_array($columns)? $columns : explode(',', $columns);\n\t$this->execute();\n\t$rows = $this->db->fetchAll($this->result);\n\t$this->close();\n\t$this->query['select'] = array('*');\n\treturn $rows;\n}", "public function select($table, $fields, $where, $order, $start);", "public function select(...$columns)\n {\n // code...\n $this->__COLUMNS__ = array_unique(array_merge($this->__COLUMNS__ ?? [], $this->flatten($columns)));\n\n return $this;\n }", "public function table_attributes() {\n return static::find_by_sql(\"SHOW COLUMNS FROM \".static::$table_name);\n }", "public function allColumns() {\n\t\treturn $this->allColumns;\n\t}", "protected function getSelectColumns()\n {\n $select = [];\n\n foreach ($this->config as $key => $columns) {\n if (substr($key, -6) !== 'Column') continue;\n if (trim($columns) === '') continue;\n $field = substr($key, 0, -6);\n\n $columns = explode(',', $columns);\n $columns = array_map('trim', $columns);\n foreach ($columns as $col) {\n if (!isset($select[$col])) $select[$col] = [];\n $select[$col][] = $field;\n }\n }\n\n return $select;\n }", "abstract protected function columns(): array;", "public function select(string $table, string $columns, string $where = \"\", array $bindings = array()): PDOStatement;", "protected function getAllColumns(){\n\t\t\treturn array_merge($this->columns, $this->keys);\n\t\t}", "abstract public function getCols();", "function getTableFields($table) {\n return $this->select(\"show fields from $table\");\n }", "public function getColumns($onlyName = false, $withId = true)\n\t{\n\t\t$columns = $this->columns;\n\t\n\t\tif (!$withId)\n\t\t{\n\t\t\tunset($columns['id']);\n\t\t}\n\t\n\t\treturn !$onlyName ? $columns : array_keys($columns);\n\t}", "public function select()\n {\n $cols = $this->getColsAsFields();\n return $this->gateway->select($cols);\n }", "public function getTableColumns($table, $typeOnly = true)\n\t{\n\t\treturn [];\n\t}", "function select_columns($table,$columns_name){\n $columns = null;\n $i=0;\n $query = \"SELECT * FROM $table\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result){\n $_SESSION['message'] = \"Eroare la select_columns\".Database::getInstance()->getConnection()->error;\n $_SESSION['status'] = \"danger\";\n $_SESSION['icon'] = \"exclamation-sign\";\n echo status_baloon();\n die(\"mort!!\");\n }\n while ($row = $result->fetch_assoc()){\n $i++;\n foreach ($columns_name as $column)\n $columns[$i][$column] = $row[$column];\n }\n $result->free_result();\n return $columns;\n}", "private function cols($table)\r\n {\r\n return [\r\n $table->increments(\"uid\"),\r\n $table->integer(\"pid\"),\r\n $table->integer(\"lid\"),\r\n\r\n $table->timestamps(),\r\n $table->softDeletes(),\r\n\r\n $table->integer(\"rowPos\"),\r\n $table->integer(\"colPos\"),\r\n\r\n $table->integer(\"hidden\"),\r\n $table->integer(\"sorting\"),\r\n\r\n $table->string(\"ctype\", 255),\r\n $table->string(\"plugin\", 255),\r\n\r\n $table->integer(\"file\"),\r\n\r\n $table->string(\"grid\", 50),\r\n $table->integer(\"grids_parent\"),\r\n $table->integer(\"grids_sorting_rowpos\"),\r\n $table->integer(\"grids_sorting_colpos\"),\r\n $table->string(\"grid_config\"),\r\n ];\r\n }", "function getColumnasFomTable($tabla)\n{\n $query = \"SELECT cols.ordinal_position as posicion,cols.column_name as nombre,cols.data_type\"\n .\" FROM information_schema.columns cols\"\n .\" WHERE\"\n .\" cols.table_name=?\"\n .\" and cols.column_name not in ('created_at', 'updated_at')\"\n .\" order by posicion\";\n\n $lista = \\DB::select($query, [$tabla]);\n $columnas = array();\n foreach($lista as $item){\n $columnas[$item->nombre] = str_oracion($item->nombre);\n }\n\n return $columnas;\n}", "public function getColumns( $table ) {\n\t\t$table = $this->safeTable($table, true);\n\t\t$columnsRaw = $this->adapter->get(\"PRAGMA table_info('$table')\");\n\t\t$columns = array();\n\t\tforeach($columnsRaw as $r) {\n\t\t\t$columns[$r[\"name\"]]=$r[\"type\"];\n\t\t}\n\t\treturn $columns;\n\t}", "public function getColumns ($table) {\n\n\t// get columns\n\t$sql = \"SHOW COLUMNS FROM \".mysql_real_escape_string($table).\";\";\n\t$result = $this->_sendQuery($sql);\n\tif (!$result) return false;\n\n\t// put return in array\n\t$columns = array();\n\twhile ($arr = mysql_fetch_assoc($result)) $columns[] = $arr['Field'];\n\n\treturn $columns;\n }", "public function select($table, $cols=\"*\", $where=\"\", $orderby=\"\", $limit=-1, $offset=-1){\n $query = \"\";\n $query .= \"SELECT \";\n if($cols != \"*\"){\n if(is_array($cols)){\n $query .= implode(\",\", $cols);\n }else{\n $query .= $cols;\n }\n }else{\n $query .= \"*\";\n }\n $query .= \" FROM \";\n $query .= \"\" . $table . \"\";\n\n if($where != \"\"){\n $query .= \" WHERE \";\n if(is_array($where)){\n\t $count = count($where);\n\t foreach($where as $key => $value){\n\t $count--;\n\t $query .= $key . \"='\" . $value . \"'\";\n\t if($count > 0){\n\t $query .= \" AND \";\n\t }\n\t }\n }else{\n\t $query .= $where;\n }\n }\n if($orderby!=\"\"){\n \t$query .= \" ORDER BY \" . $orderby;\n }\n if($limit > 0 AND $offset < 1){\n $query .= \" LIMIT \" . $limit;\n }\n if($limit > 0 AND $offset > 0){\n\t $query .= \" LIMIT \" . $offset . \",\" . $limit;\n }\n if($this->cache){\n\t $data = $this->mysqli_cached_query($query);\n\t return $data;\n\t }else{\n \t$data = mysqli_query($this->mysql, $query);\n\t if(!$data) die(\"ERROR: \" . mysqli_error($this->mysql));\n \t return $this->sqlReturn($data);\n \t }\n }", "static public function getColumnListing($table)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function getColumns( $table ) {\n\t\t$columns = array();\n\t\t$table = $this->safeTable($table);\n\t\t$columnsRaw = $this->adapter->get(\"SHOW COLUMNS FROM $table\");\n\t\tforeach($columnsRaw as $r) {\n\t\t\t$columns[$r['Field']]=$r['Type'];\n\t\t}\n\t\treturn $columns;\n\t}", "public function all()\n {\n return $this->columns;\n }", "function readColumns() { return $this->_columns; }", "public function list_columns($table)\n\t{\n\t\t$columns = array();\n\t\tif ($this->db_type == 'mysql')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"DESCRIBE `$table`\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->Field;\n\t\t\t}\n\t\t}\n\t\tif ($this->db_type == 'pgsql')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"select column_name from information_schema.columns where table_name = '{$table}' and table_catalog=current_database();\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->column_name;\n\t\t\t}\n\t\t}\n\t\tif ($this->db_type == 'sqlite')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"PRAGMA table_info('$table')\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->name;\n\t\t\t}\n\t\t}\n\t\treturn $columns;\n\t}", "public function getColumns($table){\n\n\t\t$query = $this->db->prepare(\"DESCRIBE $table\");\n\t\t$query->execute();\n\n\t\t//Returns associative array of column names.\t\n\t\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n\t}" ]
[ "0.7555806", "0.7313904", "0.7303383", "0.72816604", "0.7192735", "0.71248716", "0.7021116", "0.701483", "0.70039654", "0.69970834", "0.69882894", "0.6937382", "0.68477774", "0.68477774", "0.68477774", "0.68477774", "0.6845705", "0.6845705", "0.6784511", "0.67409444", "0.6692959", "0.6689489", "0.6674115", "0.6672897", "0.66526234", "0.6638744", "0.6622224", "0.6596589", "0.65772367", "0.6574861", "0.6569645", "0.6568441", "0.6566896", "0.65645844", "0.65561193", "0.6525331", "0.6510413", "0.64981544", "0.64837563", "0.6478093", "0.6443841", "0.64405316", "0.64368707", "0.64340454", "0.64330393", "0.64312094", "0.64210224", "0.63950276", "0.63928145", "0.63859177", "0.63825583", "0.63794535", "0.6368574", "0.6357807", "0.63464564", "0.6342282", "0.63410527", "0.63355446", "0.63170415", "0.631659", "0.6315443", "0.63117546", "0.63078064", "0.63016003", "0.62993515", "0.62989074", "0.62715334", "0.6267115", "0.6267115", "0.6267115", "0.6267115", "0.6267115", "0.6267115", "0.6267115", "0.62437457", "0.6241948", "0.6232961", "0.6231433", "0.62306297", "0.6221733", "0.62170196", "0.62012017", "0.62009627", "0.6192042", "0.61895066", "0.6185868", "0.617354", "0.61727554", "0.6170603", "0.61686695", "0.6166369", "0.6161811", "0.6157713", "0.6153959", "0.6150554", "0.61397374", "0.6136129", "0.6131847", "0.61250025", "0.6102512" ]
0.6898283
12
Select all column from table except those.
public function select_except($columns) { $exceptions = array_values_recursive(func_get_args()); $all_columns = $this->get_column_names(); $columns = array_except($all_columns, $exceptions); return $this->select($columns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getAllColumnFromTable(array $except){\n\t\t\t$SQL = \"SHOW COLUMNS FROM {$this->table}\";\n\t\t\t$temp=array();\n\t\t\t\n\t\t\t$result = $this->db->query($SQL);if (!$result) { print_r($this->db->errorInfo()); }\n\t\t\t\n\t\t\twhile($row = $result->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$key=array_search($row['Field'], $except);\n\t\t\t\tif($key>-1){\n\t\t\t\t}else{\n\t\t\t\t\tarray_push($temp,$row['Field']);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $temp;\n\t\t}", "public function get_hidden_columns() {\n\n\t\t// Return a blank array, filtered.\n\t\treturn apply_filters( Core\\HOOK_PREFIX . 'review_table_hidden_columns', array() );\n\t}", "public function select_only($columns)\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function discardPreviewColumns();", "public function getExcluded(): array\n {\n $arr = [];\n foreach ($this->columns as $name => $column) {\n if ($column->isExcluded()) {\n $arr[] = $name;\n }\n }\n\n return $arr;\n }", "public static function columns()\n {\n if (Deal::first() ?? false) {\n return array_diff(array_keys(Deal::first()->attributesToArray()), Deal::first()->exclude); \n } else {\n return array();\n }\n }", "public function selectAll() {\n\t\treturn $this->select(array_keys($this->table->columns));\n\t}", "public static function getReservedColumns() {\n return array('deleted');\n }", "public function get_hidden_columns()\n\t{\n\t\treturn array();\n\t}", "protected function loadColumns(){\n\t\t\t$this->columns = array_diff(\n\t\t\t\tarray_keys(get_class_vars($this->class)),\n\t\t\t\t$this->getIgnoreAttributes()\n\t\t\t);\n\t\t}", "function get_hidden_columns( ) {\r\n\t\t$columns = get_user_option( 'managemedia_page_' . MLACore::ADMIN_PAGE_SLUG . 'columnshidden' );\r\n\r\n\t\tif ( is_array( $columns ) ) {\r\n\t\t\tforeach ( $columns as $index => $value ){\r\n\t\t\t\tif ( empty( $value ) ) {\r\n\t\t\t\t\tunset( $columns[ $index ] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$columns = self::$default_hidden_columns;\r\n\t\t}\r\n\r\n\t\treturn apply_filters( 'mla_list_table_get_hidden_columns', $columns );\r\n\t}", "public function get_hidden_columns() {\n\t\treturn array();\n\t}", "public function get_hidden_columns()\n {\n return array();\n }", "public function get_hidden_columns()\n {\n return array();\n }", "public function get_hidden_columns()\r\n {\r\n return array();\r\n }", "public function select($columns = array('*'));", "public function get_hidden_columns()\r\n\t{\r\n\t\treturn [ ];\r\n\t}", "function my_columns_filter( $columns ) {\n unset($columns['tags']);\n unset($columns['categories']);\n unset($columns['tags']);\n unset($columns['comments']);\n return $columns;\n}", "public function allColumns() {\n\t\treturn $this->allColumns;\n\t}", "protected function removeColumns()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $columns = $this->ask('Enter your desired columns separated by space');\n $this->checkInput($columns);\n $separatedColumns = explode(' ', $columns);\n $this->service->removeColumns($table, $separatedColumns);\n }", "public function clearColumnsFromAliasing()\n {\n foreach ($this->columns as $index => $column) {\n $this->columns[$index] = $this->clearColumn($column);\n }\n foreach ($this->columns as $index => $column) {\n $this->columns[$index] = $this->clearColumn($column);\n }\n }", "public function remain_columns($db_name, $table, $coulumns)\n {\n $this->db->where('db_name', $db_name);\n $this->db->where('table_from', $table);\n $this->db->select('column_from');\n $matched = $this->db->get('imports')->result();\n\n $mached_columns = [];\n foreach($matched as $matched_item) {\n foreach (explode(\",\", $matched_item->column_from) as $cf) {\n $mached_columns[] = $cf;\n }\n }\n foreach($coulumns as $item) {\n $ori_columns[] = $item->Field;\n }\n \n return array_diff($ori_columns, $mached_columns);\n }", "public abstract function get_columns($table);", "public function except(string $column): self {\n unset($this->record[$column]);\n return $this;\n }", "public function dropTemporaryColumns()\n\t{\n\t\tif($this->Input->get('do') != 'member' && $this->Input->get('act') != 'edit' )\n\t\t{\n\t\t\t$objExtRegFields = $this->Database->prepare(\"SELECT name FROM \" . $this->strTableFields)->execute();\n\t\t\t\t\t\t\t\n\t\t\tif(!$objExtRegFields->numRows)\n\t\t\t{\n\t\t\t\treturn;\t\n\t\t\t} \n\t\t\t\n\t\t\twhile($objExtRegFields->next() )\n\t\t\t{\n\t\t\t\tif($this->Database->fieldExists($objExtRegFields->name, $this->dcTable, true) )\n\t\t\t\t{\n\t\t\t\t\t$objDrop = $this->Database->prepare(\"ALTER TABLE \".$this->dcTable.\" DROP \".$objExtRegFields->name.\"\" )->execute();\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}", "private function getMissingCols($table)\n {\n $columns1 = $this->getColumns($this->conn1, $table);\n $columns2 = $this->getColumns($this->conn2, $table);\n $columns = array();\n foreach ($columns1 as $col) {\n if (!in_array($col, $columns2)) {\n $columns[] = $col;\n }\n }\n return $columns;\n }", "public function whereNot($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "protected function getAllColumns(){\n\t\t\treturn array_merge($this->columns, $this->keys);\n\t\t}", "function columns($table)\n{\n\treturn $this->drv->columns($table);\n}", "public function getInvalidColumns()\n {\n return $this->invalidColumns;\n }", "function change_columns_filter( $columns ) {\n unset($columns['product_tag']);\n unset($columns['sku']);\n unset($columns['featured']);\n unset($columns['product_type']);\n unset($columns['post_type']);\n unset($columns['price']);\n return $columns;\n}", "function unframed_sql_select_keys($pdo, $table, $column) {\n\t$st = $pdo->prepare(\"SELECT DISTINCT \".$column.\" FROM \".$table);\n\tif ($st->execute(array())) {\n\t\treturn $st->fetchAll(PDO::FETCH_COLUMN);\n\t}\n\tthrow new Unframed($st->errorInfo()[2]);\n}", "public static function all($columns = ['*']);", "private function resetQuery()\n {\n $this->cols('*');\n }", "function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}", "function change_order_columns_filter( $columns ) {\n unset($columns['shipping_address']);\n unset($columns['customer_message']);\n unset($columns['order_total']);\n return $columns;\n}", "private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }", "public function select($cols = null);", "public function select($columns);", "protected function hiddenColumns(): array\n {\n return [];\n }", "public function all($cols = ['*']);", "public function getSpecificColumns()\n {\n return $this->_specificColumns;\n }", "function getAllColumns($table){\n\t\t$types=sqlite_fetch_column_types($table,$this->id,SQLITE_ASSOC);\n\t\t$columns=array();\n\t\tforeach($types as $column=>$type){\n\t\t\t$columns[$column]=array(\n\t\t\t\t\"name\"=>$column,\n\t\t\t\t\"key\"=>&$row['Key'],\n\t\t\t\t\"type\"=>&$types[$column],\n\t\t\t\t\"default\"=>&$row['Default'],\n\t\t\t\t\"comment\"=>&$row['Comment']\n\t\t\t\t);\n\t\t}\n\t\treturn $columns;\n\t}", "public function columns($columns = array('*'))\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function get_selectable_columns()\n\t{\n\t\treturn array();\n\t}", "public function getSelectColumns(): array\n {\n return [\n 'question_id',\n 'slug',\n 'user_id',\n 'subject',\n 'headline',\n 'message',\n 'views',\n 'views_not_bot_one_month',\n 'answer_count_cached',\n 'created_datetime',\n 'created_name',\n 'created_ip',\n 'modified_user_id',\n 'modified_datetime',\n 'modified_reason',\n 'moved_datetime',\n 'moved_user_id',\n 'moved_country',\n 'moved_language',\n 'moved_question_id',\n 'deleted_datetime',\n 'deleted_user_id',\n 'deleted_reason',\n ];\n }", "function getAllColumns()\n {\n $cols = $this->getTable()->getColumns();\n $rels = $this->getTable()->getRelations();\n $columns = array();\n foreach ($cols as $name => $col)\n {\n // we set out to replace the foreign key to their corresponding aliases\n $found = null;\n foreach ($rels as $alias => $rel)\n {\n $relType = $rel->getType();\n if ($rel->getLocal() == $name && $relType != Doctrine_Relation::MANY_AGGREGATE && $relType != Doctrine_Relation::MANY_COMPOSITE)\n {\n $found = $alias;\n }\n }\n\n if ($found)\n {\n $name = $found;\n }\n\n $columns[] = new sfDoctrineAdminColumn($name, $col);\n }\n\n return $columns;\n }", "public function all($columns = ['*']);", "public function get_columns($table)\n\t{\n\t\treturn $this->driver_query($this->sql->column_list($this->prefix_table($table)), FALSE);\n\t}", "public function get_columns($table){\n return $this->query(\"SHOW COLUMNS FROM {$table}\")->results();\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function setUnaltered()\n {\n $this->alteredColumns = [];\n }", "public function getColumns()\n {\n return $this->allColumns ?: $this->defineListColumns();\n }", "public function dropColumn()\n\t{\n\n\t}", "public function getColumns()\n {\n return $this->select_list;\n }", "public static function mla_manage_columns_filter( ) {\r\n\t\treturn apply_filters( 'mla_list_table_get_columns', self::$default_columns );\r\n\t}", "public function columns($table_name);", "function dropColumn($table, $name);", "public function getDefaultFilterColumns();", "public function getColumns()\n {\n if (! is_null($this->columns)) {\n return collect($this->columns);\n }\n\n return $this->columns = collect($this->rows->first())\n ->except(['created_at', 'updated_at', 'deleted_at', 'id'])\n ->keys();\n }", "public function ignoreColumn ($column) {\n\t\t#coopy/CompareFlags.hx:368: characters 9-77\n\t\tif ($this->columns_to_ignore === null) {\n\t\t\t#coopy/CompareFlags.hx:368: characters 38-77\n\t\t\t$this->columns_to_ignore = new \\Array_hx();\n\t\t}\n\t\t#coopy/CompareFlags.hx:369: characters 9-39\n\t\t$_this = $this->columns_to_ignore;\n\t\t$_this->arr[$_this->length++] = $column;\n\t}", "public function getAllNoAdmin(): array\n {\n return $this->db\n ->table($this->table)\n ->select('id, name')\n ->where('rights', 1, '!=')\n ->fetch();\n }", "function rhd_excluded_category_columns( $columns ) {\n\treturn array_merge( $columns, array( 'excluded' => __( 'Excluded from Dropdown' ) ) );\n}", "public function all()\n {\n return $this->columns;\n }", "function getColumns($table){\n $sql = 'SHOW COLUMNS FROM ' . $table;\n $names = array();\n $db = $this->prepare($sql);\n\n try {\n if($db->execute()){\n $raw_column_data = $db->fetchAll();\n\n foreach($raw_column_data as $outer_key => $array){\n foreach($array as $inner_key => $value){\n\n if ($inner_key === 'Field'){\n if (!(int)$inner_key){\n $names[] = $value;\n }\n }\n }\n }\n }\n return $names;\n } catch (Exception $e){\n return $e->getMessage(); //return exception\n }\n }", "abstract public function tableColumns();", "public static function availableColumns()\n {\n return static::availableColumnData()->pluck('value');\n }", "function disable_wpseo_remove_columns( $columns )\n {\n\t\tunset( $columns['wpseo-score'] );\n\t\tunset( $columns['wpseo-links'] );\n\t\tunset( $columns['wpseo-linked'] );\n\t\tunset( $columns['wpseo-score-readability'] );\n\t\t\t\n \treturn $columns;\n }", "public function columns($columns = '*'): self\n {\n return $this->select($columns);\n }", "protected function getSelectColumns()\n {\n $select = [];\n\n foreach ($this->config as $key => $columns) {\n if (substr($key, -6) !== 'Column') continue;\n if (trim($columns) === '') continue;\n $field = substr($key, 0, -6);\n\n $columns = explode(',', $columns);\n $columns = array_map('trim', $columns);\n foreach ($columns as $col) {\n if (!isset($select[$col])) $select[$col] = [];\n $select[$col][] = $field;\n }\n }\n\n return $select;\n }", "public function getCol() : array\n\t{\n\t\treturn $this->fetchAllFromColumn();\n\t}", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "public static function removeColumn($col){\n\t\t//\t\t\tarray_slice($db_fields, $col + 1, count($db_fields) -1, true);\n\t\t\t\t\n\t}", "public abstract function getColumns($table);", "public static function getSelectColumns(){\n\t\t$columns = '';\n\t\t/* getSelectColumns */\n\t\t$columns .= ' `'.UserSetting::FIELD_USER.'`';\n\t\t$columns .= ', `'.UserSetting::FIELD_IDENT.'`';\n\t\t$columns .= ', `'.UserSetting::FIELD_VALUE.'`';\n\t\t/* getSelectColumns end */\n\t\treturn $columns;\n\t}", "protected function queryColumnInformationInvalidate($table) {\n fastcache::cache_clear_all('queryColumnInformation:' . $table, 'schema_queryColumnInformation');\n }", "public function getTableColumns() { return $this->table->getColumns(); }", "function dbGetColumns(){\n global $conn;\n $columns = array();\n $query = \"SELECT COLUMN_NAME\n FROM information_schema.COLUMNS\n WHERE table_name = 'games'\n AND COLUMN_KEY != 'PRI'\n ORDER BY ordinal_position;\";\n if ($result = $conn->query($query)) {\n while ($row = $result->fetch_assoc()) {\n $columns[] = $row['COLUMN_NAME'];\n }\n return $columns;\n }\n}", "protected function getFillableColumns($table)\n {\n $columns = $this->schema->listTableColumns($table);\n return collect($columns)\n ->filter(function ($column) {\n return ! $column->getAutoincrement() && ! in_array($column->getName(), $this->guardFields);\n });\n }", "abstract public function remove_column($table_name, $column_name);", "public function getColumns()\n\t{\n\t\t\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL COLUMNS FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "protected function dropColumns($args)\n {\n $fields = array_map(function($val) \n {\n $bits = explode(':', $val);\n return \"'$bits[0]'\";\n }, $args);\n \n if ( count($fields) === 1 ) {\n return \"\\$table->dropColumn($fields[0]);\";\n } else {\n return \"\\$table->dropColumn(array(\" . implode(', ', $fields) . \"));\";\n }\n }", "public function excludes(...$columns)\n {\n // code...\n $this->__EXCLUDES__ = array_unique(array_merge($this->__EXCLUDES__ ?? [], $this->flatten($columns)));\n\n return $this;\n }", "public function select(...$columns)\n {\n // code...\n $this->__COLUMNS__ = array_unique(array_merge($this->__COLUMNS__ ?? [], $this->flatten($columns)));\n\n return $this;\n }", "public function all($columns = ['*'])\n {\n\n }", "abstract public function columnListQuery($table);", "function custom_columns( $columns ){\n\tif (current_user_can('administrator')) {\n\t\t// Remove 'Comments' Column\n\t\tunset($columns['comments']);\n\t}\n\telse {\n\t\t// Remove 'Comments' Column\n\t\tunset($columns['comments']);\n\t\tunset($columns['author']);\n\t}\n\treturn $columns;\n}", "private function searchableColumns()\n {\n return empty($this->searchables) ? array_diff($this->fillable, $this->hidden) : $this->searchables;\n }", "function sunset_set_columns_list($columns)\n{\n unset($columns['title']);\n unset($columns['date']);\n unset($columns['author']);\n\n $columns['title'] = 'Full Name';\n $columns['message'] = 'Message';\n $columns['email'] = 'Email';\n $columns['date'] = 'Date';\n\n return $columns;\n}", "abstract protected function columns();", "private function cols($table)\r\n {\r\n return [\r\n $table->increments(\"uid\"),\r\n $table->integer(\"pid\"),\r\n $table->integer(\"lid\"),\r\n\r\n $table->timestamps(),\r\n $table->softDeletes(),\r\n\r\n $table->integer(\"rowPos\"),\r\n $table->integer(\"colPos\"),\r\n\r\n $table->integer(\"hidden\"),\r\n $table->integer(\"sorting\"),\r\n\r\n $table->string(\"ctype\", 255),\r\n $table->string(\"plugin\", 255),\r\n\r\n $table->integer(\"file\"),\r\n\r\n $table->string(\"grid\", 50),\r\n $table->integer(\"grids_parent\"),\r\n $table->integer(\"grids_sorting_rowpos\"),\r\n $table->integer(\"grids_sorting_colpos\"),\r\n $table->string(\"grid_config\"),\r\n ];\r\n }", "function getColumns($table) {\n return mysql_query(sprintf('SHOW COLUMNS FROM %s', $table), $this->db);\n }", "function getColumnasFomTable($tabla)\n{\n $query = \"SELECT cols.ordinal_position as posicion,cols.column_name as nombre,cols.data_type\"\n .\" FROM information_schema.columns cols\"\n .\" WHERE\"\n .\" cols.table_name=?\"\n .\" and cols.column_name not in ('created_at', 'updated_at')\"\n .\" order by posicion\";\n\n $lista = \\DB::select($query, [$tabla]);\n $columnas = array();\n foreach($lista as $item){\n $columnas[$item->nombre] = str_oracion($item->nombre);\n }\n\n return $columnas;\n}", "abstract protected function columns(): array;", "abstract public function getColNames();" ]
[ "0.702105", "0.64414114", "0.64275354", "0.63731056", "0.62467635", "0.61780566", "0.6176675", "0.61722904", "0.61179984", "0.61029077", "0.6099894", "0.60962397", "0.60658765", "0.60658765", "0.6044466", "0.6027576", "0.6021435", "0.5992363", "0.5984404", "0.5969258", "0.5910184", "0.5887156", "0.5874151", "0.58703804", "0.5868789", "0.58365875", "0.58315426", "0.5820375", "0.57930785", "0.57670563", "0.57547694", "0.5744737", "0.57312286", "0.569368", "0.5688264", "0.5685087", "0.5681651", "0.56752515", "0.56748706", "0.5672789", "0.5669328", "0.56587875", "0.5658773", "0.5647156", "0.5640642", "0.5630965", "0.5628567", "0.5623356", "0.56090295", "0.5605279", "0.55974925", "0.55974925", "0.55974925", "0.55974925", "0.55951333", "0.55951333", "0.5585601", "0.558243", "0.55741364", "0.5565627", "0.5563053", "0.55615914", "0.55602473", "0.5559457", "0.55587286", "0.55484825", "0.5540411", "0.5532197", "0.55281013", "0.5522255", "0.5504793", "0.5499886", "0.549602", "0.54957056", "0.54949814", "0.54778945", "0.54732555", "0.5454283", "0.5449136", "0.544681", "0.54338264", "0.54253304", "0.5418794", "0.54063076", "0.5403974", "0.53821397", "0.5381663", "0.53731316", "0.53703094", "0.5363216", "0.53625137", "0.535161", "0.53448874", "0.5340598", "0.53394705", "0.533812", "0.53368765", "0.532443", "0.5324036", "0.53170365" ]
0.66485834
1
Add a "where" within boolean operator "or" to the query.
public function or_where($query, $params = array(), $not = false) { return $this->where($query, $params, 'or', $not); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }", "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "public function orWhereComplex()\n {\n return $this->addComplexCondition('or', $this->conditions);\n }", "public function orWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_OR) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_OR, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public function orWhere()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('or', $column, $comparison, $value);\r\n \r\n return $this;\r\n }", "public function orWhere()\n {\n if ( func_num_args() == 2 )\n {\n list($field, $value) = func_get_args();\n $op = '=';\n }\n else\n {\n list($field, $op, $value) = func_get_args();\n }\n $this->appendWhere('OR', $field, $op, $value); \n return $this;\n }", "public function orClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'OR', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }", "public function orWhere() {\r\n\t\t$args = func_get_args();\r\n\t\tif (count($this->_wheres)) {\r\n\t\t\t$criteria = call_user_func_array(array($this->_wheres[count($this->_wheres)- 1], 'orWhere'), $args);\r\n\t\t} else {\r\n\t\t\t$statement = array_shift($args);\r\n\t\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t\t$this->_wheres[] = $criteria;\r\n\t\t}\r\n\t\treturn $criteria;\r\n\t}", "public function addWhereOr($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'OR ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function testBuildWhereOnlyOr()\n {\n $query = $this->getQuery()\n ->whereOr(\n $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->where('is_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE (table1.id = '100' OR table1.is_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function testBuildWhereWithOr()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where('is_super_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR is_super_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function orWhere($where): QueryBuilderInterface;", "public function or_where_close()\n {\n $this->_where[] = array('OR' => ')');\n return $this;\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function orWhere($where, $params = array()) {\n parent::orWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function orWhere($table,$column,$data = \"\");", "public function or_where_open()\n {\n $this->_where[] = array('OR' => '(');\n\n return $this;\n }", "public function testBuildWhereWithOrComplex()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where(\n $this->getQuery()\n ->where('is_super_admin', 1)\n ->where('can_be_super_admin', 1)\n )\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR (is_super_admin = '1' AND can_be_super_admin = '1'))\",\n $query->buildWhere()\n );\n }", "public function orWhere($column, $operator = null, $value = null);", "protected function user_where_clause() {}", "public function whereOr($value) {\n\t$this->parseQuery->where('$or', $value);\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "protected function getWhereClause() {}", "private function mergeOrWhere(){\n $wheres = $this->orWheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" OR \";\n }\n return rtrim($whereString, \" OR \");\n }", "public function orWhere($column, $value = false, $operator = '=')\n {\n\t\treturn $this->condition($column, $value, $operator, 'OR', 'where');\n\t}", "public function orWhere($field, $operator, $value);", "public function orWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'orWhere'), func_get_args());\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function orWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function orWhereIf($where, $params = array()) {\n return empty($where)\n ? $this\n : $this->orWhere($where, $params);\n }", "protected function getGeneralWhereClause() {}", "public function hasOrWhere()\n {\n return $this->_has('_orWhere');\n }", "function or_where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'OR ', $escape);\r\n\t}", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function whereOrQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('OR', $subQuery);\r\n\t}", "public function orWhere(...$args)\n {\n $this->addCondition('or', $args, $this->conditions);\n return $this;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function orWhereOpen()\n\t{\n\t\t$this->where[] = array(\n\t\t\t'type' => 'or',\n\t\t\t'nesting' => 'open',\n\t\t);\n\n\t\treturn $this;\n\t}", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function and_where_close()\n {\n $this->_where[] = array('AND' => ')');\n return $this;\n }", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "public function useOr()\n {\n $this->imploder = ' OR ';\n }", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function orNotWhereOpen()\n\t{\n\t\t$this->where[] = array(\n\t\t\t'type' => 'or',\n\t\t\t'not' => true,\n\t\t\t'nesting' => 'open',\n\t\t);\n\n\t\treturn $this;\n\t}", "private function setWhere(QueryBuilder $qb)\n {\n // global filtering\n if (isset($this->requestParams['search']) && '' != $this->requestParams['search']['value']) {\n $globalSearch = $this->requestParams['search']['value'];\n\n $orExpr = $qb->expr()->orX();\n $globalSearchType = $this->options->getGlobalSearchType();\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n $searchType = $globalSearchType;\n $searchField = $this->searchColumns[$key];\n // Subqueries and arithmetics fields can't be search with LIKE\n if ($column->isCustomDql() && ('string' != $column->getTypeOfField()) || preg_match('/SELECT .+ FROM .+/', $searchField)) {\n if (!is_numeric($globalSearch)) {\n continue;\n }\n $globalSearch = floatval($globalSearch);\n switch ($searchType) {\n case 'like':\n $searchType = 'eq';\n break;\n case 'notLike':\n $searchType = 'neq';\n break;\n }\n }\n $this->setOrExpression($orExpr, $qb, $searchType, $searchField, $globalSearch, $key);\n }\n }\n\n if ($orExpr->count() > 0) {\n $qb->andWhere($orExpr);\n }\n }\n\n // individual filtering\n if (true === $this->accessor->getValue($this->options, 'individualFiltering')) {\n $andExpr = $qb->expr()->andX();\n\n $parameterCounter = DatatableQueryBuilder::INIT_PARAMETER_COUNTER;\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n if (false === array_key_exists($key, $this->requestParams['columns'])) {\n continue;\n }\n\n $searchValue = $this->requestParams['columns'][$key]['search']['value'];\n\n if ('' != $searchValue && 'null' != $searchValue) {\n /** @var FilterInterface $filter */\n $filter = $this->accessor->getValue($column, 'filter');\n $searchField = $this->searchColumns[$key];\n $andExpr = $filter->addAndExpression($andExpr, $qb, $searchField, $searchValue, $parameterCounter);\n }\n }\n }\n\n if ($andExpr->count() > 0) {\n $qb->andWhere($andExpr);\n }\n }\n\n return $this;\n }", "public function orConditions($data = array()) {\r\n $filter = $data['filter'];\r\n $condition = array(\r\n 'OR' => array(\r\n $this->alias . '.title LIKE' => '%' . $filter . '%',\r\n $this->alias . '.body LIKE' => '%' . $filter . '%',\r\n )\r\n );\r\n return $condition;\r\n }", "public function orWhere($data, $conditional = 'AND') {\n\n\t \t$fields = count($data);\n\t\t\t$i = 0;\n\n\t\t\tif(is_null($this->_where)) {\n\t\t\t\t$this->_where = ' WHERE ';\n\t\t\t} else {\n\t\t\t\t$this->_where .= \" $conditional \";\n\t\t\t}\n\n\t\t\tif($fields < 2) {\n\t\t\t\tthrow new Exception('Para utlizar o metodo orWhere é necessário pelo menos 2 clausulas');\n\t\t\t}\n\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$newKey = ':'.$key;\n\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\tif($i == 0) {\n\t\t\t\t\t$this->_where .= '(' . $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t} else if ( $i+1 == $fields) {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ')';\n\t\t\t\t} else {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\treturn $this;\n\t }", "public function custom_where( $where = '' ){\n\n\n\t// make sure to change your meta_key to whatever you saved your user_id as here mine is _restricted_to\n\n\t\tglobal $wpdb;\n\t\t$user_id = get_current_user_id();\n\n\t\t$where .= \" OR (( $wpdb->postmeta.meta_key = '_bcit_wpd_show_product' and $wpdb->postmeta.meta_value = $user_id ))\";\n\n\t\tremove_filter( 'posts_where', array( $this, 'custom_where' ) );\n\n\t\treturn $where;\n\n\t}", "public function orWhere($operand, $operatorOrValue=null, $value=null);", "public function getOrWhere($name = null)\n {\n return $this->_get('_orWhere', $name);\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "public function or_where($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_where', $key, $value, 'OR ', $escape);\n\t}", "public function orWhereClose()\n\t{\n\t\treturn $this->whereClose();\n\t}", "public function rawOrWhere($where, $bindings = array())\n\t{\n\t\treturn $this->rawWhere($where, $bindings, 'OR');\n\t}", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "public function or_where($column, $op = null, $value = null)\n {\n if (is_array($column))\n {\n foreach ($column as $key => $val)\n {\n if (is_array($val))\n {\n $this->or_where($val[0], $val[1], $val[2]);\n }\n else\n {\n $this->or_where($key, '=', $val);\n }\n }\n }\n else\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n $this->_where[] = array('OR' => array($column, $op, $value));\n }\n\n return $this;\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function orWhereAcf(...$args)\n {\n $this->addAcfCondition('or', $args, $this->conditions);\n return $this;\n }", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "public function orWhere($column, $operator = null, $value = null)\n\t{\n\t\treturn $this->where($column, $operator, $value, 'OR');\n\t}", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "public function orwhere($column, $sign = null, $value = null)\n {\n if ($this->initwhereclause)\n return $this->where($column, $sign, $value, 'or');\n else\n return $this->where($column, $sign, $value, 'where');\n }", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "function searchwp_query_where() {\n\t\tglobal $wpdb;\n\n\t\t$sql = '';\n\n\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t$this->get_woocommerce_ordering();\n\t\t}\n\n\t\tif ( $this->is_woocommerce_search() && ! empty( $this->ordering ) ) {\n\t\t\t// ratings need moar SQL\n\t\t\tif ( 'rating' === $this->ordering['wc_orderby'] ) {\n\t\t\t\t$sql = \" AND ( swpwpcommeta.meta_key = 'rating' OR swpwpcommeta.meta_key IS null ) \";\n\t\t\t}\n\t\t}\n\n\t\t// Pre WooCommerce 3.0: use meta to limit visibility\n\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '3.0.0', '<' ) ) {\n\t\t\tif ( $this->is_woocommerce_search() ) {\n\t\t\t\t// visibility\n\t\t\t\tif ( apply_filters( 'searchwp_woocommerce_consider_visibility', true ) ) {\n\t\t\t\t\tif ( apply_filters( 'searchwp_woocommerce_consider_visibility_variations', true ) ) {\n\t\t\t\t\t\t$sql .= \" AND ( ( {$wpdb->prefix}posts.post_type = 'product_variation' OR ( woovisibility.meta_key = '_visibility' AND CAST( woovisibility.meta_value AS CHAR ) IN ( 'visible', 'search' ) ) ) ) \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" AND ( ( woovisibility.meta_key = '_visibility' AND CAST( woovisibility.meta_value AS CHAR ) IN ( 'visible', 'search' ) ) ) \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function orWhere(...$conditions)\n {\n $this->where(...$conditions);\n return $this;\n }", "public function orWhereRaw(/*# string */ $rawString, array $params = []);", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "public function whereParenWrap() {\n $where = $this->_dqlParts['where'];\n if (count($where) > 0) {\n array_unshift($where, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n return parent::where(...Factory::resolve(func_get_args()));\n }", "public function orWhere($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function havingOR()\n {\n $this->having .= \" OR \";\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function orWhere($column, $operator = null, $value = null)\n {\n return $this->where($column, $operator, $value, 'or');\n }", "public function where()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n $this->addToBindings($bindings);\n $this->wheres[] = $sql;\n\n return $this;\n }", "public function andWhere($where): QueryBuilderInterface;", "final public static function or($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' OR ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' OR ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function orWhereNotEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => [self::OPERATORS['ne'] => $value]]);\n }", "private function sql_whereAnd_sysLanguage()\n {\n if ( !isset( $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ] ) )\n {\n return;\n }\n\n $languageField = $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ];\n $languageId = $GLOBALS[ 'TSFE' ]->sys_language_content;\n\n // DRS :TODO:\n if ( $this->pObj->b_drs_devTodo )\n {\n $prompt = '$this->int_localisation_mode PI1_SELECTED_OR_DEFAULT_LANGUAGE: for each language a query!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n\n switch ( $this->int_localisation_mode )\n {\n case( PI1_DEFAULT_LANGUAGE ):\n $andWhere = \" AND \" . $languageField . \" <= 0 \";\n break;\n case( PI1_SELECTED_OR_DEFAULT_LANGUAGE ):\n $andWhere = \" AND ( \" .\n $languageField . \" <= 0 OR \" .\n $languageField . \" = \" . intval( $languageId ) .\n \" ) \";\n break;\n case( PI1_SELECTED_LANGUAGE_ONLY ):\n $andWhere = \" AND \" . $languageField . \" = \" . intval( $languageId ) . \" \";\n break;\n default:\n $andWhere = null;\n break;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "abstract public function where(array $where);", "public function andWhere($where, $params = array()) {\n parent::andWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "public function andWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_AND) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public function orFilter($column, $operator = '=', $value = null): Builder\n {\n [$value, $operator] = $this->prepareValueAndOperator(\n $value, $operator, func_num_args() === 2\n );\n\n return $this->addFilter($column, $operator, $value, 'or');\n }", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function or_where($key, $char = NULL)\r\n {\r\n return $this->_where($key, $char, 'OR ');\r\n }", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "public function getWhere() {\n return $this->_where ?: new Predicate(Predicate::ALSO);\n }", "public function whereOrObject($objects) {\r\n\t\t$this->addWhereObject('OR', $objects);\r\n\t}" ]
[ "0.7701621", "0.76787245", "0.76000285", "0.748829", "0.740958", "0.740935", "0.73612344", "0.7336319", "0.72939616", "0.7263355", "0.72628045", "0.7196073", "0.7193769", "0.7186757", "0.71855056", "0.71262205", "0.7092571", "0.70825726", "0.70703447", "0.70423806", "0.70376676", "0.7027339", "0.6998565", "0.68796575", "0.6871678", "0.68710124", "0.68689334", "0.68169713", "0.68132997", "0.6812784", "0.67877626", "0.6778875", "0.6766817", "0.67587787", "0.67454356", "0.6720957", "0.67103237", "0.6701651", "0.66878045", "0.66724634", "0.66137946", "0.65950257", "0.6583316", "0.65741086", "0.65667963", "0.65543896", "0.6548943", "0.65416634", "0.6521131", "0.6515097", "0.6493686", "0.6482721", "0.64745724", "0.6450265", "0.6445517", "0.64354515", "0.64340997", "0.64307445", "0.64214164", "0.6411268", "0.63994086", "0.6393929", "0.6387236", "0.6380723", "0.6365837", "0.63570327", "0.63547605", "0.6346926", "0.63419604", "0.6339326", "0.6336492", "0.63336265", "0.63254637", "0.6319934", "0.6309482", "0.63059086", "0.6303937", "0.6300712", "0.62969655", "0.6280741", "0.6278017", "0.6259455", "0.62577003", "0.6254026", "0.62509495", "0.6244333", "0.6242965", "0.623937", "0.6220273", "0.6205287", "0.6204124", "0.61963767", "0.6193662", "0.6188204", "0.61793345", "0.61782986", "0.6159188", "0.61526704", "0.61522186", "0.614891" ]
0.66751367
39
Add a "where" denying the condition to the query.
public function where_not($query, $params = array(), $boolean = 'and') { return $this->where($query, $params, $boolean, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getWhereClause() {}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "protected function user_where_clause() {}", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "protected function getGeneralWhereClause() {}", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "public function where(string $condition): SQL\n {\n $this->condition[] = $condition;\n return $this;\n }", "public function addWhere($where)\n {\n $this->wheres[$where] = $where;\n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function getWhereClause()\n {\n return $this->where_clause;\n }", "public function getWhere($where, Database_Config $databaseConfig = NULL);", "public function getWhere()\n {\n return $this->where;\n }", "public function where(string ...$condition): self\n {\n $this->where = array_merge($this->where, $condition);\n return $this;\n }", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "public function setWhere($where)\r\n {\r\n $this->where = !empty($where) ? $where : null;\r\n }", "private function sql_whereWiHits()\n {\n // Get WHERE statement\n $where = $this->pObj->objSqlInit->statements[ 'listView' ][ 'where' ] .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS();\n // Localise the WHERE statement\n $where = $this->sql_whereWiHitsLL( $where );\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "public function addWhere($condition)\n\t{\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\t\t$this->wheres[] = $condition;\n\t\treturn $this;\n\t}", "public function where($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->where = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "public function\r\n add_conditions_to_where_clause(\r\n $conditions\r\n );", "public function where(): Where\n {\n if (!isset($this->where)){\n $this->where = new Query\\Where($this, $this->driver, $this->topQuery);\n }\n return $this->where; \n }", "public function custom_where( $where = '' ){\n\n\n\t// make sure to change your meta_key to whatever you saved your user_id as here mine is _restricted_to\n\n\t\tglobal $wpdb;\n\t\t$user_id = get_current_user_id();\n\n\t\t$where .= \" OR (( $wpdb->postmeta.meta_key = '_bcit_wpd_show_product' and $wpdb->postmeta.meta_value = $user_id ))\";\n\n\t\tremove_filter( 'posts_where', array( $this, 'custom_where' ) );\n\n\t\treturn $where;\n\n\t}", "public function getWhere() {\r\n return $this->_where;\r\n }", "protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "function setWhere($where) {\n $this->where = $where;\n }", "abstract public function where(array $where);", "public static function where(array $where);", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "function where($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['where'])) $this->query['where'] = array();\n\t$this->query['where'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function filter_where($where = '') {\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-30 days')) . \"'\";\n return $where;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function where($where) \n {\n if ($where == null) {\n throw new DataSetException(\"null not allowed for where clause\");\n } \n $this->where = $where;\n return $this;\n }", "function getWhere() {\n return $this->where;\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function where($condition)\n {\n //@TODO: implement possibility to accept key/value pairs array and quote/escape values\n $this->appendWhereString($condition);\n return $this;\n }", "protected function getWhereClause(array $where)\n {\n if (empty($where)) {\n return '';\n }\n\n $conditions = [];\n foreach ($where as $field => $value) {\n if (is_null($value)) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"$field = '$value'\";\n }\n\n return 'WHERE ' . implode(' AND ', $conditions);\n }", "public function getWhere() {\n return $this->_where ?: new Predicate(Predicate::ALSO);\n }", "protected function _setWhere(&$sql, $where, $whereValues) {\n\t\t\n\t\tif (!is_null($where)) $sql.= ' WHERE ' . $where;\n\t}", "protected abstract function getWhereClause(array $conditions);", "public function getWhereClauseCondition() {\n\n if (isset($this->whereClauseCondition)) {\n $setCondition = $this->whereClauseCondition;\n return $setCondition;\n } else {\n $defaultCondition = \"=\";\n return $defaultCondition;\n }\n }", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "public function whereParenWrap() {\n $where = $this->_dqlParts['where'];\n if (count($where) > 0) {\n array_unshift($where, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function where($whereClause = null)\r\n\t\t{\r\n\t\t\tif($whereClause != null and $whereClause != 'false'){\r\n\t\t\t\tif($this->_where != '') $this->_where .= ' ' . $whereClause;\r\n\t\t\t\telse $this->_where = ' WHERE ' . $whereClause;\r\n\t\t\t}\r\n\t\t\telse if($whereClause == 'false'){\r\n\t\t\t\t//this is used as a bypass on some methods\r\n\t\t\t\t$this->_where = 'false';\r\n\t\t\t}\r\n\t\t\treturn $this;\r\n\t\t}", "public function where()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n $this->addToBindings($bindings);\n $this->wheres[] = $sql;\n\n return $this;\n }", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "function wpfc_temp_filter_where( $where = '' ) {\n\t \t$where .= \" AND post_date >= '\".date(\"Y-m-d\", $_REQUEST['start']).\"' AND post_date < '\".date(\"Y-m-d\", $_REQUEST['end']).\"'\";\n\t \treturn $where;\n\t }", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "protected function checkIfWhere($where){\n\t\t\tif($where){//if this where is set, use it\n\t\t\t\t$this->where($where);\n\t\t\t}\n\t\t\tif(!$this->where){//check if where condition is set, use default if not\n\t\t\t\t$this->where(true);//Default where uses the id\n\t\t\t}\n\t\t}", "public function getWhere()\n\t{\n\t\tif(empty($this->sWhere))\n\t\t{\n\t\t\treturn 'TRUE';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->sWhere;\n\t\t}\n\t}", "public function where($condition = [])\n {\n $this->_query->addQuery(\" WHERE \");\n foreach ($condition as $key => $value) {\n if (is_array($value)) {\n $item = each($value);\n $this->_query->addQuery(\"`{$item['key']}` = '{$item['value']}'\");\n } else {\n $this->_query->addQuery(\" {$value} \");\n }\n }\n\n return $this;\n }", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "public function where()\n {\n return $this->query; \n }", "public function where(array $condition): self\n {\n $this->where = array_merge_recursive($this->where, $condition);\n return $this;\n }", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function modifyWhere(&$sql, $table = 'listings')\n {\n if (!$this->geo_filter_data['applied_location']\n || !$this->geo_filter_data['is_filtering']\n ) {\n return;\n }\n\n if (!$sql) {\n $sql = &$GLOBALS['sql'];\n }\n\n $data_key = $table == 'accounts' ? 'location_account_fields' : 'location_listing_fields';\n $data = $this->geo_filter_data[$data_key];\n\n // Return if location search already performed from the search form\n if (strpos($sql, key($this->geo_filter_data[$data_key]))) {\n return;\n }\n\n foreach ($data as $field => $value) {\n if ($value) {\n $sql .= \"AND `T1`.`{$field}` = '{$value}' \";\n }\n }\n }", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "public function where(array $condition)\n {\n if (empty($condition)) {\n $this->where_str = '1=1';\n return $this;\n }\n $this->where_str = $this->buildWhereStr($condition);\n return $this;\n }", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "protected function whereBasic(Builder $builder, $where): string\n {\n $operator = str_replace('?', '??', $where['operator']);\n $value = $this->parameter($where['value']);\n \n return $this->wrap($where['column']).' '.$operator.' '.$value;\n }", "protected function constructWhere($where)\n {\n if (is_array($where)) {\n $equals = array();\n \n foreach ($where as $column => $value) {\n $equals[] = new Equal($column, $value);\n }\n\n $this->where = new Where(new AndOperator($equals));\n } else {\n $this->where = new Where($where);\n }\n }", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "protected function where(array $filter){\n if (array_key_exists(\"order\", $filter)){\n $order = $filter[\"order\"];\n unset($filter[\"order\"]);\n if (gettype($order) != \"array\")\n $order = [$order];\n }\n\n if (array_key_exists(\"limit\", $filter)){\n $limit = $filter[\"limit\"];\n unset($filter[\"limit\"]);\n if (gettype($limit) != \"integer\")\n throw new appException(\"This is off-limits, literally\");\n }\n\n if (!empty($filter)){\n $query = \" WHERE \";\n\n foreach ($filter as $k => $v){\n if (gettype($v) == \"array\"){\n $query .= $this->genTableVar($k) . \" IN ( \";\n $query .= join(\", \", array_fill(0, count($v), \"?\"));\n $query .= \") AND \";\n }\n else if (gettype($v) == \"object\" && get_class($v) == \"dbContains\"){\n $query .= $v->genSql($this->genTableVar($k)) . \" AND \";\n }\n else {\n $query .= $this->genTableVar($k) . \" = ? AND \";\n }\n $this->args[] = $v;\n }\n\n $query = substr($query, 0, -4);\n\n $this->query .= $query;\n }\n\n if (isset($order))\n $this->orderBy($order);\n\n if (isset($limit))\n $this->limit($limit);\n }", "public function whereSQL($whereSqlStatement){\n $this->debugBacktrace();\n $this->whereClause = $whereSqlStatement;\n return $this;\n }", "public function where($condition, $operator = 'AND') {\n if ($condition === ')' || substr(end($this->where), -1) == '(') {\n $this->where[] = $condition;\n } else {\n $this->where[] = (count($this->where) > 0 ? ($operator . ' ') : 'WHERE ' ) . $condition;\n }\n return $this;\n }", "public function setCondition(\\GoetasWebservices\\Client\\SalesforceEnterprise\\Types\\SoqlWhereConditionType $condition)\n {\n $this->condition = $condition;\n return $this;\n }", "public function addWhere(Expression $expression, $type = AbstractSearchQuery::WHERE_AND);", "public function where($sql)\n {\n $this->where[] = call_user_func_array('self::clause', func_get_args());\n return $this;\n }", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "final public function addWhere(YMKM_SQL_Entity_Where $s)\n {\n $this->doAddWhere($s);\n return $this;\n }", "protected function _whereCondition($condition) \n\t{\n\t\t$result = 'WHERE ';\n\n\t\tforeach ($condition as $key => $value) {\n\t\t\tif (in_array($key, $this->_fields)) {\n\t\t\t\tif (!is_array($value)) {\n\t\t\t\t\t$this->_stringData($condition);\n\t\t\t\t\t$result .= \"`\" . $key . \"`=\" . $value. ' AND ';\n\t\t\t\t} else {\n\t\t\t\t\t$result .= $this->_moreWhere($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//substr last 'and'\n\t\t$result = substr($result, 0, -5);\n\n\t\treturn $result;\n\t}", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "function whereAdd($where,$clause)\n{\n\tif(!strlen($clause))\n\t\treturn $where;\n\tif(!strlen($where))\n\t\treturn $clause;\n\treturn \"(\".$where.\") and (\".$clause.\")\";\n}", "protected function whereBasic(Builder $query, $where)\n {\n $value = $this->parameter($where);\n\n return $this->wrap($where['column']).' '.$where['operator'].' '.$value;\n }", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "protected function _compile_wh($where) {\n\t\tif (is_array($where) && count($where) > 0) {\n\t\t\t$statements = array();\n\t\t\tforeach ($where as $key => $val) {\n\t\t\t\t// Get Operator\n\t\t\t\tif ($this->_has_operator($key)) {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' ' . $this->_get_operator($key) . ' ' . $this->escape($val);\n\t\t\t\t} else {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' = ' . $this->escape($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = ' WHERE ' . implode(' AND ', $statements);\n\n\t\t\treturn $query;\n\t\t} elseif (is_string($where)) {\n\t\t\treturn ' WHERE ' . $where;\n\t\t}\n\n\t\treturn '';\n\t}", "public function where($field, $value) {\n\t$this->parseQuery->where($field, $value);\n }" ]
[ "0.78910625", "0.76765877", "0.7663459", "0.765224", "0.75993776", "0.7271149", "0.7229185", "0.71034646", "0.70979583", "0.7089293", "0.6986254", "0.69830674", "0.6975479", "0.69719946", "0.6942605", "0.689974", "0.6883744", "0.6872269", "0.68642986", "0.6850534", "0.6848748", "0.6848748", "0.68209535", "0.67995626", "0.6791677", "0.67879736", "0.67808086", "0.6773078", "0.6730418", "0.67269367", "0.66979635", "0.66742676", "0.6670759", "0.66575444", "0.6653406", "0.6647036", "0.6644427", "0.6643885", "0.6632063", "0.6617848", "0.6614901", "0.6610593", "0.66044843", "0.65958524", "0.65690094", "0.6546025", "0.6520022", "0.6500613", "0.65001786", "0.64864486", "0.64850515", "0.6479522", "0.6474644", "0.64693534", "0.6468546", "0.6461856", "0.6454203", "0.64472246", "0.6434324", "0.64284", "0.6425921", "0.64101225", "0.63968503", "0.6394747", "0.63721424", "0.63644737", "0.6362042", "0.6361266", "0.63563114", "0.63551664", "0.6353084", "0.63519883", "0.63470966", "0.6338742", "0.6331667", "0.6319869", "0.6319347", "0.6317137", "0.6316927", "0.6312744", "0.6312735", "0.6308701", "0.63060796", "0.6305763", "0.63011104", "0.62996435", "0.62930864", "0.6288948", "0.62853473", "0.6281639", "0.628107", "0.62806535", "0.627529", "0.6275036", "0.6272399", "0.62394583", "0.6234012", "0.62304384", "0.6227157", "0.6212109", "0.6201498" ]
0.0
-1
Add a "where" within boolean operator "or" and denying the condition to the query.
public function or_where_not($query, $params = array()) { return $this->where_not( $query, $params, 'or'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "public function orWhereComplex()\n {\n return $this->addComplexCondition('or', $this->conditions);\n }", "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }", "public function orWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_OR) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_OR, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public function addWhereOr($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'OR ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function orWhere()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('or', $column, $comparison, $value);\r\n \r\n return $this;\r\n }", "public function orWhere() {\r\n\t\t$args = func_get_args();\r\n\t\tif (count($this->_wheres)) {\r\n\t\t\t$criteria = call_user_func_array(array($this->_wheres[count($this->_wheres)- 1], 'orWhere'), $args);\r\n\t\t} else {\r\n\t\t\t$statement = array_shift($args);\r\n\t\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t\t$this->_wheres[] = $criteria;\r\n\t\t}\r\n\t\treturn $criteria;\r\n\t}", "public function orWhere()\n {\n if ( func_num_args() == 2 )\n {\n list($field, $value) = func_get_args();\n $op = '=';\n }\n else\n {\n list($field, $op, $value) = func_get_args();\n }\n $this->appendWhere('OR', $field, $op, $value); \n return $this;\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function orClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'OR', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }", "public function testBuildWhereOnlyOr()\n {\n $query = $this->getQuery()\n ->whereOr(\n $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->where('is_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE (table1.id = '100' OR table1.is_admin = '1')\",\n $query->buildWhere()\n );\n }", "protected function user_where_clause() {}", "public function or_where_close()\n {\n $this->_where[] = array('OR' => ')');\n return $this;\n }", "public function orWhere($where, $params = array()) {\n parent::orWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "public function testBuildWhereWithOr()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where('is_super_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR is_super_admin = '1')\",\n $query->buildWhere()\n );\n }", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public function orWhere($where): QueryBuilderInterface;", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function orWhere($column, $operator = null, $value = null);", "public function orWhere($table,$column,$data = \"\");", "protected function getWhereClause() {}", "public function whereOr($value) {\n\t$this->parseQuery->where('$or', $value);\n }", "public function testBuildWhereWithOrComplex()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where(\n $this->getQuery()\n ->where('is_super_admin', 1)\n ->where('can_be_super_admin', 1)\n )\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR (is_super_admin = '1' AND can_be_super_admin = '1'))\",\n $query->buildWhere()\n );\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function or_where_open()\n {\n $this->_where[] = array('OR' => '(');\n\n return $this;\n }", "public function orWhere($column, $value = false, $operator = '=')\n {\n\t\treturn $this->condition($column, $value, $operator, 'OR', 'where');\n\t}", "private function mergeOrWhere(){\n $wheres = $this->orWheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" OR \";\n }\n return rtrim($whereString, \" OR \");\n }", "protected function getGeneralWhereClause() {}", "public function orWhereIf($where, $params = array()) {\n return empty($where)\n ? $this\n : $this->orWhere($where, $params);\n }", "public function orWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function orWhere($field, $operator, $value);", "public function whereOrQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('OR', $subQuery);\r\n\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "function or_where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'OR ', $escape);\r\n\t}", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function orWhere($data, $conditional = 'AND') {\n\n\t \t$fields = count($data);\n\t\t\t$i = 0;\n\n\t\t\tif(is_null($this->_where)) {\n\t\t\t\t$this->_where = ' WHERE ';\n\t\t\t} else {\n\t\t\t\t$this->_where .= \" $conditional \";\n\t\t\t}\n\n\t\t\tif($fields < 2) {\n\t\t\t\tthrow new Exception('Para utlizar o metodo orWhere é necessário pelo menos 2 clausulas');\n\t\t\t}\n\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$newKey = ':'.$key;\n\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\tif($i == 0) {\n\t\t\t\t\t$this->_where .= '(' . $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t} else if ( $i+1 == $fields) {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ')';\n\t\t\t\t} else {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\treturn $this;\n\t }", "public function orWhere(...$args)\n {\n $this->addCondition('or', $args, $this->conditions);\n return $this;\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function orWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'orWhere'), func_get_args());\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function custom_where( $where = '' ){\n\n\n\t// make sure to change your meta_key to whatever you saved your user_id as here mine is _restricted_to\n\n\t\tglobal $wpdb;\n\t\t$user_id = get_current_user_id();\n\n\t\t$where .= \" OR (( $wpdb->postmeta.meta_key = '_bcit_wpd_show_product' and $wpdb->postmeta.meta_value = $user_id ))\";\n\n\t\tremove_filter( 'posts_where', array( $this, 'custom_where' ) );\n\n\t\treturn $where;\n\n\t}", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function useOr()\n {\n $this->imploder = ' OR ';\n }", "public function hasOrWhere()\n {\n return $this->_has('_orWhere');\n }", "public function and_where_close()\n {\n $this->_where[] = array('AND' => ')');\n return $this;\n }", "public function orConditions($data = array()) {\r\n $filter = $data['filter'];\r\n $condition = array(\r\n 'OR' => array(\r\n $this->alias . '.title LIKE' => '%' . $filter . '%',\r\n $this->alias . '.body LIKE' => '%' . $filter . '%',\r\n )\r\n );\r\n return $condition;\r\n }", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function orWhere($operand, $operatorOrValue=null, $value=null);", "private function setWhere(QueryBuilder $qb)\n {\n // global filtering\n if (isset($this->requestParams['search']) && '' != $this->requestParams['search']['value']) {\n $globalSearch = $this->requestParams['search']['value'];\n\n $orExpr = $qb->expr()->orX();\n $globalSearchType = $this->options->getGlobalSearchType();\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n $searchType = $globalSearchType;\n $searchField = $this->searchColumns[$key];\n // Subqueries and arithmetics fields can't be search with LIKE\n if ($column->isCustomDql() && ('string' != $column->getTypeOfField()) || preg_match('/SELECT .+ FROM .+/', $searchField)) {\n if (!is_numeric($globalSearch)) {\n continue;\n }\n $globalSearch = floatval($globalSearch);\n switch ($searchType) {\n case 'like':\n $searchType = 'eq';\n break;\n case 'notLike':\n $searchType = 'neq';\n break;\n }\n }\n $this->setOrExpression($orExpr, $qb, $searchType, $searchField, $globalSearch, $key);\n }\n }\n\n if ($orExpr->count() > 0) {\n $qb->andWhere($orExpr);\n }\n }\n\n // individual filtering\n if (true === $this->accessor->getValue($this->options, 'individualFiltering')) {\n $andExpr = $qb->expr()->andX();\n\n $parameterCounter = DatatableQueryBuilder::INIT_PARAMETER_COUNTER;\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n if (false === array_key_exists($key, $this->requestParams['columns'])) {\n continue;\n }\n\n $searchValue = $this->requestParams['columns'][$key]['search']['value'];\n\n if ('' != $searchValue && 'null' != $searchValue) {\n /** @var FilterInterface $filter */\n $filter = $this->accessor->getValue($column, 'filter');\n $searchField = $this->searchColumns[$key];\n $andExpr = $filter->addAndExpression($andExpr, $qb, $searchField, $searchValue, $parameterCounter);\n }\n }\n }\n\n if ($andExpr->count() > 0) {\n $qb->andWhere($andExpr);\n }\n }\n\n return $this;\n }", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "public function orWhere($condition) {\n return $this->where($condition, 'OR');\n }", "public function orWhereClose()\n\t{\n\t\treturn $this->whereClose();\n\t}", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function or_where($query, $params = array(), $not = false)\r\n {\r\n return $this->where($query, $params, 'or', $not);\r\n }", "public function orwhere($column, $sign = null, $value = null)\n {\n if ($this->initwhereclause)\n return $this->where($column, $sign, $value, 'or');\n else\n return $this->where($column, $sign, $value, 'where');\n }", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "public function rawOrWhere($where, $bindings = array())\n\t{\n\t\treturn $this->rawWhere($where, $bindings, 'OR');\n\t}", "public function orWhereOpen()\n\t{\n\t\t$this->where[] = array(\n\t\t\t'type' => 'or',\n\t\t\t'nesting' => 'open',\n\t\t);\n\n\t\treturn $this;\n\t}", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function or_where($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_where', $key, $value, 'OR ', $escape);\n\t}", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function or_where($column, $op = null, $value = null)\n {\n if (is_array($column))\n {\n foreach ($column as $key => $val)\n {\n if (is_array($val))\n {\n $this->or_where($val[0], $val[1], $val[2]);\n }\n else\n {\n $this->or_where($key, '=', $val);\n }\n }\n }\n else\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n $this->_where[] = array('OR' => array($column, $op, $value));\n }\n\n return $this;\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "public function orWhere($column, $operator = null, $value = null)\n\t{\n\t\treturn $this->where($column, $operator, $value, 'OR');\n\t}", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function orWhere(...$conditions)\n {\n $this->where(...$conditions);\n return $this;\n }", "public function havingOR()\n {\n $this->having .= \" OR \";\n }", "public function orNotWhereOpen()\n\t{\n\t\t$this->where[] = array(\n\t\t\t'type' => 'or',\n\t\t\t'not' => true,\n\t\t\t'nesting' => 'open',\n\t\t);\n\n\t\treturn $this;\n\t}", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "protected function parseWhere($where) {\n\t\t$parser = new Parser();\n\t\t$expr = str_replace(array(' and ', ' AND ', ' or ', ' OR '), array(' && ', ' && ', ' || ', ' || '), $where);\n\t\t$expr = $parser->parse($expr);\n\t\t$tokens = $expr->get();\n\t\t$conditions = array();\n\t\t$expression = array();\n\t\t$npar = 0;\n\t\t$condition = (object)array(\n\t\t\t'operand' => '',\n\t\t\t'operator' => '',\n\t\t\t'value' => '',\n\t\t\t'inoperand' => false,\n\t\t\t'invalue' => false,\n\t\t\t'infunction' => false\n\t\t);\n\t\tforeach ($tokens as $token) {\n\t\t\tif ($condition->infunction) {\n\t\t\t\tif ($token->type == Token::T_POPEN) {\n\t\t\t\t\t$npar++;\n\t\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\t\t$npar--;\n\t\t\t\t\tif ($npar == 0) {\n\t\t\t\t\t\t$condition->infunction = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->type == Token::T_FUNCTION) {\n\t\t\t\t$condition->infunction = true;\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->isComparator()) {\n\t\t\t\t$condition->operator = $token->value;\n\t\t\t\t$condition->inoperand = false;\n\t\t\t\t$condition->invalue = true;\n\t\t\t} else if ($token->type == Token::T_POPEN) {\n\t\t\t\tif ($condition->inoperand) {\n\t\t\t\t\t$condition->operand .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else if ($condition->invalue) {\n\t\t\t\t\t$condition->value .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else {\n\t\t\t\t\t$expression[] = $token->value;\n\t\t\t\t}\n\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->value;\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else if ($token->type == Token::T_LOGICAL_AND || $token->type == Token::T_LOGICAL_OR) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->type == Token::T_LOGICAL_AND ? 'and' : 'or';\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else {\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t}\n\t\t}\n\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t}\n\t\treturn (object)array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'expression' => $expression\n\t\t);\n\t}", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "private function sql_whereAnd_sysLanguage()\n {\n if ( !isset( $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ] ) )\n {\n return;\n }\n\n $languageField = $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ];\n $languageId = $GLOBALS[ 'TSFE' ]->sys_language_content;\n\n // DRS :TODO:\n if ( $this->pObj->b_drs_devTodo )\n {\n $prompt = '$this->int_localisation_mode PI1_SELECTED_OR_DEFAULT_LANGUAGE: for each language a query!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n\n switch ( $this->int_localisation_mode )\n {\n case( PI1_DEFAULT_LANGUAGE ):\n $andWhere = \" AND \" . $languageField . \" <= 0 \";\n break;\n case( PI1_SELECTED_OR_DEFAULT_LANGUAGE ):\n $andWhere = \" AND ( \" .\n $languageField . \" <= 0 OR \" .\n $languageField . \" = \" . intval( $languageId ) .\n \" ) \";\n break;\n case( PI1_SELECTED_LANGUAGE_ONLY ):\n $andWhere = \" AND \" . $languageField . \" = \" . intval( $languageId ) . \" \";\n break;\n default:\n $andWhere = null;\n break;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function orWhereAcf(...$args)\n {\n $this->addAcfCondition('or', $args, $this->conditions);\n return $this;\n }", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "public function orWhere($column, $operator = null, $value = null)\n {\n return $this->where($column, $operator, $value, 'or');\n }", "function searchwp_query_where() {\n\t\tglobal $wpdb;\n\n\t\t$sql = '';\n\n\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t$this->get_woocommerce_ordering();\n\t\t}\n\n\t\tif ( $this->is_woocommerce_search() && ! empty( $this->ordering ) ) {\n\t\t\t// ratings need moar SQL\n\t\t\tif ( 'rating' === $this->ordering['wc_orderby'] ) {\n\t\t\t\t$sql = \" AND ( swpwpcommeta.meta_key = 'rating' OR swpwpcommeta.meta_key IS null ) \";\n\t\t\t}\n\t\t}\n\n\t\t// Pre WooCommerce 3.0: use meta to limit visibility\n\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '3.0.0', '<' ) ) {\n\t\t\tif ( $this->is_woocommerce_search() ) {\n\t\t\t\t// visibility\n\t\t\t\tif ( apply_filters( 'searchwp_woocommerce_consider_visibility', true ) ) {\n\t\t\t\t\tif ( apply_filters( 'searchwp_woocommerce_consider_visibility_variations', true ) ) {\n\t\t\t\t\t\t$sql .= \" AND ( ( {$wpdb->prefix}posts.post_type = 'product_variation' OR ( woovisibility.meta_key = '_visibility' AND CAST( woovisibility.meta_value AS CHAR ) IN ( 'visible', 'search' ) ) ) ) \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" AND ( ( woovisibility.meta_key = '_visibility' AND CAST( woovisibility.meta_value AS CHAR ) IN ( 'visible', 'search' ) ) ) \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function getOrWhere($name = null)\n {\n return $this->_get('_orWhere', $name);\n }", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function whereParenWrap() {\n $where = $this->_dqlParts['where'];\n if (count($where) > 0) {\n array_unshift($where, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "protected function checkIfWhere($where){\n\t\t\tif($where){//if this where is set, use it\n\t\t\t\t$this->where($where);\n\t\t\t}\n\t\t\tif(!$this->where){//check if where condition is set, use default if not\n\t\t\t\t$this->where(true);//Default where uses the id\n\t\t\t}\n\t\t}", "public function orCondition($first, $operator, $second)\n\t{\n\t\t$this->_query['orCondition'] = (object)array(\n\t\t\t'first' => $first,\n\t\t\t'operator' => $operator,\n\t\t\t'second' => $second\n\t\t);\n\n\t\treturn $this;\n\t}", "final public static function or($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' OR ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' OR ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function orFilter($column, $operator = '=', $value = null): Builder\n {\n [$value, $operator] = $this->prepareValueAndOperator(\n $value, $operator, func_num_args() === 2\n );\n\n return $this->addFilter($column, $operator, $value, 'or');\n }", "public function joinOnOrQuery(Query $other, Query $whereQuery) {\r\n\t\t$this->addJoinOnQuery('OR', $other, $whereQuery);\r\n\t}", "public function orWhere($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "public function andWhereIf($where, $params = array()) {\n return empty($where)\n ? $this\n : $this->andWhere($where, $params);\n }", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "public function whereLessThanOrEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERELTE][$field] = [self::OPERATORS['lte'] => $value];\n return $this;\n }", "public function orWhereRaw(/*# string */ $rawString, array $params = []);", "public function orWhereNotEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => [self::OPERATORS['ne'] => $value]]);\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "protected function addWhereFilter($field, $value) {\n if($this->filterType == 'orWhere') {\n $this->builder = $this->builder->orWhere($field, $value);\n }else {\n $this->builder = $this->builder->where($field, $value);\n $this->filterType = 'orWhere';\n }\n }", "abstract public function where(array $where);" ]
[ "0.78135026", "0.7601737", "0.76008004", "0.74656075", "0.74417406", "0.73439676", "0.7316224", "0.72541165", "0.7252718", "0.72447145", "0.7190623", "0.7188072", "0.7164747", "0.715921", "0.71496964", "0.7103452", "0.7068545", "0.7050863", "0.7037747", "0.7036506", "0.69878846", "0.6978915", "0.6973784", "0.6970677", "0.69305897", "0.6884999", "0.6854965", "0.68420905", "0.6842062", "0.6839513", "0.6783096", "0.6777187", "0.67491466", "0.67413706", "0.6720924", "0.6705778", "0.6692477", "0.6653996", "0.66527677", "0.6644085", "0.66421443", "0.66160667", "0.6593588", "0.6585495", "0.65604717", "0.6559755", "0.6546226", "0.65447587", "0.6544743", "0.6537141", "0.65252167", "0.65086055", "0.6487495", "0.64831084", "0.64744735", "0.6469644", "0.6451424", "0.644717", "0.644626", "0.644322", "0.64386314", "0.64359283", "0.6423925", "0.6423266", "0.64179695", "0.6397173", "0.63860774", "0.6381724", "0.6375098", "0.6368346", "0.63668066", "0.6356702", "0.63503397", "0.6349496", "0.63491905", "0.6346105", "0.63319635", "0.6322939", "0.63085", "0.6308388", "0.62948185", "0.6275339", "0.62703454", "0.625719", "0.6252899", "0.62424684", "0.6239316", "0.6224228", "0.6223783", "0.6221746", "0.6212003", "0.6207501", "0.6205928", "0.6205677", "0.6202774", "0.6197639", "0.619702", "0.6190952", "0.61908686", "0.61807716", "0.6179357" ]
0.0
-1
Add a "like" condition.
public function like($column, $value, $boolean = 'and', $not = false) { $operator = $not ? 'not like' : 'like'; return $this->where(implode(' ', array($column, $operator, '?')), array($value), $boolean); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function like($value);", "public function likeCond(string $field, string $likeCond, string $connector = \"=\", bool $not = false);", "function like ($value) {\n return ' like \\''.$value.'\\'';\n }", "public function like($column,$data,$wildCardPlacement);", "public function whereLike($table, $column, $value);", "public function like($stringWithWildCardCharacter){\n $this->debugBacktrace();\n\n $value = $this->_real_escape_string($stringWithWildCardCharacter);\n\n if($this->last_call_where_or_having == \"where\"){\n $this->whereClause .= \" LIKE $value\";\n }\n else{\n $this->havingClause .= \" LIKE $value\";\n }\n return $this;\n }", "function LikeWhereClause ($field, $value)\n\t{\n\t\t$this->field = $field;\n\t\t$this->regexp = '/^' . str_replace('%','.*', preg_quote($value)) . '$/i';\n\t}", "public function buildLike() {\n\t\t$params = func_get_args();\n\n\t\tif ( count( $params ) > 0 && is_array( $params[0] ) ) {\n\t\t\t$params = $params[0];\n\t\t}\n\n\t\t$s = '';\n\n\t\tforeach ( $params as $value ) {\n\t\t\tif ( $value instanceof LikeMatch ) {\n\t\t\t\t$s .= $value->toString();\n\t\t\t} else {\n\t\t\t\t$s .= $this->escapeLikeInternal( $value );\n\t\t\t}\n\t\t}\n\n\t\treturn \" LIKE '\" . $s . \"' \";\n\t}", "public function getLike($likeString);", "public\r\n\tfunction buildLike( $string ) {\r\n\t\treturn $string . '%';\r\n\t}", "public function orLike($column,$data,$wildCardPlacement);", "abstract protected function platformPrepareLikeStatement(\n $prefix = null,\n $column,\n $not = null,\n $bind,\n $caseSensitive = false\n );", "function buildLikeClause($requestKey, $columnName, array &$params, array &$clauses) {\n if (isset($_GET[$requestKey])) {\n $val = trim($_GET[$requestKey]);\n if (strlen($val)) {\n $clauses[] = \"$columnName like concat('%', ?, '%')\";\n $params[] = addcslashes($val, '%_');\n }\n }\n}", "public function getLikeOperator()\n {\n $grammar = $this->query->getGrammar();\n\n if ($grammar instanceof PostgresGrammar) {\n return 'ilike';\n }\n\n return 'like';\n }", "public function like($field, $match = '', $wildcard = 'BOTH', $caseSensitive = true, $escape = null)\n {\n return $this->prepareLikeStatement($field, $match, 'AND ', $wildcard, '', $caseSensitive, $escape);\n }", "public function like(string $column, $value = null, $and = true)\n {\n return $and ? $this->and($column, 'like', $value) : $this->or($column, 'like', $value);\n }", "function title_like_posts_where( $where, $wp_query ) {\n global $wpdb;\n if ( $post_title_like = $wp_query->get( 'post_title_like' ) ) {\n $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \\'%' . esc_sql( $wpdb->esc_like( $post_title_like ) ) . '%\\'';\n }\n return $where;\n}", "public function bindLikeValue($value)\n {\n return '%' . $value . '%';\n }", "function like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'AND ', $side);\r\n\t}", "public function like(string $field, $value): self\n {\n return $this->add($field, $value, self::LIKE);\n }", "public function like( $value ) {\n $this->_action = 'LIKE';\n $this->_value = $value;\n\n return $this;\n }", "protected function platformPrepareLikeStatement(\n $prefix = null,\n $column,\n $not = null,\n $bind,\n $caseSensitive = false\n ) {\n $likeStatement = \"{$prefix} {$column} {$not} LIKE :{$bind}\";\n\n if ($caseSensitive === true) {\n $likeStatement = \"{$prefix} LOWER({$column}) {$not} LIKE :{$bind}\";\n }\n\n return $likeStatement;\n }", "function like($str, $searchTerm)\n {\n $searchTerm = strtolower($searchTerm);\n $str = strtolower($_SESSION['username']);\n $pos = strpos($str, $searchTerm);\n if ($pos === false)\n return false;\n else\n return true;\n }", "public function like(string $field = '', string $regex = '', string $flags = 'i', bool $enable_start_wildcard = TRUE, bool $enable_end_wildcard = TRUE): self\n\t{\n\t\tif ($field != '')\n\t\t{\n\t\t\t$this->push_where_field($field, $this->regex($regex, $flags, $enable_start_wildcard, $enable_end_wildcard));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('At least 1 argument should be passed to method — field name', __METHOD__);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function like($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _LIKE, $y, $and, ...$args);\n return $expression;\n }", "function like($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _LIKE, $y, $and, ...$args);\n return $expression;\n }", "function like($pattern, $subject)\t{\n\t\t$pattern = str_replace('%', '.*', preg_quote($pattern));\n\t\treturn (bool) preg_match(\"/^{$pattern}$/i\", $subject);\n\t}", "public function like($field, $match = '', $side = 'both', $escape = NULL)\n\t{\n\t\treturn $this->_like($field, $match, 'AND ', $side, '', $escape);\n\t}", "public function searchLike($searchField, $value)\n {\n return \" UPPER($searchField) LIKE UPPER('%{$value}%') \";\n }", "protected function addCondition($query, $attribute, $partialMatch = false)\n{\n if (($pos = strrpos($attribute, '.')) !== false) {\n $modelAttribute = substr($attribute, $pos + 1);\n } else {\n $modelAttribute = $attribute;\n }\n \n $value = $this->$modelAttribute;\n if (trim($value) === '') {\n return;\n }\n \n \n if ($partialMatch) {\n $query->andWhere(['like', $attribute, $value]);\n } else {\n $query->andWhere([$attribute => $value]);\n }\n}", "public function anyString() {\n\t\treturn new LikeMatch( '%' );\n\t}", "public function getLike($likeString){\r\n\t\t$sql = 'SELECT * '.\r\n\t\t'FROM contenidos '.\r\n\t\t'WHERE nombre LIKE ? '.\r\n\t\t'LIMIT 10';\r\n\t\t\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setString($likeString.'%');\r\n\t\t\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public function like($fieldCondition, $value = null, $joiner = 'AND') {\r\n if( $value === null ) {\r\n $value = $fieldCondition;\r\n $fieldCondition = $this->sqlTmpField;\r\n }\r\n $value = $this->addQuotes($value);\r\n $value = sprintf('LIKE %s', $value);\r\n $this->where($fieldCondition, $value, $joiner, false);\r\n return $this;\r\n }", "function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '')\r\n\t{\r\n\t\tif ( ! is_array($field))\r\n\t\t{\r\n\t\t\t$field = array($field => $match);\r\n\t\t}\r\n\r\n\t\t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\tforeach ($field as $k => $v)\r\n\t\t\t{\r\n\t\t\t\t$field[$this->table . '.' . $k] = $v;\r\n\t\t\t\tunset($field[$k]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->db->_like($field, $match, $type, $side, $not);\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function orWhereLike($column, $value)\n {\n try {\n if (!is_null($this->query)) {\n $this->query .= ' OR '.$column. ' LIKE \"'.$value.'\"';\n return $this;\n }\n\n } catch (\\Exception $exception) {\n var_dump($exception->getMessage());\n }\n }", "private static function _parse_condition_like($params, $not, &$prepared_values)\n\t{\n\t\tif (count($params) < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$type = $params[3] ?? null;\n\t\t$val = self::_convert_data($params[2], $type, $prepared_values);\n\t\t$result = \"LIKE {$val}\";\n\t\tif ($not)\n\t\t{\n\t\t\t$result = 'NOT ' . $result;\n\t\t}\n\t\treturn $result;\n\t}", "public static function escapeLikePattern($text){\r\n\t\t\t$text = str_replace('\\\\', '', $text);//apparently a backslash is ignored when using the LIKE operator\r\n\t\t\t$text = self::escape($text);\r\n\t\t\tif($text !==false){\r\n\t\t\t\t$text = str_replace('%', '\\%', $text);\r\n\t\t\t\t$text = str_replace('_', '\\_', $text);\r\n\t\t\t\tif(mb_strlen($text)>=3) $text .= '%';\r\n\t\t\t}\r\n\t\t\treturn $text;\r\n\t\t}", "function or_like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'OR ', $side);\r\n\t}", "public static function safe_sql_like($string){\n global $wpdb;\n\n // safe\n $string = $wpdb->prepare(\"%s\", $string);\n // trim '\n $tmp = explode(\"'\", $string);\n array_shift($tmp);\n array_pop($tmp);\n $string = implode(\"'\", $tmp);\n\n // Safe for LIKE'...'\n $string = str_replace( array(\"%\", \"[\", \"]\", \"^\", \"_\"), array(\"\\%\", \"\\[\", \"\\]\", \"\\^\", \"\\_\"), $string);\n\n return $string;\n }", "public static function like(mixed $subject, mixed $pattern): bool\n {\n return like($subject, $pattern);\n }", "public function filterTextLike(GetFilterConditionEvent $event)\n {\n $qb = $event->getQueryBuilder();\n $expr = $event->getFilterQuery()->getExpressionBuilder();\n $values = $event->getValues();\n if ('' !== $values['value'] && null !== $values['value']) {\n if (isset($values['condition_pattern'])) {\n $qb->andWhere($expr->stringLike($event->getField(), \"%\" . $values['value'] . \"%\", $values['condition_pattern']));\n } else {\n $qb->andWhere($expr->stringLike($event->getField(), \"%\" . $values['value'] . \"%\"));\n }\n }\n }", "public function escapeLike($string);", "public function __contains ( $sField, $mValue )\n {\n // There's a standard way to force case sensitive LIKE ???\n return \"$sField LIKE $mValue\";\n }", "public function like($value)\n {\n $term = '/.*' . $value . '.*/i';\n return $this->regex($term);\n }", "public function ilike(string $field, $value): self\n {\n return $this->add($field, $value, self::ILIKE);\n }", "private function searchUsingLike(string $username)\n {\n $exactMatches = static::where($this->getUsernameColumnName(), $username)->get();\n\n if ($exactMatches) {\n return static::where($this->getUsernameColumnName(), 'LIKE', $username.'%')->get();\n }\n\n return $exactMatches;\n }", "public static function like(string $column, $value, ?string $wildcard = null, bool $not = false): Condition\n {\n $self = (new Condition())->column($column);\n return $not ? $self->notLike($value, $wildcard) : $self->like($value, $wildcard);\n }", "private function like($needle, $haystack) {\r\n\t\t$needle = strtolower($needle);\r\n\t\t$haystack = strtolower($haystack);\r\n\t\t$regex = '/' . str_replace('%', '.*?', $needle) . '/';\r\n\t\treturn preg_match($regex, $haystack) > 0;\r\n\t}", "public static function like(string $subject, string $pattern, bool $caseSensitivity = true): bool\n {\n if (!$caseSensitivity) {\n $subject = strtolower($subject);\n $pattern = strtolower($pattern);\n }\n $preparedPattern = str_replace('%', '.*', preg_quote($pattern, '/'));\n return (bool) preg_match(\"/^{$preparedPattern}$/\", $subject);\n }", "public function like() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['like']) && !empty($_POST['like'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->like(explode(\"/\", $this->_url)[1])) {\n echo \"error\";\n }\n }\n }\n }", "public function __icontains ( $sField, $mValue )\n {\n return \"$sField LIKE $mValue\";\n }", "public function orLike($field, $match = '', $wildcard = 'BOTH', $caseSensitive = true, $escape = null)\n {\n return $this->prepareLikeStatement($field, $match, 'OR ', $wildcard, '', $caseSensitive, $escape);\n }", "public static function like($like)\n {\n self::select(self::tableName(),'','*','',null,null,$like);\n if (!self::$instance) {\n self::$instance = new AbstractModel();\n }\n return self::$instance;\n }", "public function getLikeQueryPartDataProvider() {}", "public function orHavingLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, 'LIKE', $value);\n }", "public function notLike($stringWithWildCardCharacter){\n $this->debugBacktrace();\n $value = $this->_real_escape_string($stringWithWildCardCharacter);\n\n if($this->last_call_where_or_having == \"where\"){\n $this->whereClause .= \" NOT LIKE $value\";\n }\n else{\n $this->havingClause .= \" NOT LIKE $value\";\n }\n return $this;\n }", "public function globalStringConditionMatchesWildcardExpression() {}", "public function globalStringConditionMatchesWildcardExpression() {}", "public static function ilike(mixed $subject, mixed $pattern): bool\n {\n return ilike($subject, $pattern);\n }", "public function scopeLikeTitle($query, $text)\n {\n if (empty($text)) {\n return $query;\n }\n\n return $query->where('title', 'like', \"%$text%\");\n }", "public function scopeLikeDetails($query, $text)\n {\n if (empty($text)) {\n return $query;\n }\n\n return $query->where('details', 'like', \"%$text%\");\n }", "protected function _wildcardize($field) {\r\n // TODO: Need to be improve, protection caracter should be found \r\n\t\t$where = array();\r\n\t\tif (strpos($value, '*') !== false) {\r\n\t\t\t$where[\"{$field} LIKE ?\"] = str_replace('*', '%', $value);\r\n\t\t} \r\n\t\telse {\r\n\t\t\t$where[\"{$column} = ?\"] = $value;\r\n\t\t}\r\n \t\r\n\t\treturn $where;\r\n }", "function criteria(&$query){\n $id = $this->input->post('id', true);\n $k = $this->input->post('k', true);/*kind*/\n $t = $this->input->post('t', true);/*title*/\n $s = $this->input->post('s', true);/*sub*/\n $b = $this->input->post('b', true);/*background*/\n $so = $this->input->post('so', true);/*sort*/\n if(!empty($id)){/*where like include: before(%pattern), after(pattern%) and both(%pattern%)*/\n $query = $query->like('id', $id, 'both');\n }\n if(!empty($k)){\n $query = $query->like('kind', $k, 'both');\n }\n if(!empty($t)){\n $query = $query->like('title', $t, 'both');\n }\n if(!empty($s)){\n $query = $query->like('sub', $s, 'both');\n }\n if(!empty($b)){\n $query = $query->like('background', $b, 'both');\n }\n if(!empty($so)){\n $query = $query->like('sort', $so, 'both');\n }\n }", "abstract public function escapeStr($str, $like = false);", "public function or_like($field, $match = '', $side = 'both', $escape = NULL)\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side, '', $escape);\n\t}", "public function scopeLike($query, $fields, $search)\n {\n $fields = to_array($fields);\n\n $query->where(array_shift($fields), 'like', '%' . $search . '%');\n\n foreach ($fields as $field) {\n $query->orWhere($this->tableCol($field), 'like', '%' . $search . '%');\n }\n\n return $query;\n }", "public function getVernacular()\n\t{\n\t\treturn 'like';\n\t}", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "function likeByAttr($key, $value)\r\n {\r\n $query = $this->db->like($key, $value)\r\n ->get($this->tableName);\r\n \r\n return $this->modelResponse($query);\r\n }", "public static function contains($word)\n {\n return '%' . str_replace(' ', '%', $word) . '%';\n }", "protected function escapeLike(string $str): string {\n return addcslashes($str, '_%');\n }", "public function notLike($value);", "public function startswith($other)\n {\n return $this->compare(Operators::LIKE, (string) $other.'%');\n }", "public function search($like, $search, $where = array()) {\n\t\treturn $this->clean($this->getSearch(self::table, $like, $search, $where));\n\t}", "public function searchUserLike($username) {\n return $this->createQueryBuilder('c')\n ->where('c.username LIKE :username')\n ->setParameter('username', '%'.$username.'%')\n ->getQuery()\n ->getResult();\n }", "public function orNotLike($field, $match = '', $wildcard = 'BOTH', $caseSensitive = true, $escape = null)\n {\n return $this->prepareLikeStatement($field, $match, 'OR ', $wildcard, 'NOT', $caseSensitive, $escape);\n }", "public function buildLikeChain( $column, $data );", "public function useLikeSyntax(bool $useLikeSyntax = true): Wildcard\n {\n $this->useLikeSyntax = $useLikeSyntax;\n\n return $this;\n }", "public function __iis ( $sField, $mValue )\n {\n return \"$sField LIKE $mValue\";\n }", "public function findWith($phrase)\n {\n $qb = $this->repository->createQueryBuilder('t');\n $qb->select('t', 'p', 'a')\n ->leftJoin('t.posts', 'p')\n ->leftJoin('t.author', 'a')\n ->where($qb->expr()->orX(\n $qb->expr()->like('t.name', ':phrase'),\n $qb->expr()->like('t.description', ':phrase'),\n $qb->expr()->like('p.description', ':phrase')\n ))\n ->setParameters(array(\n 'phrase' => '%' . $phrase . '%',\n ));\n\n $query = $qb->getQuery();\n\n return $query;\n }", "function or_not_like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'OR ', $side, 'NOT');\r\n\t}", "public function contains($other)\n {\n return $this->compare(Operators::LIKE, '%'.(string) $other.'%');\n }", "public function getName()\n {\n return \"MJanssen_Filters_LikeFilter\";\n }", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "function action_like () {\n\t\t\t$this->module->indexLike($_POST['id']);\n\t\n\t\t}", "function like_match($searchParam, $subject) {\n $preg = preg_grep(\"/(.*)\" . strtolower($searchParam) . \"(.*)/\", [strtolower($subject)]);\n if(!empty($preg)){\n return true;\n }\n return false;\n}", "public function LIKE($left_right_map, $literal = false) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->WHERE_once($left_field_name, 'LIKE', $right_field_name, $literal);\n\t}", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function filterByName($name)\n {\n $name = (string) $name;\n if ($name !== '') {\n $this->query->andWhere($this->query->expr()->like('b.name', $this->query->createNamedParameter('%' . addcslashes($name, '%_\\\\') . '%')));\n }\n }", "public function search($keyword)\n\t{\n\t\t// $builder = $this->table('tbl_customer');\n\t\t// $builder->like('name', $keyword);\n\t\t// return $builder;\n\n\n\t\treturn $this->table('tbl_suppliers')->like('supplier_name', $keyword)->orLike('address', $keyword)->orLike('no_telp', $keyword);\n\t}", "function get_product_like( $conds = array(), $limit = false, $offset = false )\n\t{\n\t\t$this->db->select('rt_products.*'); \n\t\t$this->db->from('rt_products');\n\t\t$this->db->join('rt_likes', 'rt_likes.product_id = rt_products.id');\n\n\t\tif(isset($conds['user_id'])) {\n\n\t\t\tif ($conds['user_id'] != \"\" || $conds['user_id'] != 0) {\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\t\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n\t\treturn $this->db->get();\n\t\t\n \t}", "function likePost($nf, $id, $dh)\n {\n foreach($nf->arrPost as $p)\n {\n if($p->pId==$id)\n {\n $p->like($dh,$this->username);\n }\n }\n }", "public function allowWildcardSearching()\n {\n $this->wildcardSearching = true;\n\n return $this;\n }", "public function esc_like($text)\n {\n }", "public function scopeOrLike($query, $fields, $search)\n {\n $fields = to_array($fields);\n\n $query->orWhere(array_shift($fields), 'like', '%' . $search . '%');\n\n foreach ($fields as $field) {\n $query->orWhere($this->tableCol($field), 'like', '%' . $search . '%');\n }\n\n return $query;\n }", "public function or_not_like($field, $match = '', $side = 'both', $escape = NULL)\n\t{\n\t\treturn $this->_like($field, $match, 'OR ', $side, 'NOT', $escape);\n\t}", "function searchByKeyword($searchTerm) {\n $searchTerm=striptags(htmlspecialchars($searchTerm));\n $query=\"SELECT * FROM ads WHERE description LIKE '%{$searchTerm}%'\";\n }", "function _search($field, $key)\n\t{\n\t\tswitch ($field)\n\t\t{\n\t\t\tcase 'name':\n\t\t\t{\n\t\t\t\t$this->db->where('MATCH(tag.name) AGAINST(\\'\"'.$this->db->escape_str($key).'\"\\' IN BOOLEAN MODE)');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function search($phrase='', $limit = true, $additional = false){\n global $Core;\n\n if(empty($this->tableFields)){\n $this->getTableFields();\n }\n\n $phrase = trim($Core->db->real_escape_string($phrase));\n if(!empty($phrase)){\n if($this->autocompleteField && $this->autocompleteObjectId){\n $q = \"SELECT `autocomplete`.`object_id`, TRIM(`autocomplete`.`phrase`) AS 'phrase'\";\n $q .= \" FROM `{$Core->dbName}`.`autocomplete`\";\n if(isset($this->tableFields['hidden']) && !$this->showHiddenRows){\n $q .= \" INNER JOIN `{$Core->dbName}`.`{$this->tableName}` ON `{$Core->dbName}`.`autocomplete`.`object_id` = `{$Core->dbName}`.`{$this->tableName}`.`id`\";\n }\n $q .= \" WHERE `autocomplete`.`type`={$this->autocompleteObjectId} AND `autocomplete`.`phrase` LIKE '%$phrase%'\";\n if(isset($this->tableFields['hidden']) && !$this->showHiddenRows){\n $q .= \" AND (`{$this->tableName}`.`hidden` IS NULL OR `{$this->tableName}`.`hidden` = 0)\";\n }\n if($additional){\n $q .= ' AND '.$additional;\n }\n $q .= ' GROUP BY `autocomplete`.`object_id` ORDER BY `autocomplete`.`phrase` ASC, `autocomplete`.`id` ASC';\n }\n else if($this->searchByField){\n if($this->returnPhraseOnly){\n $q = \"SELECT `id` AS 'object_id',`{$this->searchByField}` AS 'phrase'\";\n }\n else{\n $q = \"SELECT *\";\n }\n $q .= \" FROM `{$Core->dbName}`.`{$this->tableName}`\";\n $q .= \" WHERE `{$this->searchByField}` LIKE '%$phrase%'\";\n if(isset($this->tableFields['hidden']) && !$this->showHiddenRows){\n $q .= \" AND (`{$this->tableName}`.`hidden` IS NULL OR `{$this->tableName}`.`hidden` = 0)\";\n }\n if($additional){\n $q .= ' AND '.$additional;\n }\n\n $q .= \" ORDER BY `\".((!empty($this->orderByField)) ? $this->orderByField : $this->searchByField).\"` {$this->orderType}, `id` ASC\";\n if($this->additionalOrdering){\n $q .= ', '.$this->additionalOrdering;\n }\n }\n else throw new Exception(\"In order to use the search function, plesae define autocompleteField and autocompleteObjectId or searchByField!\");\n\n if($limit){\n if(is_numeric($limit)){\n $q.= \" LIMIT \".(($Core->rewrite->currentPage - 1) * $limit).','.$limit;\n }\n else{\n $q.= \" LIMIT \".(($Core->rewrite->currentPage - 1) * $Core->itemsPerPage).','.$Core->itemsPerPage;\n }\n }\n\n if($this->returnPhraseOnly){\n if($Core->db->query($q,$Core->cacheTime,'fillArraySingleField',$result,'object_id','phrase')){\n return $result;\n }\n }\n else{\n if($Core->db->query($q,$Core->cacheTime,'fillArray',$result,'id')){\n return $result;\n }\n }\n return array();\n }\n else{\n $all = $this->getAll(false,false,$limit,false,false,$additional);\n if(empty($all)){\n return array();\n }\n $result = array();\n foreach($all as $k => $v){\n if($this->autocompleteField && $this->autocompleteObjectId){\n if($this->returnPhraseOnly){\n if(is_array($this->autocompleteField)){\n $result[$k] = array();\n foreach($this->autocompleteField as $f){\n if(!empty($v[$f])){\n $result[$k][] = $v[$f];\n }\n }\n $result[$k] = implode($this->autocompleteSeparator,$result[$k]);\n }\n else{\n $result[$k] = $v[$this->autocompleteField];\n }\n }\n else return $all;\n }\n else if($this->searchByField){\n if($this->returnPhraseOnly){\n $result[$k] = $v[$this->searchByField];\n }\n else return $all;\n }\n else throw new Exception(\"In order to use the search function, please define autocompleteField and autocompleteObjectId or searchByField!\");\n }\n unset($all);\n return $result;\n }\n }", "public function escapeLikeStringDirect($str)\n\t{\n\t\t//log_message('error', 'escapeLikeStringDirect');\n\n\t\tif (is_array($str))\n\t\t{\n\t\t\tforeach ($str as $key => $val)\n\t\t\t{\n\t\t\t\t$str[$key] = $this->escapeLikeStringDirect($val);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\t\t$str = $this->_escapeString($str);\n\n\t\t// Escape LIKE condition wildcards\n\t\treturn str_replace([\n\t\t\t$this->likeEscapeChar,\n\t\t\t'%',\n\t\t\t'_',\n\t\t], [\n\t\t\t'\\\\' . $this->likeEscapeChar,\n\t\t\t'\\\\' . '%',\n\t\t\t'\\\\' . '_',\n\t\t], $str\n\t\t);\n\t}" ]
[ "0.7170421", "0.7109775", "0.69531024", "0.66938573", "0.6640804", "0.6632394", "0.66287726", "0.65984625", "0.65969247", "0.6436196", "0.6367229", "0.63635254", "0.6336163", "0.624132", "0.6225767", "0.62016267", "0.61986554", "0.61851335", "0.6144322", "0.61381257", "0.6119792", "0.60795194", "0.6066759", "0.60576904", "0.6017388", "0.6017388", "0.5996906", "0.59848726", "0.59376776", "0.58952254", "0.5892218", "0.58798033", "0.5787292", "0.57803625", "0.57636434", "0.57478017", "0.5717946", "0.5695903", "0.5674177", "0.5665888", "0.5647479", "0.5638704", "0.5612486", "0.5601118", "0.5599766", "0.55744517", "0.5536291", "0.5526216", "0.55053014", "0.5495128", "0.54897815", "0.54852635", "0.5384828", "0.5377988", "0.5376431", "0.53578556", "0.53267366", "0.5325958", "0.5315414", "0.5308732", "0.5298747", "0.52911663", "0.52867883", "0.5286672", "0.5278014", "0.52767056", "0.52623636", "0.5260905", "0.525062", "0.5231619", "0.522616", "0.5221711", "0.52180886", "0.52107054", "0.52060276", "0.5192829", "0.5183708", "0.5165346", "0.5162416", "0.5133175", "0.51305586", "0.5114217", "0.5106931", "0.5098898", "0.50919676", "0.5089155", "0.5086425", "0.50475204", "0.5040399", "0.5019606", "0.50136757", "0.5000574", "0.4992457", "0.498703", "0.49627087", "0.49586198", "0.495711", "0.49529916", "0.49494818", "0.49464187" ]
0.5267706
66
Add an "in" condition.
public function in($column, $values, $boolean = 'and', $not = false) { if (!is_array($values) and !($values instanceof Query)) { $values = array_slice(func_get_args(), 1); } return $this->where_assoc(array( $column => $values ), $boolean, $not); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function in($column,$val);", "public function whereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHEREIN][$field] = [self::OPERATORS['in'] => $value];\n return $this;\n }", "public function whereIn($column, $value)\n {\n }", "public function in($expression, $arrayExpression): static;", "public function orWhereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n if (!is_array($value)) {\n $value = [$value];\n }\n return $this->addOrWhereStack([$field => [self::OPERATORS['in'] => $value]]); \n }", "function in($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _IN, $y, $and, ...$args);\n return $expression;\n }", "function in($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _IN, $y, $and, ...$args);\n return $expression;\n }", "public function inCond(string $field, array $values, string $connector = \"AND\", bool $not = false);", "public function testInList()\n {\n $query = \\SortableEntity12Query::create()->inList(1);\n $expectedQuery = \\SortableEntity12Query::create()->add(\\Map\\SortableEntity12EntityMap::FIELD_MY_SCOPE_FIELD, 1, Criteria::EQUAL);\n $this->assertEquals($expectedQuery, $query, 'inList() filters the query by scope');\n $this->assertEquals(4, $query->count(), 'inList() filters the query by scope');\n $query = \\SortableEntity12Query::create()->inList(2);\n $expectedQuery = \\SortableEntity12Query::create()->add(\\Map\\SortableEntity12EntityMap::FIELD_MY_SCOPE_FIELD, 2, Criteria::EQUAL);\n $this->assertEquals($expectedQuery, $query, 'inList() filters the query by scope');\n $this->assertEquals(2, $query->count(), 'inList() filters the query by scope');\n }", "public function whereIn($column, $values);", "public function inValue(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_IN;\n\n return $this;\n\n }", "public function in(array $values);", "function is_in(...$args)\n{\n\t$needle = array_shift($args);\n\treturn in_array($needle,$args);\n}", "public function whereIn(string $field, array $values, array $options = []);", "final public static function in($conditionField)\n {\n self::$where = false;\n //add the condition\n self::$query .= $conditionField . ' IN(';\n return (new static);\n }", "function in(...$options) {\n return function ($value) use ($options) {\n return in_array($value, $options);\n };\n}", "final public function in(...$values):bool\n {\n return Base\\Arrs::ins($this->prepareValues(...$values),$this->arr(),$this->isSensitive());\n }", "public static function whereIn($column, array $values);", "public function orIn($column,$val);", "public function in(string $column, $parametersOrExpression) : InCondition\n {\n return new InCondition($column, $parametersOrExpression);\n }", "public function whereIn($values);", "function where_in($key = NULL, $values = NULL)\r\n\t{\r\n\t \treturn $this->_where_in($key, $values);\r\n\t}", "public static function buildInPredicate($column, array $values)\n{\n\t// Form IN predicate\n\t$clause = $column . ' IN (?'\n\t . str_repeat(', ?', count($values) - 1) . ')';\n\n\t// Return clause\n\treturn $clause;\n}", "public function whereIn($field, $data = array()){\n return $this->model->whereIn($field, $data);\n }", "public static function in(string $column, ...$values): Condition\n {\n if (count($values) === 1 && is_array($values[0])) {\n $values = $values[0];\n }\n return (new Condition())->column($column)->in($values);\n }", "public function where_in($key = NULL, $values = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_where_in($key, $values, FALSE, 'AND ', $escape);\n\t}", "public function __in ( $sField, $mValues )\n {\n /*\n Prepare from parameters.\n */\n if (is_array($mValues))\n {\n /*\n Convert array into string.\n */\n $mValues = implode(', ', $mValues);\n }\n elseif (func_num_args() > 2)\n {\n /*\n Use passed paramaters from the 2nd to last to build the string.\n */\n $aParams = func_get_args();\n array_shift($aParams);\n $mValues = implode(', ', $aParams);\n }\n return \"$sField IN ($mValues)\";\n }", "private function process_in($value, $param = null)\n {\n return in_array($value, explode(',', $param));\n }", "public function findAllWhereIn( array $value, $field, array $columns = ['*'] );", "public function fetchIn( array $in, $condition = array(), $params = null )\n {\n\n if( !$params )\n $params = new TFlowFlag();\n\n $this->sourceSize = null;\n $db = $this->getDb();\n\n $criteria = $db->orm->newCriteria();\n\n $this->setCols( $criteria );\n $this->setTables( $criteria );\n\n\n $criteria->whereIn($in);\n $this->appendConditions( $criteria, $condition, $params );\n $this->checkLimitAndOrder( $criteria, $params );\n\n // Run Query und save the result\n $this->result = $db->orm->select( $criteria );\n $this->calcQuery = $criteria->count('count(project_task.'.Db::PK.') as '.Db::Q_SIZE);\n\n }", "public function where_emp_in($emp) {\n\t\t$this->db->where_in('ID', $emp);\n\t}", "static function _IN($field, Array $values){\n $var = \"\";\n /* busca si existe el campo en el modelo en cuestion */\n if(aModels::findFieldModel($field) == 'STRING'){\n foreach ($values as $val){\n # le coloca las comillas simples al valor\n $var .= \"'\".(strip_tags($val)) .\"', \";\n }\n $var = trim($var,', ');\n }else{\n $var = implode(\", \", $values);\n }\n return $field . \" {in} ($var) \";\n }", "public function in($property, Array $values)\n {\n $this->search[] =$this->dbFieldName($property) . ' IN (' . implode(',', $this->prepareInValues($values)) .')';\n }", "public function whereIn($key, $value = null) {\n if(!$this->where_in) {\n $this->where_in = array();\n }\n if(!is_array($key)) {\n $key = array($key => $value);\n }\n foreach($key as $k => $v) {\n $this->where_in[$k] = $v;\n }\n return $this;\n }", "public static function in(PdoMysqlSession $sqlSess, $colName, array $values) {\r\n\t\tif (!$values) return '1 = 0';\r\n\t\t\r\n\t\t$valuesQ = [];\r\n\t\t\r\n\t\tforeach ($values as $value) {\r\n\t\t\t$valuesQ[] = $sqlSess->encodeValue($value);\r\n\t\t}\r\n\t\t\r\n\t\treturn $sqlSess->encodeName($colName) . ' IN (' . implode(', ', $valuesQ) . ')';\r\n\t}", "public function in($question = '');", "public function in($other)\n {\n $params = array();\n foreach ($other as $o) $params[] = $this->bindParam($o);\n $other = new Grouping(new ClauseList($params));\n return $this->compare(Operators::IN, $other);\n }", "public static function IN($filename, $dir, $id) {\n\t\treturn (object)Array(\n\t\t\t'filename'\t=> $filename,\n\t\t\t'dir'\t\t=> $dir,\n\t\t\t'id'\t\t=> $id,\n\t\t\t'is_in'\t\t=> true\n\t\t);\n\t}", "public function in($field, $values = null, $joiner = 'AND') {\r\n if( $values === null ) {\r\n $values = $field;\r\n $field = $this->sqlTmpField;\r\n }\r\n $values = $this->addQuotes($values);\r\n if( is_array($values) ) {\r\n $condition = sprintf('IN (%s)', join(', ', $values));\r\n } else {\r\n $condition = sprintf('IN (%s)', $values);\r\n }\r\n $this->where($field, $condition, $joiner, false);\r\n return $this;\r\n }", "public function in($in, $error) {\n if ($this->_exist) {\n array_push($this->_constraints, ['type' => self::IN, 'value' => $in, 'message' => $error]);\n }\n\n return $this;\n }", "public function in( $collection ) {\n\t\t\t$this->_action = 'IN';\n\t\t\t$this->_value = $collection;\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function testSelectWithInCondition(): void\n {\n $this->_insert();\n $result = $this->connection->selectQuery('id', 'ordered_uuid_items')\n ->where(\n ['id' => ['48298a29-81c0-4c26-a7fb-413140cf8569', '482b7756-8da0-419a-b21f-27da40cf8569']],\n ['id' => 'ordered_uuid[]']\n )\n ->orderBy('id')\n ->execute()\n ->fetchAll('assoc');\n\n $this->assertCount(2, $result);\n $this->assertSame('419a8da0482b7756b21f27da40cf8569', $result[0]['id']);\n $this->assertSame('419a8da0482b7756b21f27da40cf8569', $result[0]['id']);\n }", "private static function _parse_condition_in($params, $not, &$prepared_values)\n\t{\n\t\tif (count($params) < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$array = $params[2];\n\t\tif (!is_array($array) OR count($array) < 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$type = $params[3] ?? null;\n\t\tforeach ($array as &$val)\n\t\t{\n\t\t\t$val = self::_convert_data($val, $type, $prepared_values);\n\t\t}\n\t\tunset($val);\n\t\t$array = implode(', ', $array);\n\t\t$result = \"IN ({$array})\";\n\t\tif ($not)\n\t\t{\n\t\t\t$result = 'NOT ' . $result;\n\t\t}\n\t\treturn $result;\n\t}", "public function whereContainedIn($field, $values) {\n\t$this->parseQuery->whereContainedIn($field, $values);\n }", "public static function getInStatement ($categoryId)\n\t{\n\t\t$db = DataAccess::getInstance();\n\t\t$categoryId = (int)$categoryId;\n\t\tif (!$categoryId) {\n\t\t\t//not valid category!\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!isset(self::$_in_statements[$categoryId])) {\n\t\t\t$result = $db->Execute(\"SELECT `in_statement` FROM \".geoTables::categories_table.\" WHERE `category_id`=$categoryId\");\n\t\t\tif (!$result) {\n\t\t\t\t//actual DB error\n\t\t\t\ttrigger_error(\"ERROR SQL: Error getting in statement for category $categoryId\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($result->RecordCount() == 0) {\n\t\t\t\ttrigger_error(\"ERROR CATEGORY: Not a valid category!\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$row = $result->FetchRow();\n\t\t\tif (!strlen(trim($row['in_statement']))) {\n\t\t\t\t//in statement not known? go ahead and update on fly, probably\n\t\t\t\t//silly site owner manually entered categories or it timed out or something\n\t\t\t\t$in_array = geoCategory::updateInStatement($categoryId);\n\t\t\t\t\n\t\t\t\tself::$_in_statements[$categoryId] = 'in ('.implode(',',$in_array).')';\n\t\t\t\tunset($in_array);\n\t\t\t} else {\n\t\t\t\tself::$_in_statements[$categoryId] = trim($row['in_statement']);\n\t\t\t}\n\t\t}\n\t\treturn self::$_in_statements[$categoryId];\n\t}", "public function whereIn($field, $values = [], $escape = null)\n {\n return $this->prepareWhereInStatement($field, $values, false, 'AND ', $escape);\n }", "public function filterIsApproved(Builder $query, $method, $clauseOperator, $value, $in)\n {\n if ($value) {\n $query->whereIn('approved', [$value]);\n }\n }", "public static function in(string $field, $value): Where {\n $w = new Where();\n\n $w->addFilter($field, Where::OperatorIN, $value);\n\n return $w;\n }", "public function in($propertyName, $operand)\n {\n if (!is_array($operand) && (!$operand instanceof \\ArrayAccess) && (!$operand instanceof \\Traversable)) {\n throw new InvalidQueryException('The \"in\" constraint must be given a multi-valued operand (array, ArrayAccess, Traversable).', 1264678095);\n }\n if ($this->classSchema->isMultiValuedProperty($propertyName)) {\n throw new InvalidQueryException('Property \"' . $propertyName . '\" must not be multi-valued.', 1276777034);\n }\n\n return $this->qomFactory->comparison(\n $this->qomFactory->propertyValue($propertyName, '_entity'),\n QueryInterface::OPERATOR_IN,\n $operand\n );\n }", "public function one()\n {\n $inCriterion = new stubInCriterion('foo', array('bar'));\n $this->assertEquals(\"`foo` IN ('bar')\", $inCriterion->toSQL());\n $inCriterion = new stubInCriterion('foo', array('bar'), 'baz');\n $this->assertEquals(\"`baz`.`foo` IN ('bar')\", $inCriterion->toSQL());\n }", "public function whereIn($field=null,$value=null,$model=null){\n if($this->model==null){\n $this->model=$value;\n }\n\n if(is_array($field) && array_key_exists(1,$field)){\n if(is_array($field[1])){\n $this->whereIn['field']=$field[0];\n $this->whereIn['operator']='=';\n $this->whereIn['value']=implode(\",\",$field[1]);\n }\n\n }\n else{\n if(is_array($value)){\n $this->whereIn['field']=$field;\n $this->whereIn['operator']='=';\n $this->whereIn['value']=implode(\",\",$value);\n }\n\n }\n\n return $this;\n }", "public function in(array $value)\n {\n $this->addCompoundConstraint('$in', $value);\n return $this;\n }", "protected function whereIn(Builder $builder, $where): string\n {\n if (empty($where['values'])) return '0 = 1';\n \n return $this->wrap($where['column']).' in ('.$this->parameterize($where['values']).')';\n }", "function assoc_in($coll, $in, $value) {\n if (empty($in)) {\n return $coll;\n }\n\n $array = f\\to_array($coll);\n\n $current =& $array;\n foreach ($in as $k) {\n if (f\\not(f\\get_or($current, $k, null))) {\n $current = f\\assoc($current, $k, array());\n }\n\n $current =& $current[$k];\n }\n\n $current = $value;\n\n return $array;\n}", "public function inArray($key, $name);", "public function sql_where_col_in( $col_name, $col_numeric, $value_array)\n {\n $sql = $col_name . \" IN (\";\n foreach ($value_array as $value)\n {\n $sql .= $col_numeric ? \"$value,\" : \"'$value',\";\n }\n return rtrim($sql, \",\") . \")\";\n }", "public function andWhereIn($expr, $params = array(), $not = false)\n {\n return parent::andWhereIn($expr, $params === array() ? array(0) : $params, $not);\n }", "public function whereIn(string $column, $not, string $operator, $value, string $type, string $logic = null)\n {\n array_push($this->where, ['type' => $type, 'condition' => ['conjunction' => $logic, 'column' => $column, 'not' => $not, 'operator' => $operator, 'list' => $value]]);\n }", "public function two()\n {\n $inCriterion = new stubInCriterion('foo', array('bar', 'dummy'));\n $this->assertEquals(\"`foo` IN ('bar', 'dummy')\", $inCriterion->toSQL());\n $inCriterion = new stubInCriterion('foo', array('bar', 'dummy'), 'baz');\n $this->assertEquals(\"`baz`.`foo` IN ('bar', 'dummy')\", $inCriterion->toSQL());\n }", "public function where_in($name, $vals)\n {\n if (is_object($vals))\n {\n $this->where[] = sprintf('%s in (%s)', self::quote_name($name), $vals->get_select());\n return $this;\n }\n $vals = static::ensure_array($vals);\n $this->where[] = !empty($vals)\n ? sprintf('%s in (%s)', self::quote_name($name), join(',', self::prepare($vals)))\n : sprintf('1 = 0 /* empty: %s IN() */', $name);\n return $this;\n }", "public function in(string $column, $list)\n {\n $condition = \"in\";\n\n $this->where($column, $condition, $list, $condition);\n\n return $this;\n }", "function in($value, $comp) {\n\t\t$comp = str_replace(\"\\\\,\", \"__WE_COMMA__\", $comp);\n\t\t$arr = explode(\",\", $comp);\n\t\t$l = count($arr);\n\t\tfor ($i=0; $i<$l; $i++) {\n\t\t\t$arr[$i] = str_replace(\"__WE_COMMA__\", \",\", $arr[$i]);\n\t\t}\n\t\treturn in_array($value, $arr);\n\t}", "protected function addTokenInCondition(&$condition, Token $token) {\n\t\tif ($token->isBinaryOperator() && $token->type != Token::T_MOD) {\n\t\t\t$value = ' ' . $token->value . ' ';\n\t\t} else if ($token->type == Token::T_TEXT) {\n\t\t\t$value = \"'\" . $token->value . \"'\";\n\t\t} else {\n\t\t\t$value = $token->value;\n\t\t}\n\t\tif ($condition->inoperand) {\n\t\t\t$condition->operand .= $value;\n\t\t} else if ($condition->invalue) {\n\t\t\t$condition->value .= $value;\n\t\t} else {\n\t\t\t$condition->operand .= $value;\n\t\t\t$condition->inoperand = true;\n\t\t}\n\t}", "private function inClause($list)\n {\n\n $list = array_map(function ($i) {\n\n return \"?\";\n\n }, $list);\n\n $list = implode(\",\", $list);\n\n return \"($list)\";\n }", "public static function inArray($value, array $values, $message = '');", "private function in ($param)\n {\n $list = ','.trim($param, ',').',';\n if (strpos($list, $this->value) < 0)\n {\n $this->SetError('in', 'The '.$this->SpacedKey.' field must be one of the following: '.str_replace(',', ' / ', trim($param, ',')));\n return false;\n }\n return true;\n }", "public function in($value, $list): bool\n\t{\n return in_array($value, explode(',', $list), true);\n }", "public function whereInQuery($field, $className, $array) {\n\t$this->parseQuery->whereInQuery($field, $className, $array);\n }", "public function testTupleWithInComparison(): void\n {\n $f = new TupleComparison(\n ['field1', 'field2'],\n [[1, 2], [3, 4]],\n ['integer', 'integer'],\n 'IN'\n );\n $binder = new ValueBinder();\n $this->assertSame('(field1, field2) IN ((:tuple0,:tuple1), (:tuple2,:tuple3))', $f->sql($binder));\n $this->assertSame(1, $binder->bindings()[':tuple0']['value']);\n $this->assertSame(2, $binder->bindings()[':tuple1']['value']);\n $this->assertSame(3, $binder->bindings()[':tuple2']['value']);\n $this->assertSame(4, $binder->bindings()[':tuple3']['value']);\n }", "function getIN($name)\n{\n global $in;\n\n foreach ($in as $item) {\n if (strpos($item, $name.'.in')){\n return $item;\n }\n }\n\n return null;\n}", "public function whereIn($column, $values, $boolean = 'and', $not = false)\n {\n return $this->callHook(__FUNCTION__, $this->packArgs(compact('column', 'values', 'boolean', 'not')));\n }", "protected function _in($model, $as_array = FALSE)\n\t{\n\t\t$result = Jelly::select($this->through['model'])\n\t\t\t\t->select($this->through['columns'][1])\n\t\t\t\t->where($this->through['columns'][0], '=', $model->id());\n\n\t\tif ($as_array)\n\t\t{\n\t\t\t$result = $result\n\t\t\t\t\t\t->execute(Jelly::meta($model)->db())\n\t\t\t\t\t\t->as_array(NULL, $this->through['columns'][1]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function findIn(array $inCriteria, $field = null)\n {\n $field = isset($field) ? $field : $this->primaryKey;\n\n $result = new ArrayIterator();\n\n $counter = 0;\n foreach ($this->storage as $row) {\n if ($row->offsetExists($field)) {\n if (in_array($row->offsetGet($field), $inCriteria)) {\n $result[] = $row;\n $counter++;\n }\n }\n\n if (isset($limit)) {\n if ($counter == $limit) {\n break;\n }\n }\n }\n\n if ($result->count() > 0) {\n $this->result = $result;\n\n if ($result->count() == 1) {\n return $result->first();\n } else {\n return $this->result;\n }\n }\n\n return false;\n }", "function has_inclusion_in($value,$set) {\n\t\treturn in_array($value,$set);\n\t\t}", "public function __construct(string $field, array $values, bool $valueIn = true)\n {\n $fieldString = $this->quoter()->quoteField($field);\n\n $placeHolders = '(';\n $placeHolders .= implode(', ', array_fill(0, count($values), '?') );\n $placeHolders .= ')';\n\n $this->outString = $fieldString;\n\n if ( $valueIn )\n {\n $this->outString .= ' IN ';\n }\n else\n {\n $this->outString .= ' NOT IN ';\n }\n\n $this->outString .= $this->bindAssign($placeHolders, $values);\n }", "public function inList( $mVarVal = NULL ) {\n\t\treturn FALSE;\n\t}", "function has_inclusion_in($value, $set) {\n\treturn in_array($value, $set);\n}", "function has_inclusion_in($value, $set) {\n\treturn in_array($value, $set);\n}", "function has_inclusion_in($value, $set) {\r\n\treturn in_array($value, $set);\r\n}", "function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ')\r\n\t{\r\n\t \t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t$this->db->_where_in($this->table . '.' . $key, $values, $not, $type);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->db->_where_in($key, $values, $not, $type);\r\n\t\t}\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function scopeOrderByWhereIn(Builder $query, $data, $column = 'id');", "public function filterDriverStatus(Builder $query, $method, $clauseOperator, $value, $in)\n {\n if ($value) {\n $query->whereIn('drivers.status', ['available']);\n }\n }", "public function in(array $list): array\n\t{\n\t\t$result = [];\n\n\t\tif (isset($list) && !empty($list))\n\t\t{\n\t\t\t$result = ['$in' => $list];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('One required non empty array argument should be passed to method', __METHOD__);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "protected function compileInExpression(CompilableClause $query, $values, string $column, string $operator = 'IN', bool $converted = false)\n {\n if (is_array($values)) {\n $hasNullValue = null;\n foreach ($values as $index => &$value) {\n if ($value === null) {\n unset($values[$index]);\n $hasNullValue = true;\n } else {\n $value = $converted ? $this->bindRaw($query, $value) : $this->bindTyped($query, $value, null);\n }\n }\n\n // If the collection has a null value we add the null expression\n if ($hasNullValue) {\n if ($values) {\n $expression = '('.$this->quoteIdentifier($query, $column).' '.$operator.' ('.implode(',', $values).')';\n\n if ($operator === 'IN') {\n return $expression.' OR '.$this->compileExpression($query, $column, 'in', null, $converted).')';\n } else {\n return $expression.' AND '.$this->compileExpression($query, $column, '!in', null, $converted).')';\n }\n }\n\n return $this->compileExpression($query, $column, $operator === 'IN' ? 'in' : '!in', null, $converted);\n }\n\n $values = '('.implode(',', $values).')';\n } elseif ($values instanceof QueryInterface) {\n $values = $this->compileSubQuery($query, $values);\n } elseif ($values instanceof ExpressionInterface) {\n $values = '('.$values->build($query, $this).')';\n } else {\n $values = $converted ? $this->bindRaw($query, $values) : $this->bindTyped($query, $values, null);\n $values = '('.$values.')'; // @todo utile ?\n }\n\n return $this->quoteIdentifier($query, $column).' '.$operator.' '.$values;\n }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "public function whereIn($group, $field, array $list)\n {\n $fList = $this->inClause($list);\n $this->where[$group][] = \"$this->alias.$field IN $fList\";\n $this->params[$group][] = isset($this->params[$group]) ? array_merge($this->params[$group], $list) : $list;\n return $this;\n\n }", "function room_in($what, $in)\r\n{\r\n\t$rooms = (is_array($in) ? $in : explode(\",\",$in));\r\n\tfor (reset($rooms); $room_name=current($rooms); next($rooms))\r\n\t{\r\n\t\tif (strcasecmp($what, $room_name) == 0) return true;\r\n\t};\r\n\treturn false;\r\n}", "public static function in(mixed $subject, string|array|Collection $value): bool\n {\n if (is_array($value)) {\n return in_array($subject, $value);\n }\n\n if ($value instanceof Collection) {\n return $value->contains($subject);\n }\n\n if (is_string($value) || is_numeric($value)) {\n return stripos((string) $value, (string) $subject) !== false;\n }\n\n return false;\n }", "public function contains($value)\n\t{\n $this->operator = \"contains\";\n $this->value = $value;\n\t}", "abstract protected function _doContains($id);", "public function in( $column, $values, $reverse=FALSE )\n\t{\n\t\t$in\t= array();\n\n\t\tif( !is_array( $values ) )\n\t\t{\n\t\t\t$values = array( $values );\n\t\t}\n\t\t\n\t\tforeach( $values as $i )\n\t\t{\n\t\t\tif ( $i != NULL and is_numeric( $i ) )\n\t\t\t{\n\t\t\t\t$in[] = $i;\n\t\t\t}\n\t\t\telse if ( $i != NULL and is_string( $i ) )\n\t\t\t{\n\t\t\t\t$in[] = \"'\" . $this->real_escape_string( $i ) . \"'\";\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t$return = array();\n\n\t\tif ( ! empty( $in ) )\n\t\t{\n\t\t\t$return[] = $column . ( $reverse ? ' NOT' : '' ) . ' IN(' . implode( ',', $in ) . ')';\n\t\t}\n\t\t\n\t\tif ( count( $return ) )\n\t\t{\n\t\t\treturn '( ' . implode( ' OR ', $return ) . ' )';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $reverse ? '1=1' : '1=0';\n\t\t}\n\t}", "public function havingIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->having($column, 'IN', ...[$value, ...$values]);\n }", "public function whereIn($key, $values)\n\t{\n\n\t\t$placeholders = [];\n\n\t\tarray_walk($values, function(&$value) use (&$placeholders) {\n\n\t\t\tarray_push($this->values, $value);\n\n\t\t\t$placeholder = is_int($value) ? '%d' : '%s';\n\n\t\t\tarray_push($placeholders, $placeholder);\n\n\t\t});\n\n\t\t$keys = implode(',', $placeholders);\n\n\t\t$this->setCondition(\"$key in($keys)\");\n\n\t\treturn $this;\n\t\n\t}", "public function findWhereIn(sting $field, array $value)\n {\n $entities = $this->model->select($this->columns)\n ->whereIn($field, $value)\n ->take($this->limit)\n ->skip($this->offset)\n ->orderBy($this->order, $this->sort)\n ->with($this->relationships)\n ->get();\n\n if ($entities->isEmpty()) {\n return false;\n }\n\n return $entities;\n }", "protected function whereIn(Builder $query, array $where)\n {\n if (!empty($where['values'])) {\n return $this->wrap($where['column']) . ' in (' . $this->parameterize($where['values']) . ')';\n }\n\n return '0 = 1';\n }", "public function andWhereEq($name,$value)\r\n {\r\n $qb = $this;\r\n \r\n // Handle array\r\n if (is_array($value))\r\n {\r\n // Filter empty\r\n if (!count($value)) return;\r\n \r\n // Use IN, assume for now array contains scaler values\r\n if (count($value) > 1)\r\n {\r\n return $qb->andWhere($qb->expr()->in($name, $value));\r\n }\r\n $value = array_shift($value); //$value[0];\r\n }\r\n // Just a plain old scaler\r\n if (is_object($value)) $value = $value->getId();\r\n \r\n return $qb->andWhere($qb->expr()->eq($name,$qb->expr()->literal($value)));\r\n }", "public function contains($value);", "public function whereIn($field, array $value, string $boolean = 'must'): self\n\t{\n\t\t$this->wheres[$boolean][] = [\n\t\t\t'terms' => [\n\t\t\t\t$field => $value,\n\t\t\t],\n\t\t];\n\n\t\treturn $this;\n\t}", "public static function buildWhereInClause($column, array $values)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . self::buildInPredicate($column, $values);\n\n\t// Return clause\n\treturn $clause;\n}", "protected function whereIn(Builder $query, $where)\n {\n $values = $this->valufy($where['values']);\n\n return $this->wrap($where['column']).' IN '.$values;\n }" ]
[ "0.7444275", "0.69880205", "0.68901", "0.6682151", "0.66413933", "0.6632794", "0.6632794", "0.6617481", "0.65380675", "0.65291846", "0.64853114", "0.64740247", "0.64437586", "0.6443568", "0.6397735", "0.63830745", "0.6354444", "0.63450557", "0.6236048", "0.6192579", "0.618844", "0.6141358", "0.60804284", "0.60675997", "0.60584295", "0.60337794", "0.6032722", "0.60201603", "0.6017858", "0.60161656", "0.6003624", "0.5995327", "0.59777963", "0.59669095", "0.58966184", "0.5868704", "0.5850926", "0.5840172", "0.5819259", "0.5807652", "0.5801456", "0.57730293", "0.5762196", "0.57578033", "0.5757559", "0.57523555", "0.57161444", "0.56900984", "0.566075", "0.5648108", "0.5647434", "0.5630038", "0.5623478", "0.5617713", "0.56017774", "0.557677", "0.55686927", "0.5562615", "0.556216", "0.5516311", "0.5510382", "0.5507636", "0.5491598", "0.54911834", "0.5490665", "0.5489726", "0.5486402", "0.5475216", "0.54683185", "0.5434204", "0.5429338", "0.53828084", "0.53803015", "0.53797376", "0.5373182", "0.536799", "0.5358105", "0.5358105", "0.53375393", "0.53208065", "0.52960277", "0.52894497", "0.5286169", "0.5274115", "0.5273825", "0.5241762", "0.52198535", "0.5199087", "0.51906574", "0.5190371", "0.5180496", "0.5172836", "0.5168151", "0.5166546", "0.51616204", "0.51604134", "0.51469594", "0.5146731", "0.5137248", "0.50895244" ]
0.52520967
85
Add a "between" condition.
public function between($column, $start, $end, $boolean = 'and', $not = false) { $operator = $not ? 'not between' : 'between'; return $this->where($column.' '.$operator.' ? and ? ', array($start, $end), $boolean); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addBetweenCondition($field,$value_start,$value_end,$operator='AND') {\r\n $this->addRelationCompare($field, ['#between#'=>true,$value_start,$value_end],false,$operator);\r\n }", "public function between($column,$val1,$val2);", "public function between(string $column, $min, $max, $dataType = PDO::PARAM_STR) : BetweenCondition\n {\n return new BetweenCondition($column, $min, $max, $dataType);\n }", "public function __between ( $sField, $mLower, $mHigher )\n {\n return \"$sField BETWEEN $mLower AND $mHigher\";\n }", "public function whereBetween($column, $value1, $value2);", "public static function between(string $column, $value1, $value2): Condition\n {\n return (new Condition())->column($column)->between($value1, $value2);\n }", "public function between($val1, $val2) \n {\n // Alittle cleaning\n $val1 = $this->clean($val1);\n $val2 = $this->clean($val2);\n \n // Build our statement\n $this->sql .= \" BETWEEN `\". $val1 .\"` AND `\". $val2 .\"`\";\n return $this;\t\n }", "public function between($between, $error) {\n if ($this->_exist) {\n array_push($this->_constraints, ['type' => self::BETWEEN, 'value' => $between, 'message' => $error]);\n }\n\n return $this;\n }", "public function between( $low, $high ) {\n if( !is_numeric( $low ) || !is_numeric( $high ) )\n {\n throw new Exception( 'between( $low, $high ) only accepts numeric values.' );\n }\n\n $this->_action = 'BETWEEN';\n $this->_value = array( $low, $high );\n\n return $this;\n }", "private function process_between($value, $param = null) {\n $fields = explode(',', $param, 2);\n \n if (count($fields) != 2) throw new \\Exception(\"Between validator: incorrect param count\");\n \n if ($value <= $fields[0] || $value >= $fields[1]) {\n return false;\n } else {\n return true;\n }\n }", "private static function _parse_condition_between($params, $not, &$prepared_values)\n\t{\n\t\tif (count($params) < 4)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$type = $params[4] ?? null;\n\t\t$from = self::_convert_data($params[2], $type, $prepared_values);\n\t\t$to = self::_convert_data($params[3], $type, $prepared_values);\n\t\t$result = \"BETWEEN {$from} AND {$to}\";\n\t\tif ($not)\n\t\t{\n\t\t\t$result = 'NOT ' . $result;\n\t\t}\n\t\treturn $result;\n\t}", "public function whereBetween($column, $value1, $value2)\n {\n $this->where_clause .= \"$column BETWEEN $value1 AND $value2\";\n }", "public function between($left, $right)\n {\n return new Expression($this, \n new ExpressionList(array($this->checkLiteral($left), $this->checkLiteral($right))), \n Operators::BETWEEN);\n }", "public static function whereBetween($column, $lowest, $highest);", "public function betweenCond(string $field, string $from, string $to, $connector = \"AND\", bool $not = false);", "public function between(string $column, $lower, $higher)\n {\n $condition = 'between';\n\n $this->where($column, $condition, [$lower, $higher], $condition);\n \n return $this;\n }", "public function testBetween(): void\n {\n $period = Period::between(LocalDate::of(2010, 1, 15), LocalDate::of(2011, 3, 18));\n $this->assertPeriodIs(1, 2, 3, $period);\n }", "public function where_between($name, $lower, $upper)\n {\n $this->where(self::quote_name($name) .' between ? and ?', $lower, $upper);\n return $this;\n }", "function between($x, $y, $y2, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _BETWEEN,$y, $y2, ...$args);\n return $expression;\n }", "function between($x, $y, $y2, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _BETWEEN,$y, $y2, ...$args);\n return $expression;\n }", "function between($min, $max) {\n\t$between = function ($min, $max, $value) {\n\t\treturn $min <= $value && $value <= $max;\n\t};\n\n\treturn curry($between)($min, $max);\n}", "public function keyConditionBetween(string $column, string $from, string $to): Builder\n {\n $column = $this->expression->addName($column);\n $from = $this->expression->addValue($from);\n $to = $this->expression->addValue($to);\n\n $this->keyConditionExpressions[] = sprintf('%s BETWEEN %s AND %s', $column, $from, $to);\n return $this;\n }", "public function orHavingBetween(\n Closure | string $column,\n Closure | float | int | string | null $min,\n Closure | float | int | string | null $max\n ) : static {\n return $this->orHaving($column, 'BETWEEN', $min, $max);\n }", "public function whereBetween($group, $field, $a, $b)\n {\n $this->where[$group][] = \"($this->alias.$field BETWEEN ? AND ?) \";\n $this->params[$group][] = $a;\n $this->params[$group][] = $b;\n return $this;\n }", "public function whereBetween(String $colName, Array $betweenValues){ \r\n $valueTypeFirst = \"%s\";\r\n if($betweenValues[0] instanceof \\DateTime){\r\n $betweenValues[0] = $betweenValues[0]->format(\"Y-m-d H:i:s\");\r\n }else if(is_integer($betweenValues[0])){\r\n $valueTypeFirst = \"%i\";\r\n }else if(is_double($betweenValues[0])){\r\n $valueTypeFirst=\"%d\";\r\n }\r\n $valueTypeSec = \"%s\";\r\n if($betweenValues[1] instanceof \\DateTime){\r\n $betweenValues[0] = $betweenValues[1]->format(\"Y-m-d H:i:s\");\r\n }else if(is_integer($betweenValues[1])){\r\n $valueTypeSec = \"%i\";\r\n }else if(is_double($betweenValues[1])){\r\n $valueTypeSec=\"%d\";\r\n }\r\n\r\n $this->where->add($colName.\" BETWEEN \".$valueTypeFirst.\" AND \".$valueTypeSec, $betweenValues[0], $betweenValues[1]);\r\n return $this;\r\n }", "public static function between(mixed $subject, mixed $min, mixed $max): bool\n {\n return $subject >= $min && $subject <= $max;\n }", "public function havingBetween(\n Closure | string $column,\n Closure | float | int | string | null $min,\n Closure | float | int | string | null $max\n ) : static {\n return $this->having($column, 'BETWEEN', $min, $max);\n }", "private function prepareInRangeCondition($inRange)\n {\n list($attribute, $from, $to) = array_pad($inRange, 3, null);\n $inRange = new Range();\n $inRange->addField($attribute, ['from' => $from, 'to' => $to]);\n $this->filter->addMust($inRange);\n }", "public function whereBetween($field, array $values = [], $escape = null)\n {\n return $this->prepareWhereStatement($field, implode(' AND ', $values), 'AND ', $escape, 'between');\n }", "public static function between($str, $substr_start, $substr_end) {}", "public function between($start, $end, bool $inclusive = true, bool $throwException = true): bool\n {\n $this->ensureCompatibleArgs([$start, $end]);\n return static::betweenCalculation(\n $this->value,\n $start,\n $end,\n $inclusive,\n $this->internalMaxDecPl(),\n $throwException\n );\n }", "public static function isBetween($from, $to, $value) \n\t{\n\t\tif (null !== $from && $value < $from) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (null !== $to && $to < $value) { \n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function between(string $lowerDate, string $upperDate) : bool\r\n {\r\n return ($this->getTimestamp() >= strtotime($lowerDate) && $this->getTimestamp() <= strtotime($upperDate));\r\n }", "public static function between(QueryBuilder $qb, string $var, $min, $max, $type = null): string\n {\n\n // should provide ability to set $var, $min, $max either in-sql value like a.state or fixed scalar/object like \"desiredValue\"\n // use special wrapper for it?\n $minVar = static::generateParamName('min');\n $maxVar = static::generateParamName('max');\n $qb->setParameter($minVar,$min,$type);\n $qb->setParameter($maxVar,$max,$type);\n\n return $qb->expr()->between($var,':'.$minVar,':'.$maxVar);\n }", "public function havingBetween($col, $value1, $value2)\n {\n $this->having .= \" $col BETWEEN $value1 AND $value2 \";\n }", "public function testSelectWithBetween(): void\n {\n $this->_insert();\n $result = $this->connection->selectQuery(fields: 'id', table: 'ordered_uuid_items')\n ->where(function (QueryExpression $exp) {\n return $exp->between(\n 'id',\n '482b7756-8da0-419a-b21f-27da40cf8569',\n '48298a29-81c0-4c26-a7fb-413140cf8569',\n 'ordered_uuid'\n );\n })\n ->execute()\n ->fetchAll('assoc');\n\n $this->assertCount(3, $result);\n }", "public function whereBetween($field=null,$operator=null,$value=null,$model=null){\n\n if($this->model==null){\n $this->model=$operator;\n }\n\n if($field!==null && is_array($field)){\n\n if(array_key_exists(0,$field) && array_key_exists(1,$field) && array_key_exists(2,$field)){\n $this->where['field'][]='between_'.$field[0];\n $this->where['operator'][]=$field[1];\n $this->where['value'][]=$field[2];\n }\n\n }\n else{\n\n if($field!==null && $operator!==null && $value!==null){\n $this->where['field'][]='between_'.$field;\n $this->where['operator'][]=$operator;\n $this->where['value'][]=$value;\n }\n\n }\n\n return $this;\n }", "public function scopeBetween($query, $before = null, $after = null)\n {\n if (is_array($before)) {\n [$before, $after] = $before;\n }\n\n if ($before instanceof self) {\n $before = $before->{$before->getCreatedAtColumn()};\n }\n\n if ($after instanceof self) {\n $after = $after->{$after->getCreatedAtColumn()};\n }\n \n // Should we handle, if the developer passes nulls ?\n //abort_if((is_null($before) || is_null($after)), $problemExistsBetweenMonitorAndChair = 40);\n\n return $query\n ->whereDate($this->getCreatedAtColumn(), '>=', $this->asDateTime($before)->format('Y-m-d'))\n ->whereDate($this->getCreatedAtColumn(), '<=', $this->asDateTime($after)->format('Y-m-d'));\n }", "public function isBetween($start, $end) {\n return $this->is(new NotPossible('cannot be between anything'));\n }", "public function date($data,$between);", "public function not_between($val1, $val2) \n {\n // Alittle cleaning\n $val1 = $this->clean($val1);\n $val2 = $this->clean($val2);\n \n // Build our statement\n $this->sql .= \" NOT BETWEEN `\". $val1 .\"` AND `\". $val2 .\"`\";\n return $this;\t\n }", "public function between(string|int|float $message): self\n {\n return $this->addMessage(new Between($message));\n }", "public static function between($n, $min, $max){\r\n\t\treturn isset($n) && intval($n) >= $min && intval($n) < $max;\r\n\t}", "public function whereBetween(string $column, $not, string $operator, $value, string $type, string $logic = null)\n {\n array_push($this->where, ['type' => $type, 'condition' => ['conjunction' => $logic, 'column' => $column, 'not' => $not, 'operator' => $operator, 'values' => $value]]);\n }", "public function between($name, $min, $max, $message = 'The price must be between 0 and 100')\n {\n //Between\n $this->validation->add($name, new \\Phalcon\\Validation\\Validator\\Between(array(\n 'minimum' => $min,\n 'maximum' => $max,\n 'message' => $message\n )));\n return $this;\n }", "private function _getRangeConditions($field_name, $min, $max, $max_value, $table_name='Rental')\n\t{\n\t\tif (intval($max) === $max_value)\n\t\t\t$max = 9999999;\n\n\t\t$conditions = array(\n\t\t\t$table_name . '.' . $field_name . ' >=' => $min,\n\t\t\t$table_name . '.' . $field_name . ' <=' => $max);\n\t\t\n\t\treturn $conditions;\n\t}", "protected function whereBetween(Builder $builder, $where): string\n {\n $between = $where['negative'] ? 'not between' : 'between';\n\n $min = $this->parameter(headItem($where['values']));\n $max = $this->parameter(lastItem($where['values']));\n\n return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max;\n }", "public static function isBetween($value, $min, $max)\n {\n return $value >= $min && $value <= $max;\n }", "public function propertyBetween($property, $min, $max)\n {\n $this->search[] = $this->dbFieldName($property) . ' BETWEEN ' . $this->addParameter($min) . ' AND ' . $this->addParameter($max);\n }", "public function addNotBetween($column, $start, $stop, $operand = 'AND')\n {\n $this->addWhere($column . ' BETWEEN ' . $start . ' AND ' . $stop, $operand);\n }", "public static function between($n, $lower_bound, $upper_bound, $inclusive = true) {\n return $inclusive\n ? bccomp($n, $lower_bound) >= 0 && bccomp($n, $upper_bound) <= 0\n : bccomp($n, $lower_bound) > 0 && bccomp($n, $upper_bound) < 0;\n }", "public static function between(array $options )\r\n {\r\n extract($options);\r\n $query = self::where('start_time', '>=', $start_time)\r\n ->where('end_time', '<=', $end_time);\r\n if( ! empty($employee_id) )\r\n {\r\n $query->where('employee_id', $employee_id);\r\n }\r\n return $query->get();\r\n }", "public function valueBetween($value, $propertyFrom, $propertyTo)\n {\n $this->search[] = $this->addParameter($value) . ' BETWEEN ' . $this->dbFieldName($propertyFrom) . ' AND ' . $this->dbFieldName($propertyTo);\n }", "public function between($from, $to)\n {\n if (!is_int($from) && !is_float($from)) {\n throw new InvalidIntOrFloatException('from', $from);\n } elseif (!is_int($to) && !is_float($to)) {\n throw new InvalidIntOrFloatException('to', $to);\n } elseif ($from > $to) {\n throw new NumberNotLessStrictlyException('from', $from, $to);\n }\n\n if (!is_int($this->value) && !is_float($this->value)) {\n throw new InvalidIntOrFloatException($this->name, $this->value);\n } elseif ($this->value < $from || $this->value > $to) {\n throw new NumberNotBetweenException($this->name, $this->value, $from, $to);\n }\n\n return $this;\n }", "public function scopeBetweenDates($query, $from, $to)\n {\n return $query->whereBetween('date', [$from, $to]);\n }", "public function notBetween($column,$val1,$val2);", "public function orFilterBetween($column, $from, $to): Builder\n {\n return $this->addBetweenFilter($column, $from, $to, 'or');\n }", "protected function whereBetween(Builder $query, array $where)\n {\n $between = $where['not'] ? 'not between' : 'between';\n\n return $this->wrap($where['column']) . ' ' . $between . ' ? and ?';\n }", "public function selectBetween( $sStartDate, $sStopDate, Inx_Api_Recipient_RecipientContext $rc, $aAttributes );", "private static function isBetween(float $min, float $max, float $value) : bool\n {\n return $min <= $value && $max > $value;\n }", "public function isRangeIntoOtherRange(RangeDates $rangeCompare, //rango a buscar\n RangeDates $rangeSearch, //rANGO A COMPARAR \n $withBorder=true){\n yii::error($this->intofisrtCondition($rangeCompare, $rangeSearch, $withBorder));\n yii::error($this->intoSecondCondition($rangeCompare, $rangeSearch));\n yii::error( $this->intoThirdCondition($rangeCompare, $rangeSearch));\n yii::error($this->intoFourthCondition($rangeCompare, $rangeSearch) );\n return (\n $this->intofisrtCondition($rangeCompare, $rangeSearch, $withBorder) &&\n (\n $this->intoSecondCondition($rangeCompare, $rangeSearch) or\n $this->intoThirdCondition($rangeCompare, $rangeSearch) or\n $this->intoFourthCondition($rangeCompare, $rangeSearch)\n )\n );\n }", "function operator_options() {\n return array(\n 'between' => t('Is between'),\n );\n }", "private static function betweenCalculation(\n $value,\n $start,\n $end,\n bool $inclusive,\n int $decPl,\n bool $throwException = true\n ): bool {\n\n if (is_null($value)) {\n return false;\n }\n\n $start = static::extractBasicValue($start, $decPl, true, $throwException);\n $end = static::extractBasicValue($end, $decPl, true, $throwException);\n $min = $max = null;\n\n // between $start and $end (doesn't matter the order)\n if ((!is_null($start)) && (!is_null($end))) {\n\n // swap start and end if needed\n switch (bccomp($start, $end, $decPl)) {\n case -1:\n $min = $start;\n $max = $end;\n break;\n case 1:\n $min = $end;\n $max = $start;\n break;\n default: // case 0:\n $min = $max = $start;\n }\n } elseif (!is_null($start)) { // > or >= $start\n $min = $start;\n } elseif (!is_null($end)) { // <= or < $end\n $max = $end;\n }\n\n // compare $value to the bounds\n if (\n (!is_null($min))\n && (!in_array(bccomp($value, $min, $decPl), ($inclusive ? [0, 1] : [1])))\n ) {\n return false;\n }\n if (\n (!is_null($max))\n && (!in_array(bccomp($value, $max, $decPl), ($inclusive ? [-1, 0] : [-1])))\n ) {\n return false;\n }\n\n return true;\n }", "public function isBetween(SortCode $start, SortCode $end)\n {\n return 0 <= $this->compareTo($start) && -1 === $this->compareTo($end);\n }", "protected function between($prop, $c_value)\n {\n $min=current($prop);\n $minr=next($prop);\n $maxr=next($prop);\n $max=end($prop);\n \n if($c_value < $min)\n return Evaluate::BAGGY_PLUS;\n elseIf($c_value >= $min && $c_value < $minr)\n return Evaluate::BAGGY;\n elseIf($c_value >= $minr && $c_value <= $maxr)\n return Evaluate::RECOMENDED;\n elseIf($c_value > $maxr && $c_value <= $max)\n return Evaluate::VERY_TIGHT;\n elseIf($c_value > $max)\n return Evaluate::VERY_TIGHT_PLUS;\n else\n return Evaluate::UNDEFINED;\n }", "function betweenIntRange($value, $params = array()) {\t\t\n\t\t$min = 0;\n\t\t$max = 255;\n\t\textract($params);\n\t\tif (is_array($value)) {\n\t\t\t$value = array_shift($value);\n\t\t}\n\t\tif (preg_match('/^[0-9]+$/', $value)) {\n\t\t\tif ($value >= $min && $value <= $max) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t\t\n\t\treturn false;\n\t}", "public function betweenDate( Carbon $fecha,\n Carbon $finicio,\n Carbon $ftermino,\n $withBorder=true){\n if($withBorder){\n return($fecha->greaterThanOrEqualTo($finicio) && \n $fecha->lessThanOrEqualTo($ftermino))?true:false;\n }else{\n return($fecha->greaterThan($finicio) && \n $fecha->lessThan($ftermino))?true:false; \n }\n \n }", "public function whereBetween($column, array $values, $boolean = 'and', $not = false) {\n $type = 'between';\n\n $this->wheres[] = compact('column', 'type', 'boolean', 'values', 'not');\n\n return $this;\n }", "public static function between(int $min, int $max, bool $inclusive = true): self\n {\n return new self($min, $max, $inclusive);\n }", "private function betweenFormatter($field)\n {\n return 'between:' . Project::attributeLengths()[$field]['min'] . ',' . Project::attributeLengths()[$field]['max'];\n }", "protected function compileHavingBetween($having): string\n {\n $between = $having['not'] ? 'not between' : 'between';\n\n $column = $this->wrap($having['column']);\n\n $min = $this->parameter(headItem($having['values']));\n $max = $this->parameter(lastItem($having['values']));\n\n return $having['boolean'].' '.$column.' '.$between.' '.$min.' and '.$max;\n }", "public function between($from=0, $to=10) {\n $this->__limit__ = array($to-$from, $from);\n return $this;\n }", "function cp_intIsBetween($number,$min,$max){\r\n if(!cp_str_isInt($number)){\r\n return false;\r\n }\r\n\r\n return $number >= $min && $number <= $max;\r\n}", "public function notBetween(string $column, $min, $max, $dataType = PDO::PARAM_STR) : NotBetweenCondition\n {\n return new NotBetweenCondition($column, $min, $max, $dataType);\n }", "public function whereBetween($column, array $values, $boolean = 'and', $not = false)\n {\n $type = 'between';\n\n $this->wheres[] = compact('column', 'type', 'boolean', 'values', 'not');\n\n return $this;\n }", "public function orHavingNotBetween(\n Closure | string $column,\n Closure | float | int | string | null $min,\n Closure | float | int | string | null $max\n ) : static {\n return $this->orHaving($column, 'NOT BETWEEN', $min, $max);\n }", "public function cpRange($tablename,$columnname,$startvalue,$endvalue=0,$param=0) {\n $sql= \"SELECT * FROM $tablename WHERE $columnname BETWEEN '$startvalue'\";\n if($endvalue!=0){\n \n $sql.= \" AND '$endvalue'\";}\n if($param!=0)\n {\n $d_id_key= key($param);\n $d_value= $param[$d_id_key];\n $sql.= \" AND $d_id_key>0\"; \n }\n elseif ($param=0) {\n $d_id_key= key($param);\n $d_value= $param[$d_id_key];\n $sql.= \" AND $d_id_key=0\"; \n \n }\n//print_r($sql);\n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n \n return $result;\n}", "public function whereBetweenColumns(Builder $builder, $where): string\n {\n $between = $where['negative'] ? 'not between' : 'between';\n\n $min = $this->wrap(headItem($where['values']));\n $max = $this->wrap(lastItem($where['values']));\n\n return $this->wrap($where['column']).' '.$between.' '.$min.' and '.$max;\n }", "protected final function _isBetweenMinAndMax($key,$value){\n\n if(($min = $this->getDefinitionValue($key,'min')) !== false && $value < $min){\n return $this->setError($key,\"`{$key}` must be greater than {$min}\");\n }//if\n\n if(($max = $this->getDefinitionValue($key,'max')) !== false && $value > $max){\n return $this->setError($key,\"`{$key}` must be less than {$max}\");\n }//if\n\n return true;\n\n }", "public function between($startDate, $endDate)\n {\n return 100.45;\n }", "public function addCondition($condition);", "public function whereBetween($column, iterable $values, $boolean = 'and', $not = false)\n {\n throw new NotImplementedException('whereBetween is not implemented in Crate');\n }", "public function inRange($age) {\r\n $lowerApplies = !isset($this->ageFrom) || $age >= $this->ageFrom;\r\n $upperApplies = !isset($this->ageTo) || $age <= $this->ageTo;\n\n return $lowerApplies && $upperApplies;\r\n }", "public function isInbetween(ilADT $a_adt_from, ilADT $a_adt_to)\n\t{\n\t\treturn ($this->isLarger($a_adt_from) &&\n\t\t\t$this->isSmaller($a_adt_to));\n\t}", "function is_within_date_range( $time, $range_start, $range_end ) {\n\tif ( ! is_int( $range_start ) ) {\n\t\t$range_start = strtotime( $range_start );\n\t}\n\n\tif ( ! is_int( $range_end ) ) {\n\t\t$range_end = strtotime( $range_end );\n\t}\n\n\treturn $time > $range_start && $time < $range_end;\n}", "public function dateBetween(string|int|float $message): self\n {\n return $this->addMessage(new DateBetween($message));\n }", "public function whereBetween($column, iterable $values, $boolean = 'and', $not = false)\n {\n $type = 'between';\n\n $this->wheres[] = compact('column', 'type', 'boolean', 'values', 'not');\n\n $this->addBinding($values, 'where');\n\n return $this;\n }", "public function whereBetween(string $field, array $value, string $boolean = 'must'): self\n\t{\n\t\t$this->wheres[$boolean][] = [\n\t\t\t'range' => [\n\t\t\t\t$field => [\n\t\t\t\t\t'gte' => $value[0],\n\t\t\t\t\t'lte' => $value[1],\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\treturn $this;\n\t}", "public static function lengthBetween($value, $min, $max, $message = '');", "private function intofisrtCondition(RangeDates $rangeCompare, \n RangeDates $rangeSearch,$withBorder=true){\n if($withBorder){\n return !($rangeCompare->finalDate->lessThanOrEqualTo($rangeSearch->initialDate) or\n $rangeCompare->initialDate->greaterThanOrEqualTo($rangeSearch->finalDate)); \n \n }else{\n return !($rangeCompare->finalDate->lessThan($rangeSearch->initialDate) or\n $rangeCompare->initialDate->greaterThan($rangeSearch->finalDate)); \n }\n }", "private function priceRange($query)\n {\n if(isset($this->price['max']))\n ($this->price['max'] == 0)? $query->where('price','>',$this->price['min']) : $query->whereBetween('price', [$this->price['min'], $this->price['max']]);\n\n }", "private function GetBetweenArray()\n {\n for(reset($this->dataArray); (list($key,$val)=each($this->dataArray)) !== false;)\n {\n if (($this->Date2MoreDate1($this->startPoint['Arrival']['Date'] . ' ' . $this->startPoint['Arrival']['Time'], $val['Arrival']['Date'] .' '. $val['Arrival']['Time']))\n && ($this->Date2MoreDate1($val['Arrival']['Date'] .' '. $val['Arrival']['Time'], $this->endPoint['Arrival']['Date'] . ' ' . $this->endPoint['Arrival']['Time'])))\n $this->BetweenStartEnd[] = $val;\n }\n }", "public function whereBetween($column, array $values, $boolean = 'and', $not = false)\n {\n if (($count = count($values)) != 2) {\n throw new InvalidArgumentException(\n \"Between clause requires exactly 2 values, {$count} given.\"\n );\n }\n\n return $this->callHook(__FUNCTION__, $this->packArgs(compact('column', 'values', 'boolean', 'not')));\n }", "public function orWhereBetween($field, array $values = [], $escape = null)\n {\n return $this->prepareWhereStatement($field, implode(' AND ', $values), 'OR ', $escape, 'between');\n }", "public function scopeWithinRange($query, $start, $end)\n {\n return $query->whereDate('metadata_order.value', '>=', $start)\n ->whereDate('metadata_order.value', '<=', $end);\n }", "public function getBetween($start, $end)\n {\n return $this->query()\n ->whereBetween('start_time', [$start, $end])\n ->get();\n }", "public function between(Carbon $start, Carbon $end)\n {\n return $this->formatResults($this->query($start, $end)->get());\n }", "public function within_bounds($date, $participant_id)\n\t{\n\t\t$this->db->where('participant_id', $participant_id);\n\t\t$this->db->where('from <=', $date);\n\t\t$this->db->where('to >', $date);\n\t\t$this->db->from('impediment');\n\t\treturn $this->db->count_all_results() > 0;\n\t}", "public static function between($subject, $from, $to)\n {\n if ($from === '' || $to === '') {\n return $subject;\n }\n\n return static::beforeLast(static::after($subject, $from), $to);\n }", "public function lengthBetween($lengthBetween, $error) {\n if ($this->_exist) {\n array_push($this->_constraints, ['type' => self::LENGTHBETWEEN, 'value' => $lengthBetween, 'message' => $error]);\n }\n\n return $this;\n }" ]
[ "0.7618862", "0.70177686", "0.6985537", "0.6812582", "0.6769521", "0.67358595", "0.67074317", "0.6643996", "0.65955675", "0.6585744", "0.6557343", "0.650944", "0.6469779", "0.6449288", "0.63812745", "0.6266433", "0.6228369", "0.6222674", "0.6047566", "0.6047566", "0.60289276", "0.5954956", "0.5953655", "0.59445953", "0.5934178", "0.5929603", "0.58884275", "0.5885849", "0.587904", "0.5867576", "0.5855487", "0.58524597", "0.584512", "0.5820412", "0.5810884", "0.5795552", "0.56959164", "0.56869215", "0.56849843", "0.5682465", "0.56776124", "0.56581086", "0.56564325", "0.5656338", "0.5625546", "0.5542429", "0.5522303", "0.5521351", "0.5495081", "0.5480962", "0.5460895", "0.5433534", "0.5416794", "0.53744173", "0.5369502", "0.53520286", "0.53443635", "0.53437567", "0.53355503", "0.5282358", "0.5278082", "0.5275388", "0.5272748", "0.52633286", "0.5251404", "0.52316797", "0.522911", "0.522452", "0.51775575", "0.5172987", "0.5160624", "0.5159687", "0.5158085", "0.515418", "0.5153278", "0.5133877", "0.5131174", "0.51303124", "0.5124533", "0.51201123", "0.5103884", "0.50682324", "0.50621575", "0.50609726", "0.50343436", "0.50210947", "0.501225", "0.50116235", "0.5007579", "0.50061285", "0.50044453", "0.49730754", "0.49586505", "0.4948765", "0.49423882", "0.4934943", "0.49249095", "0.4919694", "0.49188584", "0.4914202" ]
0.6181799
18
Add an "is null" condition.
public function is_null($column, $boolean = 'and', $not = false) { return $this->where_assoc(array($column => null), $boolean, $not); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isNull();", "abstract public function isNull();", "public function stdWrap_ifNullDeterminesNullValuesDataProvider() {}", "public function isNull() {\n $this->_action = 'IS NULL';\n $this->_value = '';\n \n return $this;\n }", "public function isNullCond(string $field, string $connector = \"AND\", bool $not = false);", "public function buildIsNull( $is_null=true );", "public function orNull();", "public function __null ( $sField )\n {\n return \"$sField IS NULL\";\n }", "public function isNull(): bool ;", "public function testconstructSQLClauseNullValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'null',\n 'lastname' => '!null',\n 'postcode' => '!NULL',\n 'address' => 'NULL'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname is null AND lastname is not null AND postcode is not NULL AND address is NULL\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "public function build__is_null( $is_null = true )\n\t{\n\t\treturn $is_null ? \" IS NULL \" : \" IS NOT NULL \";\n\t}", "public static function whereIsNull($parameter);", "public function __notnull ( $sField )\n {\n return \"$sField IS NOT NULL\";\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "private function cek_null($val,$field)\n { if (isset($val)){ return $this->ci->db->where($field, $val); } }", "public function isNull() {\n return $this->is(new Identical(null));\n }", "public function whereNull(String $col){\r\n $this->where->add($colName.\" IS NULL\");\r\n\r\n }", "public function compilarWhereNull(Builder $builder, $where)\n {\n return $where['boolean'] . \" {$this->colunize($where['column'])} is null\";\n \n }", "public static function isNull()\n {\n return new Matcher\\IsNull();\n }", "public static function whereNull($column);", "public function isNull(): bool\n {\n return $this->value === null;\n }", "public function testWhereNotEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '!=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n\n $query = (new WhereBuilder($this->mockConnection))->where('field', '<>', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "protected function whereNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is null';\n }", "public static function isNotNull()\n {\n return self::logicalNot(self::isNull());\n }", "function isNullable(): bool;", "public function isNullable(): ?bool;", "public function isNull()\n {\n return null === $this->value;\n }", "public function hasNullValue(){\n return $this->_has(1);\n }", "public function whereNull($fields);", "public function isNull(): bool\n {\n return $this->phpType === self::NULL;\n }", "private function varIsNULL(): void {\r\n\t\t$nullTable = '<table class=\"dBug_table dBug_null\">';\r\n\t\t$nullTable .= '<tr><td class=\"dBug_nullHeader\">NULL Variable</td></tr>'.\"\\n\".'<tr>'.\"\\n\";\r\n\t\t$nullTable .= '</table>'.\"\\n\";\r\n\t\techo $nullTable;\r\n\t}", "public function notNull() {\n $this->_action = 'IS NOT NULL';\n $this->_value = '';\n \n return $this;\n }", "public function testWhereEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "protected function nullFunc() {\n return true;\n }", "public static function notNull($input) {\n return $input === null;\n }", "public function clerk_filter_null_attributes( $var ) {\n\t\treturn ( null !== $var && false !== $var && '' !== $var );\n\t}", "public function is_null(): bool\n {\n return $this->is_null;\n }", "static function isNull()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::isNull', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testIsNull() {\n\t\t$result = _::isNull(null);\n\t\t$this->assertTrue($result);\n\n\t\t// test that false is not null\n\t\t$result = _::isNull(false);\n\t\t$this->assertFalse($result);\n\t}", "public function isNullable()\n {\n\treturn $this->isNullable && true;\n }", "public function havingIsNull($field);", "protected function escapeNULL()\n {\n return 'NULL';\n }", "public function getSqlFilter(Mouf_DBConnection $dbConnection) {\n\t\treturn $this->columnName.\" IS NULL\";\n\t}", "function isnull($var): Closure\n{\n return function () use ($var): bool {\n return is_null($var);\n };\n}", "function null($input)\n{\n return ($input != NULL || $input!='')? $input : \" -- \";\n}", "function pseudoTypeNull(null $var = null) {}", "public function allowsNull(): bool\n {\n if (! $this->hasType()) {\n return true;\n }\n\n return $this->node->type instanceof NullableType;\n }", "public function isNull(string|int|float $message): self\n {\n return $this->addMessage(new IsNull($message));\n }", "public function is_null() { return is_null($this->obj); }", "public function where_null($name, $state=true)\n {\n $this->where[] = sprintf('%s %s null', self::quote_name($name), $state ? 'is': 'is not');\n return $this;\n }", "protected function whereNull(Builder $query, $where)\n {\n return $this->wrap($where['column']).' is null';\n }", "public function notnull()\n {\n return self::$driver->notnull();\n }", "public function isNotNull();", "public static function null();", "static function unittest_nestedConditions () {\n PhlintTest::assertNoIssues('\n $foo = null;\n if (is_null($foo))\n if (true === true)\n if ($foo) {}\n ');\n }", "protected function whereNull(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' is null';\n }", "public function isNull()\n\t{\n\t\treturn $this->unix ? false : true;\t \n\t}", "private function _isNull() {\n if (is_null($this->value)) {\r\n return true;\r\n }\n if (empty($this->value) && (in_array($this->type, array('multiple', 'ordered', 'string')))) {\n return true;\n }\n return false;\n }", "public function isNull($propertyName)\n {\n if ($this->$propertyName instanceof Zood_Entity_Null) {\n return true;\n } else {\n return false;\n }\n }", "function is_eq_null($object)\n{\n\treturn is_null($object) || ($object instanceof NullObject);\n}", "function date_is_null( $p_date ) {\n\treturn $p_date == date_get_null();\n}", "public function it_always_returns_null()\n {\n $object = new Testee(self::TEST_NULL_VALUE);\n $this->assertEquals(null, $object->getValue());\n }", "function o_isNull($value) {\n\t\t\treturn Obj::singleton()->isNull($value);\n\t\t}", "public function where_not_null($name)\n {\n return $this->where_null($name, false);\n }", "function tep_not_null ($value) {\n\treturn !empty ($value) && trim ($value);\n}", "public function havingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '<=>', $value);\n }", "public final function isNullAllowed($fld)\n {\n return $this->columns->{$fld}->null == 1 ? true : false;\n }", "public function testMissingParameterAddCheckNull() {\n $this->pingdom->addCheck(null);\n }", "public function __setNullCallback(\\Closure $callback) {\n\t\t$this->nullCallback = $callback;\n\t}", "protected function get_formatted_null(): string\n\t{\n\t\treturn $this->null ? 'NULL' : 'NOT NULL';\n\t}", "public function havingIsNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NULL');\n }", "public function isNullValue($value) {\n\t\treturn ($value instanceof \\DOMElement) ? $this->isNodeNull($value) : is_null($value);\n\t}", "public function orHavingIsNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NULL');\n }", "public function getCanBeNull() {\n return $this->__isNullAllowed;\n }", "function is_not_null( $value )\n {\n if ( is_array( $value ) ) {\n return ( !empty( $value['from'] ) ) || ( !empty( $value['to'] ) );\n } else {\n return !empty( $value );\n }\n }", "function ifnull(...$args)\n{\n\t$data = array_shift($args);\n\t\n\tif( count($args) == 0 )\n\t\tScavixWDF\\WdfException::Raise(\"ifnull needs at least one argument\");\n\t\n\tif( is_array($data) )\n\t\t$data = (object)$data;\n\tif( !is_object($data) )\n\t{\n\t\tforeach( $args as $arg )\n\t\t\tif( $arg !== null )\n\t\t\t\treturn $arg;\n\t\treturn null;\n\t}\n\tforeach( $args as $n )\n\t\tif( isset($data->$n) && $data->$n !== null )\n\t\t\treturn $data->$n;\n\treturn null;\n}", "function is_not_null($string) {\n\tif (($string==='') || ($string===false) || ($string===null)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function checkNull($value)\n {\n return $this->checkHasType($value, 'NULL');\n }", "protected function _translateIsNull(\n string $datfield,\n Query $query,\n JsonTypeMap $jsonTypes\n ): QueryExpression {\n /** @phpstan-ignore-next-line */\n $datfield = (string)$this->translateDatField($datfield);\n $ignoreMissingPath = $this->_getQueryOptions($query, 'ignoreMissingPath', false);\n\n return $ignoreMissingPath ?\n $query->newExpr(\"{$datfield} = CAST('null' AS JSON)\") :\n $query->newExpr()->or([\n \"{$datfield} IS\" => null,\n $query->newExpr(\"{$datfield} = CAST('null' AS JSON)\"),\n ]);\n }", "function sql_check_null_or_empty($rs, $col_name) {\r\n\t\r\n\tif(trim($rs[\"$col_name\"])!=\"\"){\r\n\t\t$null_or_emoty_sql= $col_name .\"='$rs[$col_name]'\";\r\n\t}else{\r\n\t\t$null_or_emoty_sql=\"(\" . $col_name .\" is NULL OR \" . $col_name . \"='')\";\r\n\t}\r\n\t\r\n\treturn $null_or_emoty_sql;\r\n}", "public function cond(SingleCond $cond = null)\n {\n if(null === $cond)\n {\n return $this->child('cond');\n }\n return $this->child('cond', $cond);\n }", "public static function null(string $column, $not = false): Condition\n {\n $self = (new Condition())->column($column);\n return $not ? $self->isNotNull() : $self->isNull();\n }", "protected function whereNotNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is not null';\n }", "public function isNodeNull(\\DOMElement $node) {\n\t\treturn $node->hasAttributeNS(self::NIL_URI, self::NULL_VALUE);\n\t}", "public function orHavingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=>', $value);\n }", "function isNull($obj)\n\t{\n\t\tif (is_null($obj) || (strlen(trim($obj))==0) || empty($obj)) \n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE; \n\t}", "public function testCastValueNullMissingValues()\n {\n $schema = new Schema((object) [\n 'fields' => [\n ['name' => 'name', 'type' => 'number'],\n ],\n 'missingValues' => ['null'],\n ]);\n $this->assertSame(['name' => null], $schema->castRow(['name' => 'null']));\n }", "public function testSelectWithNullWhereParameter()\n {\n $this->db->select(\"test\", new DBField('id'), null);\n $this->assertEquals(\"SELECT `id` FROM test\", (string) $this->db);\n }", "public function testSetNullData()\n {\n $this->document->setNullData();\n\n $expected = <<<EOL\n {\n \"data\" : null\n }\nEOL;\n $this->check($expected);\n }", "public function isNullable()\n {\n return $this->nullable;\n }", "protected function transformNULLs($value)\n {\n return ($value === \"NULL\" || $value === \"null\") ? null : $value;\n }", "function isNotNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNotNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notNULL, $y, $and, ...$args);\n return $expression;\n }", "public static function CheckNull($value = null)\n\t{\n\t\treturn ($value == null) ? '' : $value;\n\t}", "public function isNull()\n {\n if (!is_null($this->value)) {\n throw new InvalidNullException($this->name, $this->value);\n }\n\n return $this;\n }", "public function set_null($value = '', $force_null = FALSE) {\n if ($force_null == TRUE && ($value === 0 || $value === '0')) {\n return NULL;\n }\n\n return $value == '' || $value == '<br>' ? NULL : $value;\n //return $value == '' ? NULL : $value;\n }", "protected function _translateIsNotNull(string $datfield, Query $query, JsonTypeMap $jsonTypes): QueryExpression\n {\n /** @phpstan-ignore-next-line */\n $datfield = (string)$this->translateDatField($datfield);\n\n return $query->newExpr(\"{$datfield} <> CAST('null' AS JSON)\");\n }", "public function testIsNullBlank()\n {\n $this->assertTrue(StringUtils::isBlank(null));\n }", "public function testGetValueNull()\n {\n $eavDocument = new EavDocument();\n $value = $eavDocument->getValue('non_existent');\n\n $this->assertNull($value);\n }" ]
[ "0.65697867", "0.65447235", "0.64167327", "0.6376059", "0.6356569", "0.61236376", "0.6087453", "0.60492355", "0.6047997", "0.60405314", "0.5972576", "0.58382225", "0.581043", "0.57390684", "0.57390684", "0.57321024", "0.56990486", "0.5695177", "0.5599168", "0.5595626", "0.55927706", "0.55919236", "0.5589714", "0.5580358", "0.55788016", "0.5575117", "0.55669767", "0.5537263", "0.5528639", "0.55280346", "0.55202264", "0.55151904", "0.5511323", "0.5490564", "0.54786", "0.5415068", "0.53933305", "0.53570294", "0.53539777", "0.5349068", "0.5331595", "0.5327563", "0.5291265", "0.5284328", "0.5283082", "0.52684516", "0.5264172", "0.52582556", "0.524591", "0.5217429", "0.51975733", "0.5188774", "0.517615", "0.51566267", "0.51416516", "0.5140618", "0.5135195", "0.5132203", "0.5112825", "0.51124054", "0.50875485", "0.50607884", "0.5046409", "0.5042135", "0.50417745", "0.5039658", "0.5036402", "0.50170344", "0.5005793", "0.49994257", "0.49952808", "0.4989524", "0.49444783", "0.49233657", "0.49224266", "0.49097538", "0.48986736", "0.48849958", "0.48840487", "0.48673195", "0.486123", "0.48578757", "0.4853999", "0.48262864", "0.48255628", "0.47910714", "0.4787081", "0.47861752", "0.47837895", "0.47814354", "0.4779983", "0.47784972", "0.47637388", "0.47637388", "0.47618276", "0.4751737", "0.47448057", "0.47419158", "0.47399187", "0.47121486" ]
0.47900718
86
Add an "is null" condition.
public function is_not_null($column, $boolean = 'and') { return $this->where_assoc(array($column => null), $boolean, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isNull();", "abstract public function isNull();", "public function stdWrap_ifNullDeterminesNullValuesDataProvider() {}", "public function isNull() {\n $this->_action = 'IS NULL';\n $this->_value = '';\n \n return $this;\n }", "public function isNullCond(string $field, string $connector = \"AND\", bool $not = false);", "public function buildIsNull( $is_null=true );", "public function orNull();", "public function __null ( $sField )\n {\n return \"$sField IS NULL\";\n }", "public function isNull(): bool ;", "public function testconstructSQLClauseNullValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'null',\n 'lastname' => '!null',\n 'postcode' => '!NULL',\n 'address' => 'NULL'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname is null AND lastname is not null AND postcode is not NULL AND address is NULL\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "public function build__is_null( $is_null = true )\n\t{\n\t\treturn $is_null ? \" IS NULL \" : \" IS NOT NULL \";\n\t}", "public static function whereIsNull($parameter);", "public function __notnull ( $sField )\n {\n return \"$sField IS NOT NULL\";\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "private function cek_null($val,$field)\n { if (isset($val)){ return $this->ci->db->where($field, $val); } }", "public function isNull() {\n return $this->is(new Identical(null));\n }", "public function whereNull(String $col){\r\n $this->where->add($colName.\" IS NULL\");\r\n\r\n }", "public function compilarWhereNull(Builder $builder, $where)\n {\n return $where['boolean'] . \" {$this->colunize($where['column'])} is null\";\n \n }", "public static function isNull()\n {\n return new Matcher\\IsNull();\n }", "public static function whereNull($column);", "public function testWhereNotEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '!=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n\n $query = (new WhereBuilder($this->mockConnection))->where('field', '<>', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function isNull(): bool\n {\n return $this->value === null;\n }", "protected function whereNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is null';\n }", "public static function isNotNull()\n {\n return self::logicalNot(self::isNull());\n }", "function isNullable(): bool;", "public function isNullable(): ?bool;", "public function isNull()\n {\n return null === $this->value;\n }", "public function whereNull($fields);", "public function hasNullValue(){\n return $this->_has(1);\n }", "public function isNull(): bool\n {\n return $this->phpType === self::NULL;\n }", "private function varIsNULL(): void {\r\n\t\t$nullTable = '<table class=\"dBug_table dBug_null\">';\r\n\t\t$nullTable .= '<tr><td class=\"dBug_nullHeader\">NULL Variable</td></tr>'.\"\\n\".'<tr>'.\"\\n\";\r\n\t\t$nullTable .= '</table>'.\"\\n\";\r\n\t\techo $nullTable;\r\n\t}", "public function notNull() {\n $this->_action = 'IS NOT NULL';\n $this->_value = '';\n \n return $this;\n }", "public function testWhereEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "protected function nullFunc() {\n return true;\n }", "public static function notNull($input) {\n return $input === null;\n }", "public function clerk_filter_null_attributes( $var ) {\n\t\treturn ( null !== $var && false !== $var && '' !== $var );\n\t}", "public function is_null(): bool\n {\n return $this->is_null;\n }", "static function isNull()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::isNull', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testIsNull() {\n\t\t$result = _::isNull(null);\n\t\t$this->assertTrue($result);\n\n\t\t// test that false is not null\n\t\t$result = _::isNull(false);\n\t\t$this->assertFalse($result);\n\t}", "public function isNullable()\n {\n\treturn $this->isNullable && true;\n }", "public function havingIsNull($field);", "protected function escapeNULL()\n {\n return 'NULL';\n }", "public function getSqlFilter(Mouf_DBConnection $dbConnection) {\n\t\treturn $this->columnName.\" IS NULL\";\n\t}", "function isnull($var): Closure\n{\n return function () use ($var): bool {\n return is_null($var);\n };\n}", "function null($input)\n{\n return ($input != NULL || $input!='')? $input : \" -- \";\n}", "function pseudoTypeNull(null $var = null) {}", "public function allowsNull(): bool\n {\n if (! $this->hasType()) {\n return true;\n }\n\n return $this->node->type instanceof NullableType;\n }", "public function isNull(string|int|float $message): self\n {\n return $this->addMessage(new IsNull($message));\n }", "public function is_null() { return is_null($this->obj); }", "public function where_null($name, $state=true)\n {\n $this->where[] = sprintf('%s %s null', self::quote_name($name), $state ? 'is': 'is not');\n return $this;\n }", "protected function whereNull(Builder $query, $where)\n {\n return $this->wrap($where['column']).' is null';\n }", "public function notnull()\n {\n return self::$driver->notnull();\n }", "public function isNotNull();", "static function unittest_nestedConditions () {\n PhlintTest::assertNoIssues('\n $foo = null;\n if (is_null($foo))\n if (true === true)\n if ($foo) {}\n ');\n }", "public static function null();", "protected function whereNull(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' is null';\n }", "public function isNull()\n\t{\n\t\treturn $this->unix ? false : true;\t \n\t}", "private function _isNull() {\n if (is_null($this->value)) {\r\n return true;\r\n }\n if (empty($this->value) && (in_array($this->type, array('multiple', 'ordered', 'string')))) {\n return true;\n }\n return false;\n }", "public function isNull($propertyName)\n {\n if ($this->$propertyName instanceof Zood_Entity_Null) {\n return true;\n } else {\n return false;\n }\n }", "function is_eq_null($object)\n{\n\treturn is_null($object) || ($object instanceof NullObject);\n}", "function date_is_null( $p_date ) {\n\treturn $p_date == date_get_null();\n}", "public function it_always_returns_null()\n {\n $object = new Testee(self::TEST_NULL_VALUE);\n $this->assertEquals(null, $object->getValue());\n }", "public function where_not_null($name)\n {\n return $this->where_null($name, false);\n }", "function o_isNull($value) {\n\t\t\treturn Obj::singleton()->isNull($value);\n\t\t}", "function tep_not_null ($value) {\n\treturn !empty ($value) && trim ($value);\n}", "public function havingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '<=>', $value);\n }", "public final function isNullAllowed($fld)\n {\n return $this->columns->{$fld}->null == 1 ? true : false;\n }", "public function testMissingParameterAddCheckNull() {\n $this->pingdom->addCheck(null);\n }", "public function __setNullCallback(\\Closure $callback) {\n\t\t$this->nullCallback = $callback;\n\t}", "protected function get_formatted_null(): string\n\t{\n\t\treturn $this->null ? 'NULL' : 'NOT NULL';\n\t}", "public function havingIsNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NULL');\n }", "public function isNullValue($value) {\n\t\treturn ($value instanceof \\DOMElement) ? $this->isNodeNull($value) : is_null($value);\n\t}", "public function orHavingIsNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NULL');\n }", "public function getCanBeNull() {\n return $this->__isNullAllowed;\n }", "function is_not_null( $value )\n {\n if ( is_array( $value ) ) {\n return ( !empty( $value['from'] ) ) || ( !empty( $value['to'] ) );\n } else {\n return !empty( $value );\n }\n }", "function ifnull(...$args)\n{\n\t$data = array_shift($args);\n\t\n\tif( count($args) == 0 )\n\t\tScavixWDF\\WdfException::Raise(\"ifnull needs at least one argument\");\n\t\n\tif( is_array($data) )\n\t\t$data = (object)$data;\n\tif( !is_object($data) )\n\t{\n\t\tforeach( $args as $arg )\n\t\t\tif( $arg !== null )\n\t\t\t\treturn $arg;\n\t\treturn null;\n\t}\n\tforeach( $args as $n )\n\t\tif( isset($data->$n) && $data->$n !== null )\n\t\t\treturn $data->$n;\n\treturn null;\n}", "function is_not_null($string) {\n\tif (($string==='') || ($string===false) || ($string===null)) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function checkNull($value)\n {\n return $this->checkHasType($value, 'NULL');\n }", "protected function _translateIsNull(\n string $datfield,\n Query $query,\n JsonTypeMap $jsonTypes\n ): QueryExpression {\n /** @phpstan-ignore-next-line */\n $datfield = (string)$this->translateDatField($datfield);\n $ignoreMissingPath = $this->_getQueryOptions($query, 'ignoreMissingPath', false);\n\n return $ignoreMissingPath ?\n $query->newExpr(\"{$datfield} = CAST('null' AS JSON)\") :\n $query->newExpr()->or([\n \"{$datfield} IS\" => null,\n $query->newExpr(\"{$datfield} = CAST('null' AS JSON)\"),\n ]);\n }", "function sql_check_null_or_empty($rs, $col_name) {\r\n\t\r\n\tif(trim($rs[\"$col_name\"])!=\"\"){\r\n\t\t$null_or_emoty_sql= $col_name .\"='$rs[$col_name]'\";\r\n\t}else{\r\n\t\t$null_or_emoty_sql=\"(\" . $col_name .\" is NULL OR \" . $col_name . \"='')\";\r\n\t}\r\n\t\r\n\treturn $null_or_emoty_sql;\r\n}", "public function cond(SingleCond $cond = null)\n {\n if(null === $cond)\n {\n return $this->child('cond');\n }\n return $this->child('cond', $cond);\n }", "public static function null(string $column, $not = false): Condition\n {\n $self = (new Condition())->column($column);\n return $not ? $self->isNotNull() : $self->isNull();\n }", "protected function whereNotNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is not null';\n }", "public function isNodeNull(\\DOMElement $node) {\n\t\treturn $node->hasAttributeNS(self::NIL_URI, self::NULL_VALUE);\n\t}", "public function orHavingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=>', $value);\n }", "public function is_null($column, $boolean = 'and', $not = false)\r\n {\r\n return $this->where_assoc(array($column => null), $boolean, $not);\r\n }", "public function testCastValueNullMissingValues()\n {\n $schema = new Schema((object) [\n 'fields' => [\n ['name' => 'name', 'type' => 'number'],\n ],\n 'missingValues' => ['null'],\n ]);\n $this->assertSame(['name' => null], $schema->castRow(['name' => 'null']));\n }", "public function testSelectWithNullWhereParameter()\n {\n $this->db->select(\"test\", new DBField('id'), null);\n $this->assertEquals(\"SELECT `id` FROM test\", (string) $this->db);\n }", "function isNull($obj)\n\t{\n\t\tif (is_null($obj) || (strlen(trim($obj))==0) || empty($obj)) \n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE; \n\t}", "public function testSetNullData()\n {\n $this->document->setNullData();\n\n $expected = <<<EOL\n {\n \"data\" : null\n }\nEOL;\n $this->check($expected);\n }", "protected function transformNULLs($value)\n {\n return ($value === \"NULL\" || $value === \"null\") ? null : $value;\n }", "public function isNullable()\n {\n return $this->nullable;\n }", "function isNotNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNotNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notNULL, $y, $and, ...$args);\n return $expression;\n }", "public static function CheckNull($value = null)\n\t{\n\t\treturn ($value == null) ? '' : $value;\n\t}", "public function isNull()\n {\n if (!is_null($this->value)) {\n throw new InvalidNullException($this->name, $this->value);\n }\n\n return $this;\n }", "public function set_null($value = '', $force_null = FALSE) {\n if ($force_null == TRUE && ($value === 0 || $value === '0')) {\n return NULL;\n }\n\n return $value == '' || $value == '<br>' ? NULL : $value;\n //return $value == '' ? NULL : $value;\n }", "protected function _translateIsNotNull(string $datfield, Query $query, JsonTypeMap $jsonTypes): QueryExpression\n {\n /** @phpstan-ignore-next-line */\n $datfield = (string)$this->translateDatField($datfield);\n\n return $query->newExpr(\"{$datfield} <> CAST('null' AS JSON)\");\n }", "public function testIsNullBlank()\n {\n $this->assertTrue(StringUtils::isBlank(null));\n }", "public function testGetValueNull()\n {\n $eavDocument = new EavDocument();\n $value = $eavDocument->getValue('non_existent');\n\n $this->assertNull($value);\n }" ]
[ "0.6566539", "0.6541958", "0.6416355", "0.637279", "0.63552094", "0.61231154", "0.6088416", "0.604758", "0.6045367", "0.60411054", "0.59728914", "0.5837128", "0.580962", "0.5739185", "0.5739185", "0.57305175", "0.5695955", "0.5693976", "0.56001157", "0.5593383", "0.55915934", "0.5590333", "0.5587904", "0.558122", "0.5577012", "0.55746317", "0.55662256", "0.5532969", "0.552691", "0.55256754", "0.5517862", "0.5515332", "0.5509898", "0.54906356", "0.5477607", "0.5412796", "0.539215", "0.5354605", "0.5351856", "0.5347651", "0.53294724", "0.53256375", "0.52925617", "0.5283639", "0.5283631", "0.5268522", "0.5265581", "0.52559215", "0.52436507", "0.52145547", "0.5197932", "0.5188907", "0.5175024", "0.5155756", "0.51425505", "0.514075", "0.51356506", "0.5130827", "0.5111362", "0.5111058", "0.5085935", "0.5059099", "0.50443697", "0.5041305", "0.50395864", "0.50392586", "0.5035714", "0.5015484", "0.5006555", "0.4999426", "0.49950665", "0.49878457", "0.4941064", "0.49229845", "0.4920324", "0.49072054", "0.48989746", "0.48848873", "0.48814932", "0.48680615", "0.48615617", "0.48590884", "0.48547015", "0.48280093", "0.48235196", "0.47915834", "0.47908354", "0.47857684", "0.4784861", "0.47846153", "0.4780863", "0.47785482", "0.4777464", "0.47648403", "0.47648403", "0.47606206", "0.47477192", "0.47447997", "0.47434157", "0.47385797", "0.47101837" ]
0.0
-1
Add a "where date" to the query.
public function date($column, $date, $boolean = 'and', $not = false) { return $this->where('date('.$column.') = ?', $date, $boolean, $not); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpfc_temp_filter_where( $where = '' ) {\n\t \t$where .= \" AND post_date >= '\".date(\"Y-m-d\", $_REQUEST['start']).\"' AND post_date < '\".date(\"Y-m-d\", $_REQUEST['end']).\"'\";\n\t \treturn $where;\n\t }", "function filter_where($where = '') {\n $postid = get_the_ID();\n $format = 'Y-m-d';\n $publish_date = get_the_date( $format, $postid);\n\n $where .= \" AND post_date <= '\" . $publish_date . \"'\";\n\n return $where;\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function filter_where($where = '') {\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-30 days')) . \"'\";\n return $where;\n }", "protected function whereDate(Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return $this->wrap($where['column']).'::date '.$where['operator'].' '.$value;\n }", "protected function whereDate(Builder $query, $where)\n {\n return $this->dateBasedWhere('date', $query, $where);\n }", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "function whereQuery() {\n // $arrDate1 = explode(\"-\", $bulantahunpenggajian);\n // $date1 = $arrDate1[0].'-'.$arrDate1[1].'-01';\n // $date2 = $arrDate1[0].'-'.$arrDate1[1].'-'.cal_days_in_month(CAL_GREGORIAN, $arrDate1[1], $arrDate1[0]);\n \n // $wer = \" A.MONTH = '\".$arrDate1[1].\"' AND A.YEAR = \".$arrDate1[0].\"\";\n \n // return $wer;\n return '';\n }", "function filter_where( $where = '' ) {\r\n\t$where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-99930 days')) . \"'\";\r\n\treturn $where;\r\n}", "protected function getWhereClause() {}", "protected function user_where_clause() {}", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "protected function dateBasedWhere(string $type, Builder $query, array $where)\n {\n $value = $this->parameter($where['value']);\n\n return $type . '(' . $this->wrap($where['column']) . ') ' . $where['operator'] . ' ' . $value;\n }", "function wck_fep_filter_auto_drafts_where( $where = '' ){\n\t\t// posts older than 12 hours\n\t\t$where .= \" AND post_date <= '\" . date('Y-m-d H:i:s', strtotime('-12 hours')) . \"'\";\n\t\treturn $where;\n\t}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "protected function whereDate(Builder $builder, $where): string\n {\n return $this->dateBasedWhere('date', $builder, $where);\n }", "protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and')\n {\n return $this->callHook(\"where{$type}\", $this->packArgs(compact('column', 'operator', 'value', 'boolean')));\n }", "public function statistics_ref_duration_where( $where ) {\n\t\t\tglobal $wpdb;\n\t\t\t$after_date = $this->request->get_param( 'after' );\n\t\t\t$before_date = $this->request->get_param( 'before' );\n\n\t\t\tif ( $after_date ) {\n\t\t\t\t$s_date = strtotime( $after_date );\n\t\t\t\t$where .= ( false !== $s_date ) ? $wpdb->prepare( ' AND statref.create_time >= %s', $s_date ) : '';\n\t\t\t}\n\n\t\t\tif ( $before_date ) {\n\t\t\t\t$e_date = strtotime( $before_date );\n\t\t\t\t$where .= ( false !== $e_date ) ? $wpdb->prepare( ' AND statref.create_time <= %s', $e_date ) : '';\n\t\t\t}\n\n\t\t\treturn $where;\n\t\t}", "function filter_where($where = '') {\n global $popular_days;\n //posts in the last X days\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-'.$popular_days.' days')) . \"'\";\n return $where;\n}", "public function addDateFilter()\n\t{\n\t\t$this->_addFilter(new DataGrid\\Filters\\DateFilter());\n\t\treturn $this->getFilter();\n\t}", "protected function getGeneralWhereClause() {}", "public function today($where = []){\n return $this->where($where);\n }", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "private function getQueryStringDate() {\n\t\tif($this->date) {\n\t\t\treturn $this->date . '['.$this->qType.']';\n\t\t}\n\t\t$startDate = (new DateTime('-14 days'))->format('Ymd');\n\t\t$endDate = (new DateTime('tomorrow'))->format('Ymd');\n\t\t$qDate = '`'.$this->qType.' > '.$startDate.' < '.$endDate;\n\t\treturn $qDate;\n\t}", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function whereDate($column, $operator, $value, $boolean = 'and')\n {\n return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean);\n }", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function addWhere($where)\n {\n $this->wheres[$where] = $where;\n }", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "function filterByDate($date) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_DATE);\n $this->setAdditionalProperty('date_filter_on', (string) $date);\n }", "private function filterDay()\n {\n try {\n if(empty($this->day)) {\n return;\n }\n\n $dayDT = new DateTime(DateHelper::parseDateTime($this->day), DateHelper::getSystemTimeZone());\n\n $endDT = clone $dayDT;\n $endDT->setTime(23,59,59);\n $end = $endDT->getTimestamp();\n\n $start = $dayDT->setTime(0,0,0)->getTimestamp();\n\n $this->query->andWhere(['<=', 'log_time', $end]);\n $this->query->andWhere(['>=', 'log_time', $start]);\n\n } catch (\\Exception $e) {\n Yii::error($e, 'admin');\n }\n }", "public static function posts_where( $where_sql, $query ) {\n\t\t\tglobal $wpdb;\n\n\t\t\t// if it's a true event query then we to setup where conditions\n\t\t\t// but only if we aren't grabbing a specific post\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t$query->tribe_is_event\n\t\t\t\t\t|| $query->tribe_is_event_category\n\t\t\t\t)\n\t\t\t\t&& empty( $query->query_vars['name'] )\n\t\t\t\t&& empty( $query->query_vars['p'] )\n\t\t\t) {\n\n\t\t\t\t$postmeta_table = self::postmeta_table( $query );\n\n\t\t\t\t$start_date = $query->get( 'start_date' );\n\t\t\t\t$end_date = $query->get( 'end_date' );\n\t\t\t\t$use_utc = Tribe__Events__Timezones::is_mode( 'site' );\n\t\t\t\t$site_tz = $use_utc ? Tribe__Events__Timezones::wp_timezone_string() : null;\n\n\t\t\t\t// Sitewide timezone mode: convert the start date - if set - to UTC\n\t\t\t\tif ( $use_utc && ! empty( $start_date ) ) {\n\t\t\t\t\t$start_date = Tribe__Events__Timezones::to_utc( $start_date, $site_tz );\n\t\t\t\t}\n\n\t\t\t\t// Sitewide timezone mode: convert the end date - if set - to UTC\n\t\t\t\tif ( $use_utc && ! empty( $end_date ) ) {\n\t\t\t\t\t$end_date = Tribe__Events__Timezones::to_utc( $end_date, $site_tz );\n\t\t\t\t}\n\n\t\t\t\t// we can't store end date directly because it messes up the distinct clause\n\t\t\t\t$event_end_date = apply_filters( 'tribe_events_query_end_date_column', 'tribe_event_end_date.meta_value' );\n\n\t\t\t\t// event start date\n\t\t\t\t$event_start_date = \"{$postmeta_table}.meta_value\";\n\n\t\t\t\t// build where conditionals for events if date range params are set\n\t\t\t\tif ( $start_date != '' && $end_date != '' ) {\n\t\t\t\t\t$start_clause = $wpdb->prepare( \"($event_start_date >= %s AND $event_start_date <= %s)\", $start_date, $end_date );\n\t\t\t\t\t$end_clause = $wpdb->prepare( \"($event_end_date >= %s AND $event_start_date <= %s )\", $start_date, $end_date );\n\t\t\t\t\t$within_clause = $wpdb->prepare( \"($event_start_date < %s AND $event_end_date >= %s )\", $start_date, $end_date );\n\t\t\t\t\t$where_sql .= \" AND ($start_clause OR $end_clause OR $within_clause)\";\n\t\t\t\t} else {\n\t\t\t\t\tif ( $start_date != '' ) {\n\t\t\t\t\t\t$start_clause = $wpdb->prepare( \"{$postmeta_table}.meta_value >= %s\", $start_date );\n\t\t\t\t\t\t$within_clause = $wpdb->prepare( \"({$postmeta_table}.meta_value <= %s AND $event_end_date >= %s )\", $start_date, $start_date );\n\t\t\t\t\t\t$where_sql .= \" AND ($start_clause OR $within_clause)\";\n\t\t\t\t\t\tif ( $query->is_singular() && $query->get( 'eventDate' ) ) {\n\t\t\t\t\t\t\t$tomorrow = date( 'Y-m-d', strtotime( $query->get( 'eventDate' ) . ' +1 day' ) );\n\t\t\t\t\t\t\t$tomorrow_clause = $wpdb->prepare( \"{$postmeta_table}.meta_value < %s\", $tomorrow );\n\t\t\t\t\t\t\t$where_sql .= \" AND $tomorrow_clause\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $end_date != '' ) {\n\t\t\t\t\t\t\t$where_sql .= ' AND ' . $wpdb->prepare( \"$event_end_date < %s\", $end_date );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tremove_filter( 'option_page_on_front', array( __CLASS__, 'default_page_on_front' ) );\n\n\t\t\treturn $where_sql;\n\t\t}", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "public function modifyWhere(&$sql, $table = 'listings')\n {\n if (!$this->geo_filter_data['applied_location']\n || !$this->geo_filter_data['is_filtering']\n ) {\n return;\n }\n\n if (!$sql) {\n $sql = &$GLOBALS['sql'];\n }\n\n $data_key = $table == 'accounts' ? 'location_account_fields' : 'location_listing_fields';\n $data = $this->geo_filter_data[$data_key];\n\n // Return if location search already performed from the search form\n if (strpos($sql, key($this->geo_filter_data[$data_key]))) {\n return;\n }\n\n foreach ($data as $field => $value) {\n if ($value) {\n $sql .= \"AND `T1`.`{$field}` = '{$value}' \";\n }\n }\n }", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "protected function dateBasedWhere($type, Builder $builder, $where): string\n {\n $value = $this->parameter($where['value']);\n\n return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "public function addWhere($condition)\n\t{\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\t\t$this->wheres[] = $condition;\n\t\treturn $this;\n\t}", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function addDateRangeQuery(sfWebRequest $request, Doctrine_Query $q = null)\n {\n if (!$q)\n {\n $q = $this->createQuery('p');\n }\n\n return $q;\n }", "public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }", "public function addWhere(Expression $expression, $type = AbstractSearchQuery::WHERE_AND);", "function channel_entries_sql_where($sql, &$channel)\n\t{\n\n\t\tif ( is_string( $this->EE->extensions->last_call ) === TRUE )\n\t\t{\n\t\t\t$sql\t= $this->EE->extensions->last_call;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tShould we proceed?\n\t\t/** ----------------------------------------*/\n\n\t\tif ( $this->EE->TMPL->fetch_param('date_field') === FALSE OR $this->EE->TMPL->fetch_param('date_field') == '' )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( ( $this->EE->TMPL->fetch_param('date_field_start') === FALSE OR $this->EE->TMPL->fetch_param('date_field_start') == '' ) AND ( $this->EE->TMPL->fetch_param('date_field_stop') === FALSE OR $this->EE->TMPL->fetch_param('date_field_stop') == '' ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( empty( $this->EE->TMPL->site_ids ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tLoop for site ids and add DB queries\n\t\t/** ----------------------------------------*/\n\n\t\t$sql_a\t= array();\n\n\t\tforeach ( $this->EE->TMPL->site_ids as $site_id )\n\t\t{\n\t\t\tif ( ! empty( $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ] ) )\n\t\t\t{\n\t\t\t\t$field_id\t= $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ];\n\n\t\t\t\t$sql_b\t= array();\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_start') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} >= '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_start') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\n\t\t\t\t}\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_stop') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} < '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_stop') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\t\t\t\t}\n\n\t\t\t\t$sql_a[]\t= implode( ' AND ', $sql_b );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $sql_a ) )\n\t\t{\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tPrepare the necessary DB join\n\t\t\t/** ----------------------------------------*/\n\n\t\t\tif ( strpos($sql, 'LEFT JOIN exp_channel_data') === FALSE )\n\t\t\t{\n\t\t\t\t$sql = str_replace( 'LEFT JOIN exp_members', 'LEFT JOIN exp_channel_data AS wd ON wd.entry_id = t.entry_id LEFT JOIN exp_members', $sql );\n\t\t\t}\n\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tAdd our new conditions\n\t\t\t/** ----------------------------------------*/\n\n\t\t\t$sql\t.= \" AND ( \" . implode( ' OR ', $sql_a ) . \" )\";\n\t\t}\n\n\t\t/*\n\t\tif ( $SESS->userdata('group_id') == '1' )\n\t\t{\n\t\t\techo \"Visible only to Super Admins<br /><br />\";\n\t\t\tprint_r( $sql );\n\t\t\techo \"<br /><br />Visible only to Super Admins\";\n\t\t}\n\t\t*/\n\t\treturn $sql;\n\t}", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "protected function whereDay(Builder $query, $where)\n {\n return $this->dateBasedWhere('day', $query, $where);\n }", "function get_date_where($max_levels=3)\n {\n global $page;\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $y = $date[CYEAR];\n $res = \" AND $this->date_field BETWEEN '$y-01-01' AND '$y-12-31 23:59:59'\";\n }\n\n if (isset($date[CWEEK]) and $date[CWEEK]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CWEEK]['sql'].'='.$date[CWEEK];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n if (empty($res))\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n }\n return $res;\n }", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "protected function addCommonViewFiltersForDate(QueryBuilder $qb)\n {\n if (null === $this->request) {\n return $qb;\n }\n $routeName = $this->request->get('_route');\n if (false !== strpos($routeName, 'edit')) {\n return $qb;\n }\n \n $parameters = $this->getViewQuickNavParametersForDate();\n foreach ($parameters as $k => $v) {\n if ($k == 'catId') {\n if (intval($v) > 0) {\n // single category filter\n $qb->andWhere('tblCategories.category = :category')\n ->setParameter('category', $v);\n }\n continue;\n }\n if ($k == 'catIdList') {\n // multi category filter\n $qb = $this->categoryHelper->buildFilterClauses($qb, 'date', $v);\n continue;\n }\n if (in_array($k, ['q', 'searchterm'])) {\n // quick search\n if (!empty($v)) {\n $qb = $this->addSearchFilter('date', $qb, $v);\n }\n continue;\n }\n \n if (is_array($v)) {\n continue;\n }\n \n // field filter\n if ((!is_numeric($v) && $v != '') || (is_numeric($v) && $v > 0)) {\n if ($k == 'workflowState' && substr($v, 0, 1) == '!') {\n $qb->andWhere('tbl.' . $k . ' != :' . $k)\n ->setParameter($k, substr($v, 1, strlen($v)-1));\n } elseif (substr($v, 0, 1) == '%') {\n $qb->andWhere('tbl.' . $k . ' LIKE :' . $k)\n ->setParameter($k, '%' . substr($v, 1) . '%');\n } else {\n $qb->andWhere('tbl.' . $k . ' = :' . $k)\n ->setParameter($k, $v);\n }\n }\n }\n \n $qb = $this->applyDefaultFiltersForDate($qb, $parameters);\n \n return $qb;\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "static function before($query) {\n\t\t$before = Input::get('before');\n\t\tif ($before != '') {\n\t\t\t$beforeDate = new \\DateTime($before);\n\t\t\t$query = $query->where('create_date', '<=', $beforeDate);\n\t\t}\n\t\treturn $query;\n\t}", "private function sql_whereAnd_fromTS()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS value\n $andWhere = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'sql.' ][ 'andWhere' ];\n\n if ( !empty( $andWhere ) )\n {\n $andWhere = \" AND \" . $andWhere;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function makeFilter_date($field, $date, $negate = false) {\r\n\t\treturn TodoyuSearchFilterHelper::makeFilter_date(self::TABLE, $field, $date, $negate);\r\n\t}", "abstract public function where(array $where);", "function setWhere($where) {\n $this->where = $where;\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function whereAdd($where,$clause)\n{\n\tif(!strlen($clause))\n\t\treturn $where;\n\tif(!strlen($where))\n\t\treturn $clause;\n\treturn \"(\".$where.\") and (\".$clause.\")\";\n}", "public function filterDataTable($query, $request)\n {\n if (isset($request['req']['from']) && $request['req']['from'] != '') {\n $query->whereDate('created_at', '>=', $request['req']['from']);\n }\n\n if (isset($request['req']['to']) && $request['req']['to'] != '') {\n $query->whereDate('created_at', '<=', $request['req']['to']);\n }\n\n if (isset($request['req']['type']) && $request['req']['type'] != '') {\n $query->where('type', '=', $request['req']['type']);\n }\n \n \n\n \n\n \n return $query;\n }", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "function get_occurs_within_where_clause($table_name, $rel_table, $start_ts_obj, $end_ts_obj, $field_name='date_start', $view){\n\t\tglobal $timedate;\n\t\n\t\t$start = clone $start_ts_obj;\n\t\t$end = clone $end_ts_obj;\n\n\t\t$field_date = $table_name.'.'.$field_name;\n\t\t$start_day = $GLOBALS['db']->convert(\"'{$start->asDb()}'\",'datetime');\n\t\t$end_day = $GLOBALS['db']->convert(\"'{$end->asDb()}'\",'datetime');\n\n\t\t$where = \"($field_date >= $start_day AND $field_date < $end_day\";\n\t\tif($rel_table != ''){\n\t\t\t$where .= \" AND $rel_table.accept_status != 'decline'\";\n\t\t}\n\n\t\t$where .= \")\";\n\t\treturn $where;\n\t}", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "protected function appendWhereString($string)\n {\n $this->whereString .= $string;\n return $this;\n }", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function get_date_where($max_levels=3)\n {\n global $page;\n\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $b = $date[CYEAR] . '-';\n $e = $date[CYEAR] . '-';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $b .= sprintf('%02d-', $date[CMONTH]);\n $e .= sprintf('%02d-', $date[CMONTH]);\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $b .= sprintf('%02d', $date[CDAY]);\n $e .= sprintf('%02d', $date[CDAY]);\n }\n else\n {\n $b .= '01';\n $e .= $this->get_all_days_in_month($date[CYEAR], $date[CMONTH]);\n }\n }\n else\n {\n $b .= '01-01';\n $e .= '12-31';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n $res = \" AND $this->date_field BETWEEN '$b' AND '$e 23:59:59'\" . $res;\n }\n else\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n return $res;\n }", "protected function _myDdateFilter($collection, $column)\n {\n /*if (!$value = $column->getFilter()->getValue()) {\n return $this;\n }\n $from = $filters['from'];\n $to = $filters['to'];\n if ($from) {\n $this->getCollection()->addFieldToFilter('main_table.ddate', array(\n 'gteq' => $from->toString('yyyy-MM-dd')\n ));\n }\n if ($to) {\n $this->getCollection()->addFieldToFilter('main_table.ddate', array(\n 'lteq' => $to->toString('yyyy-MM-dd')\n ));\n }*/\n if (!$value = $column->getFilter()->getValue()) {\n return $this;\n }\n $filters = $column->getFilter()->getValue();\n\n $from = $filters['from'];\n $to = $filters['to'];\n if($from)\n $this->getCollection()->addFieldToFilter('main_table.ddate', array('gteq' => $from->toString('yyyy-MM-dd')));\n if($to)\n $this->getCollection()->addFieldToFilter('main_table.ddate', array('lteq' => $to->toString('yyyy-MM-dd')));\n }", "final public function addWhere(YMKM_SQL_Entity_Where $s)\n {\n $this->doAddWhere($s);\n return $this;\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "function where($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['where'])) $this->query['where'] = array();\n\t$this->query['where'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public static function where(array $where);", "protected function addWhere( $query, $key, $extraValue )\n\t{\n\t\tif ( $extraValue === 'NULL' )\n\t\t{\n\t\t\t$query->whereNull( $key );\n\t\t}\n\t\telseif ( $extraValue === 'NOT_NULL' )\n\t\t{\n\t\t\t$query->whereNotNull( $key );\n\t\t}\n\t\telseif ( Str::startsWith( $extraValue, '!' ) )\n\t\t{\n\t\t\t$query->where( $key, '!=', mb_substr( $extraValue, 1 ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query->where( $key, $extraValue );\n\t\t}\n\t}", "private function tinydb_add_where($query)\n {\n return static::tinydb_add_where_for_pkey($this->get_id(), $query);\n }", "function setDateFilter($value) {\n return $this->setAdditionalProperty('date_filter', $value);\n }", "private function buildWhere($existing, $add)\n {\n if(empty($existing))\n return \"WHERE {$add} \";\n else\n return \"{$existing} AND {$add} \";\n }", "static function after($query) {\n\t\t$after = Input::get('after');\n\t\tif ($after != '') {\n\t\t\t$afterDate = new \\DateTime($after);\n\t\t\t$query = $query->where('create_date', '>=', $afterDate);\n\t\t}\n\t\treturn $query;\n\t}", "function _add_where_clause($where_clauses, $join)\n {\n $clauses = array();\n foreach ($where_clauses as $clause) {\n extract($clause);\n if ($this->object->has_column($column)) {\n $column = \"`{$column}`\";\n }\n if (!is_array($value)) {\n $value = array($value);\n }\n foreach ($value as $index => $v) {\n $v = $clause['type'] == 'numeric' ? $v : \"'{$v}'\";\n $value[$index] = $v;\n }\n if ($compare == 'BETWEEN') {\n $value = \"{$value[0]} AND {$value[1]}\";\n } else {\n $value = implode(', ', $value);\n if (strpos($compare, 'IN') !== FALSE) {\n $value = \"({$value})\";\n }\n }\n $clauses[] = \"{$column} {$compare} {$value}\";\n }\n $this->object->_where_clauses[] = implode(\" {$join} \", $clauses);\n }", "public function getFileFilterByDate($conn, $date){\n\t\t//preparo lo statement che mi ricava tutte le informazioni \n\t\t$sth = $conn->prepare(\"select * from Filmato_Presentazione where data_inizio >= :data_inizio or data_fine >= :data_fine limit 1\");\n\t\t$sth->bindParam(':data_inizio', $date, PDO::PARAM_STR);\n\t\t$sth->bindParam(':data_fine', $date, PDO::PARAM_STR);\n\t\t$sth->execute();\n\t\treturn $sth; \n\t}", "public function addConditionToQuery($query, array $condition)\n\t{\n\t\t$value = trim(array_get($condition, 'value'));\n\t\t$field = array_get($condition, 'field');\n\t\t\n\t\tif ('xref_id' == $field) {\n\t\t\t$field = 'objectID';\n\t\t}\n\t\t\n\t\tif (array_get($condition, 'filter')) {\n\t\t\tif (is_numeric($value)) {\n\t\t\t\t$query['query']['numericFilters'][] = \"{$field}={$value}\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query['query']['facetFilters'][] = \"{$field}:{$value}\";\n\t\t\t}\n\t\t}\n\t\telse if (array_get($condition, 'lat')) {\n\t\t\t$query['query']['aroundLatLng'] = array_get($condition, 'lat') . ',' . array_get($condition, 'long');\n\t\t\t$query['query']['aroundRadius'] = array_get($condition, 'distance');\n\t\t}\n\t\telse {\n\t\t\t$query['terms'] .= ' ' . $value;\n\t\t\t\n\t\t\tif (!empty($field) && '*' !== $field) {\n\t\t\t\t$field = is_array($field) ? $field : array($field);\n\t\t\t\t$query['query']['restrictSearchableAttributes'] = implode(',', $field);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $query;\n\t}", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "public function scopePublishedBefore($query, $date)\n {\n $query->where('created_at', '<=', $date);\n }", "public function updateQuery(AbstractSearch $searchManager, array $sql, \\wpdb $databaseAdapter)\n {\n\n $date = array(\n \"y\" => \"%\",\n \"m\" => \"%\",\n \"d\" => \"%\"\n );\n\n if ($year = get_query_var(\"year\")) {\n $date['y'] = $year;\n }\n\n if ($month = get_query_var(\"monthnum\")) {\n if ($month < 10) {\n $month = \"0\" . $month;\n }\n\n $date['m'] = $month;\n }\n\n if ($day = get_query_var(\"day\")) {\n $date['d'] = $day;\n }\n\n $formattedDate = implode(\"-\", $date);\n\n $sql['where'] .= $databaseAdapter->prepare(\"and p.post_date like '%s' \", $formattedDate);\n\n return $sql;\n }" ]
[ "0.6846684", "0.6713724", "0.66842854", "0.65861285", "0.6496779", "0.64480525", "0.6443426", "0.64316624", "0.63731253", "0.6287003", "0.6263355", "0.62250733", "0.62144685", "0.62063843", "0.61397207", "0.6050436", "0.6031684", "0.60042846", "0.60006547", "0.6000313", "0.5991623", "0.5954816", "0.59526074", "0.5951495", "0.59092516", "0.5886339", "0.5879139", "0.5864217", "0.5841473", "0.5818926", "0.5808391", "0.5805485", "0.57869685", "0.57770073", "0.57572085", "0.5746351", "0.5746056", "0.57318306", "0.57246554", "0.5690615", "0.5686666", "0.5651808", "0.5643243", "0.5643243", "0.56311274", "0.55899286", "0.55849427", "0.55642354", "0.55440044", "0.55115324", "0.5508477", "0.54990995", "0.5492234", "0.54767483", "0.5463828", "0.5422695", "0.5407326", "0.54041165", "0.5401697", "0.539549", "0.5392533", "0.5377906", "0.53728056", "0.53641844", "0.53599894", "0.535613", "0.53552973", "0.53549546", "0.5351851", "0.53449565", "0.53448355", "0.5340238", "0.53358537", "0.533369", "0.53216463", "0.53211415", "0.5320321", "0.53195333", "0.53152883", "0.5312661", "0.5308566", "0.5307076", "0.5298195", "0.5296766", "0.5283885", "0.5281403", "0.52797604", "0.52776724", "0.5277025", "0.5276237", "0.52747965", "0.52718425", "0.52694404", "0.5263858", "0.525126", "0.52476376", "0.5234632", "0.52319545", "0.52267706", "0.5223993" ]
0.5384564
61
Add a "where day" to the query.
public function day($column, $day, $boolean = 'and', $not = false) { return $this->where_assoc(array('day('.$column.')' => $day), $boolean, $not); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function filterDay()\n {\n try {\n if(empty($this->day)) {\n return;\n }\n\n $dayDT = new DateTime(DateHelper::parseDateTime($this->day), DateHelper::getSystemTimeZone());\n\n $endDT = clone $dayDT;\n $endDT->setTime(23,59,59);\n $end = $endDT->getTimestamp();\n\n $start = $dayDT->setTime(0,0,0)->getTimestamp();\n\n $this->query->andWhere(['<=', 'log_time', $end]);\n $this->query->andWhere(['>=', 'log_time', $start]);\n\n } catch (\\Exception $e) {\n Yii::error($e, 'admin');\n }\n }", "protected function whereDay(Builder $query, $where)\n {\n return $this->dateBasedWhere('day', $query, $where);\n }", "function wpfc_temp_filter_where( $where = '' ) {\n\t \t$where .= \" AND post_date >= '\".date(\"Y-m-d\", $_REQUEST['start']).\"' AND post_date < '\".date(\"Y-m-d\", $_REQUEST['end']).\"'\";\n\t \treturn $where;\n\t }", "protected function whereDay(Builder $builder, $where): string\n {\n return $this->dateBasedWhere('day', $builder, $where);\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "public static function outsideMeasurementsByDay($where, $day) {\n if (is_numeric($where)) $where = [ 'station_id' => $where ];\n if (is_object($where)) $where = [ 'station_id' => $where->{static::primaryKey()} ];\n foreach ($where as $key => $value) $wheres[] = '`' . $key . '` = ?';\n return Database::query('SELECT * FROM `outside_measurements` WHERE ' . implode(' AND ', $wheres) . ' AND `created_at` >= ? AND `created_at` < ? ORDER BY `created_at`', ...[ ...array_values($where), date('Y-m-d H:i:s', $day), date('Y-m-d H:i:s', $day + 24 * 60 * 60) ]);\n }", "public static function measurementsByDay($where, $day) {\n if (is_numeric($where)) $where = [ 'station_id' => $where ];\n if (is_object($where)) $where = [ 'station_id' => $where->{static::primaryKey()} ];\n foreach ($where as $key => $value) $wheres[] = '`' . $key . '` = ?';\n return Database::query('SELECT * FROM `measurements` WHERE ' . implode(' AND ', $wheres) . ' AND `created_at` >= ? AND `created_at` < ? ORDER BY `created_at`', ...[ ...array_values($where), date('Y-m-d H:i:s', $day), date('Y-m-d H:i:s', $day + 24 * 60 * 60) ]);\n }", "public function whereDay($column, $operator, $value, $boolean = 'and')\n {\n return $this->addDateBasedWhere('Day', $column, $operator, $value, $boolean);\n }", "public function today($where = []){\n return $this->where($where);\n }", "function wck_fep_filter_auto_drafts_where( $where = '' ){\n\t\t// posts older than 12 hours\n\t\t$where .= \" AND post_date <= '\" . date('Y-m-d H:i:s', strtotime('-12 hours')) . \"'\";\n\t\treturn $where;\n\t}", "public function filter_where($where = '') {\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-30 days')) . \"'\";\n return $where;\n }", "public function addWhere($where)\n {\n $this->wheres[$where] = $where;\n }", "function filter_where($where = '') {\n $postid = get_the_ID();\n $format = 'Y-m-d';\n $publish_date = get_the_date( $format, $postid);\n\n $where .= \" AND post_date <= '\" . $publish_date . \"'\";\n\n return $where;\n }", "protected function getWhereClause() {}", "function filter_where($where = '') {\n global $popular_days;\n //posts in the last X days\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-'.$popular_days.' days')) . \"'\";\n return $where;\n}", "protected function dateBasedWhere(string $type, Builder $query, array $where)\n {\n $value = $this->parameter($where['value']);\n\n return $type . '(' . $this->wrap($where['column']) . ') ' . $where['operator'] . ' ' . $value;\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "function whereQuery() {\n // $arrDate1 = explode(\"-\", $bulantahunpenggajian);\n // $date1 = $arrDate1[0].'-'.$arrDate1[1].'-01';\n // $date2 = $arrDate1[0].'-'.$arrDate1[1].'-'.cal_days_in_month(CAL_GREGORIAN, $arrDate1[1], $arrDate1[0]);\n \n // $wer = \" A.MONTH = '\".$arrDate1[1].\"' AND A.YEAR = \".$arrDate1[0].\"\";\n \n // return $wer;\n return '';\n }", "function channel_entries_sql_where($sql, &$channel)\n\t{\n\n\t\tif ( is_string( $this->EE->extensions->last_call ) === TRUE )\n\t\t{\n\t\t\t$sql\t= $this->EE->extensions->last_call;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tShould we proceed?\n\t\t/** ----------------------------------------*/\n\n\t\tif ( $this->EE->TMPL->fetch_param('date_field') === FALSE OR $this->EE->TMPL->fetch_param('date_field') == '' )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( ( $this->EE->TMPL->fetch_param('date_field_start') === FALSE OR $this->EE->TMPL->fetch_param('date_field_start') == '' ) AND ( $this->EE->TMPL->fetch_param('date_field_stop') === FALSE OR $this->EE->TMPL->fetch_param('date_field_stop') == '' ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( empty( $this->EE->TMPL->site_ids ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tLoop for site ids and add DB queries\n\t\t/** ----------------------------------------*/\n\n\t\t$sql_a\t= array();\n\n\t\tforeach ( $this->EE->TMPL->site_ids as $site_id )\n\t\t{\n\t\t\tif ( ! empty( $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ] ) )\n\t\t\t{\n\t\t\t\t$field_id\t= $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ];\n\n\t\t\t\t$sql_b\t= array();\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_start') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} >= '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_start') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\n\t\t\t\t}\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_stop') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} < '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_stop') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\t\t\t\t}\n\n\t\t\t\t$sql_a[]\t= implode( ' AND ', $sql_b );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $sql_a ) )\n\t\t{\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tPrepare the necessary DB join\n\t\t\t/** ----------------------------------------*/\n\n\t\t\tif ( strpos($sql, 'LEFT JOIN exp_channel_data') === FALSE )\n\t\t\t{\n\t\t\t\t$sql = str_replace( 'LEFT JOIN exp_members', 'LEFT JOIN exp_channel_data AS wd ON wd.entry_id = t.entry_id LEFT JOIN exp_members', $sql );\n\t\t\t}\n\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tAdd our new conditions\n\t\t\t/** ----------------------------------------*/\n\n\t\t\t$sql\t.= \" AND ( \" . implode( ' OR ', $sql_a ) . \" )\";\n\t\t}\n\n\t\t/*\n\t\tif ( $SESS->userdata('group_id') == '1' )\n\t\t{\n\t\t\techo \"Visible only to Super Admins<br /><br />\";\n\t\t\tprint_r( $sql );\n\t\t\techo \"<br /><br />Visible only to Super Admins\";\n\t\t}\n\t\t*/\n\t\treturn $sql;\n\t}", "protected function user_where_clause() {}", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public static function where(array $where);", "protected function getGeneralWhereClause() {}", "protected function whereDate(Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return $this->wrap($where['column']).'::date '.$where['operator'].' '.$value;\n }", "protected function whereDate(Builder $query, $where)\n {\n return $this->dateBasedWhere('date', $query, $where);\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "abstract public function where(array $where);", "function filter_where( $where = '' ) {\r\n\t$where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-99930 days')) . \"'\";\r\n\treturn $where;\r\n}", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "public static function posts_where( $where_sql, $query ) {\n\t\t\tglobal $wpdb;\n\n\t\t\t// if it's a true event query then we to setup where conditions\n\t\t\t// but only if we aren't grabbing a specific post\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t$query->tribe_is_event\n\t\t\t\t\t|| $query->tribe_is_event_category\n\t\t\t\t)\n\t\t\t\t&& empty( $query->query_vars['name'] )\n\t\t\t\t&& empty( $query->query_vars['p'] )\n\t\t\t) {\n\n\t\t\t\t$postmeta_table = self::postmeta_table( $query );\n\n\t\t\t\t$start_date = $query->get( 'start_date' );\n\t\t\t\t$end_date = $query->get( 'end_date' );\n\t\t\t\t$use_utc = Tribe__Events__Timezones::is_mode( 'site' );\n\t\t\t\t$site_tz = $use_utc ? Tribe__Events__Timezones::wp_timezone_string() : null;\n\n\t\t\t\t// Sitewide timezone mode: convert the start date - if set - to UTC\n\t\t\t\tif ( $use_utc && ! empty( $start_date ) ) {\n\t\t\t\t\t$start_date = Tribe__Events__Timezones::to_utc( $start_date, $site_tz );\n\t\t\t\t}\n\n\t\t\t\t// Sitewide timezone mode: convert the end date - if set - to UTC\n\t\t\t\tif ( $use_utc && ! empty( $end_date ) ) {\n\t\t\t\t\t$end_date = Tribe__Events__Timezones::to_utc( $end_date, $site_tz );\n\t\t\t\t}\n\n\t\t\t\t// we can't store end date directly because it messes up the distinct clause\n\t\t\t\t$event_end_date = apply_filters( 'tribe_events_query_end_date_column', 'tribe_event_end_date.meta_value' );\n\n\t\t\t\t// event start date\n\t\t\t\t$event_start_date = \"{$postmeta_table}.meta_value\";\n\n\t\t\t\t// build where conditionals for events if date range params are set\n\t\t\t\tif ( $start_date != '' && $end_date != '' ) {\n\t\t\t\t\t$start_clause = $wpdb->prepare( \"($event_start_date >= %s AND $event_start_date <= %s)\", $start_date, $end_date );\n\t\t\t\t\t$end_clause = $wpdb->prepare( \"($event_end_date >= %s AND $event_start_date <= %s )\", $start_date, $end_date );\n\t\t\t\t\t$within_clause = $wpdb->prepare( \"($event_start_date < %s AND $event_end_date >= %s )\", $start_date, $end_date );\n\t\t\t\t\t$where_sql .= \" AND ($start_clause OR $end_clause OR $within_clause)\";\n\t\t\t\t} else {\n\t\t\t\t\tif ( $start_date != '' ) {\n\t\t\t\t\t\t$start_clause = $wpdb->prepare( \"{$postmeta_table}.meta_value >= %s\", $start_date );\n\t\t\t\t\t\t$within_clause = $wpdb->prepare( \"({$postmeta_table}.meta_value <= %s AND $event_end_date >= %s )\", $start_date, $start_date );\n\t\t\t\t\t\t$where_sql .= \" AND ($start_clause OR $within_clause)\";\n\t\t\t\t\t\tif ( $query->is_singular() && $query->get( 'eventDate' ) ) {\n\t\t\t\t\t\t\t$tomorrow = date( 'Y-m-d', strtotime( $query->get( 'eventDate' ) . ' +1 day' ) );\n\t\t\t\t\t\t\t$tomorrow_clause = $wpdb->prepare( \"{$postmeta_table}.meta_value < %s\", $tomorrow );\n\t\t\t\t\t\t\t$where_sql .= \" AND $tomorrow_clause\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $end_date != '' ) {\n\t\t\t\t\t\t\t$where_sql .= ' AND ' . $wpdb->prepare( \"$event_end_date < %s\", $end_date );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tremove_filter( 'option_page_on_front', array( __CLASS__, 'default_page_on_front' ) );\n\n\t\t\treturn $where_sql;\n\t\t}", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and')\n {\n return $this->callHook(\"where{$type}\", $this->packArgs(compact('column', 'operator', 'value', 'boolean')));\n }", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "public function modifyWhere(&$sql, $table = 'listings')\n {\n if (!$this->geo_filter_data['applied_location']\n || !$this->geo_filter_data['is_filtering']\n ) {\n return;\n }\n\n if (!$sql) {\n $sql = &$GLOBALS['sql'];\n }\n\n $data_key = $table == 'accounts' ? 'location_account_fields' : 'location_listing_fields';\n $data = $this->geo_filter_data[$data_key];\n\n // Return if location search already performed from the search form\n if (strpos($sql, key($this->geo_filter_data[$data_key]))) {\n return;\n }\n\n foreach ($data as $field => $value) {\n if ($value) {\n $sql .= \"AND `T1`.`{$field}` = '{$value}' \";\n }\n }\n }", "public function statistics_ref_duration_where( $where ) {\n\t\t\tglobal $wpdb;\n\t\t\t$after_date = $this->request->get_param( 'after' );\n\t\t\t$before_date = $this->request->get_param( 'before' );\n\n\t\t\tif ( $after_date ) {\n\t\t\t\t$s_date = strtotime( $after_date );\n\t\t\t\t$where .= ( false !== $s_date ) ? $wpdb->prepare( ' AND statref.create_time >= %s', $s_date ) : '';\n\t\t\t}\n\n\t\t\tif ( $before_date ) {\n\t\t\t\t$e_date = strtotime( $before_date );\n\t\t\t\t$where .= ( false !== $e_date ) ? $wpdb->prepare( ' AND statref.create_time <= %s', $e_date ) : '';\n\t\t\t}\n\n\t\t\treturn $where;\n\t\t}", "private function sql_whereAnd_fromTS()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS value\n $andWhere = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'sql.' ][ 'andWhere' ];\n\n if ( !empty( $andWhere ) )\n {\n $andWhere = \" AND \" . $andWhere;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "function posts_where($where, $wp_query)\n {\n }", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "function getFiltroTempoEntrega($get,$where = \" 1 = 1\"){\n \n if(isset($get['hrini']) && isset($get['hrfim'])){\n $hrIni = $get['hrini'];\n $hrFim = $get['hrfim'];\n if (!empty($hrIni) && !empty($hrFim)){\n \n return $where .= \" AND TO_CHAR(EXTRACT(HOUR from NUMTODSINTERVAL((to_date(DtFim,'YYYYMMDDHH24MISS') - to_date(DtIni,'YYYYMMDDHH24MISS')),'DAY')),'FM00') \n ||':' ||\n TO_CHAR(EXTRACT(Minute from NUMTODSINTERVAL((to_date(DtFim,'YYYYMMDDHH24MISS') - to_date(DtIni,'YYYYMMDDHH24MISS')),'DAY')),'FM00') \n BETWEEN '{$hrIni}' AND '{$hrFim}'\";\n \n }\n \n } \n }", "protected function dateBasedWhere($type, Builder $builder, $where): string\n {\n $value = $this->parameter($where['value']);\n\n return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "private function sql_whereWiHits()\n {\n // Get WHERE statement\n $where = $this->pObj->objSqlInit->statements[ 'listView' ][ 'where' ] .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS();\n // Localise the WHERE statement\n $where = $this->sql_whereWiHitsLL( $where );\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "protected function constructWhere($where)\n {\n if (is_array($where)) {\n $equals = array();\n \n foreach ($where as $column => $value) {\n $equals[] = new Equal($column, $value);\n }\n\n $this->where = new Where(new AndOperator($equals));\n } else {\n $this->where = new Where($where);\n }\n }", "public static function adjacent_post_link_where( $where) {\n $post = get_post();\n // only make changes if we are talking about event posts\n if ( self::$o->core_post_type == $post->post_type ) {\n $wpdb='';\n\n // using start date as the sorter not the post_date\n $start = get_post_meta( $post->ID, '_start', true );\n $format = $wpdb->prepare( 'cast( qspm.meta_value as datetime ) $1 %s AND', $start );\n $where = preg_replace( '#p\\.post_date ([^\\s]+) .*?AND#', $format, $where );\n\n // only get child events, if viewing child events, and only get parent events, if viewing parent events\n if ( $post->post_parent ) {\n $where = preg_replace( '#(AND p.post_type = )#', 'AND p.post_parent != 0 \\1', $where );\n } else {\n $where = preg_replace( '#(AND p.post_type = )#', 'AND p.post_parent = 0 \\1', $where );\n }\n }\n\n return $where;\n }", "protected function whereDate(Builder $builder, $where): string\n {\n return $this->dateBasedWhere('date', $builder, $where);\n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "protected function addWhere( $query, $key, $extraValue )\n\t{\n\t\tif ( $extraValue === 'NULL' )\n\t\t{\n\t\t\t$query->whereNull( $key );\n\t\t}\n\t\telseif ( $extraValue === 'NOT_NULL' )\n\t\t{\n\t\t\t$query->whereNotNull( $key );\n\t\t}\n\t\telseif ( Str::startsWith( $extraValue, '!' ) )\n\t\t{\n\t\t\t$query->where( $key, '!=', mb_substr( $extraValue, 1 ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query->where( $key, $extraValue );\n\t\t}\n\t}", "function setWhere($where) {\n $this->where = $where;\n }", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "function whereAdd($where,$clause)\n{\n\tif(!strlen($clause))\n\t\treturn $where;\n\tif(!strlen($where))\n\t\treturn $clause;\n\treturn \"(\".$where.\") and (\".$clause.\")\";\n}", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "function get_date_where($max_levels=3)\n {\n global $page;\n\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $b = $date[CYEAR] . '-';\n $e = $date[CYEAR] . '-';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $b .= sprintf('%02d-', $date[CMONTH]);\n $e .= sprintf('%02d-', $date[CMONTH]);\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $b .= sprintf('%02d', $date[CDAY]);\n $e .= sprintf('%02d', $date[CDAY]);\n }\n else\n {\n $b .= '01';\n $e .= $this->get_all_days_in_month($date[CYEAR], $date[CMONTH]);\n }\n }\n else\n {\n $b .= '01-01';\n $e .= '12-31';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n $res = \" AND $this->date_field BETWEEN '$b' AND '$e 23:59:59'\" . $res;\n }\n else\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n return $res;\n }", "public function addWhere(Expression $expression, $type = AbstractSearchQuery::WHERE_AND);", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "public function setWhere($where)\r\n {\r\n $this->where = !empty($where) ? $where : null;\r\n }", "private function sql_whereAnd_sysLanguage()\n {\n if ( !isset( $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ] ) )\n {\n return;\n }\n\n $languageField = $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ];\n $languageId = $GLOBALS[ 'TSFE' ]->sys_language_content;\n\n // DRS :TODO:\n if ( $this->pObj->b_drs_devTodo )\n {\n $prompt = '$this->int_localisation_mode PI1_SELECTED_OR_DEFAULT_LANGUAGE: for each language a query!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n\n switch ( $this->int_localisation_mode )\n {\n case( PI1_DEFAULT_LANGUAGE ):\n $andWhere = \" AND \" . $languageField . \" <= 0 \";\n break;\n case( PI1_SELECTED_OR_DEFAULT_LANGUAGE ):\n $andWhere = \" AND ( \" .\n $languageField . \" <= 0 OR \" .\n $languageField . \" = \" . intval( $languageId ) .\n \" ) \";\n break;\n case( PI1_SELECTED_LANGUAGE_ONLY ):\n $andWhere = \" AND \" . $languageField . \" = \" . intval( $languageId ) . \" \";\n break;\n default:\n $andWhere = null;\n break;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "function get_date_where($max_levels=3)\n {\n global $page;\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $y = $date[CYEAR];\n $res = \" AND $this->date_field BETWEEN '$y-01-01' AND '$y-12-31 23:59:59'\";\n }\n\n if (isset($date[CWEEK]) and $date[CWEEK]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CWEEK]['sql'].'='.$date[CWEEK];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n if (empty($res))\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n }\n return $res;\n }", "function start_group_where($key,$value=NULL,$escape=TRUE,$type=\"AND\")\n {\n $this->open_bracket($type); \n return parent::_where($key, $value,'',$escape); \n }", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public function whereParenWrap() {\n $where = $this->_dqlParts['where'];\n if (count($where) > 0) {\n array_unshift($where, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "function byDay($day) {\n return $this->byDateRange($day, $day);\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "public function getWhere($where, Database_Config $databaseConfig = NULL);", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "protected function where(array $filter){\n if (array_key_exists(\"order\", $filter)){\n $order = $filter[\"order\"];\n unset($filter[\"order\"]);\n if (gettype($order) != \"array\")\n $order = [$order];\n }\n\n if (array_key_exists(\"limit\", $filter)){\n $limit = $filter[\"limit\"];\n unset($filter[\"limit\"]);\n if (gettype($limit) != \"integer\")\n throw new appException(\"This is off-limits, literally\");\n }\n\n if (!empty($filter)){\n $query = \" WHERE \";\n\n foreach ($filter as $k => $v){\n if (gettype($v) == \"array\"){\n $query .= $this->genTableVar($k) . \" IN ( \";\n $query .= join(\", \", array_fill(0, count($v), \"?\"));\n $query .= \") AND \";\n }\n else if (gettype($v) == \"object\" && get_class($v) == \"dbContains\"){\n $query .= $v->genSql($this->genTableVar($k)) . \" AND \";\n }\n else {\n $query .= $this->genTableVar($k) . \" = ? AND \";\n }\n $this->args[] = $v;\n }\n\n $query = substr($query, 0, -4);\n\n $this->query .= $query;\n }\n\n if (isset($order))\n $this->orderBy($order);\n\n if (isset($limit))\n $this->limit($limit);\n }", "public function makeSearchWhere($where)\n {\n global $wpdb;\n\n if (is_search()) {\n $where = preg_replace(\n \"/\\(\\s*\" . $wpdb->posts . \".post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n \"(\" . $wpdb->posts . \".post_title LIKE $1) OR (\" . $wpdb->postmeta . \".meta_value LIKE $1)\", $where);\n\n $where .= \" AND ($wpdb->posts.post_type = '\" . $this->post_type . \"') \";\n\n if (!is_user_logged_in()) {\n $where .= 'NOT IN ( \n ( ' . $wpdb->postmeta . '.meta_key = \"title\" ) \n OR ( ' . $wpdb->postmeta . '.meta_key = \"country\" )\n ) ';\n }\n\n //Filters\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $where .= \" AND $values.meta_key='\" . $values . \"'\";\n $where .= \" AND $values.meta_value LIKE '%\" . strip_tags($_GET[$values]) . \"%'\";\n }\n }\n }\n return $where;\n }", "final public function addWhere(YMKM_SQL_Entity_Where $s)\n {\n $this->doAddWhere($s);\n return $this;\n }", "protected function addWhereFilter($field, $value) {\n if($this->filterType == 'orWhere') {\n $this->builder = $this->builder->orWhere($field, $value);\n }else {\n $this->builder = $this->builder->where($field, $value);\n $this->filterType = 'orWhere';\n }\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function where($table,$column,$data = \"\");", "private function createSqlWhereClauseForDbRecords($searchPhrase, array $dbFieldsWhichContainTimeData=array()) {\r\n\t\t$sqlWhere = '1=1';\r\n\t\tif($searchPhrase !== '') {\r\n\t\t\tlist($field, $value) = explode(':', $searchPhrase);\r\n\t\t\tif(in_array($field, $dbFieldsWhichContainTimeData)) {\r\n\t\t\t\t$value = strtotime($value);\r\n\t\t\t\tif(is_integer($value) === TRUE) {\r\n\t\t\t\t\t$sqlWhere .= ' AND '.$field.' >='.$value;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sqlWhere .= ' AND '.$field.' like \\'%'.$value.'%\\'';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sqlWhere;\r\n\t}", "public function andWhere($where): QueryBuilderInterface;", "function get_occurs_within_where_clause($table_name, $rel_table, $start_ts_obj, $end_ts_obj, $field_name='date_start', $view){\n\t\tglobal $timedate;\n\t\n\t\t$start = clone $start_ts_obj;\n\t\t$end = clone $end_ts_obj;\n\n\t\t$field_date = $table_name.'.'.$field_name;\n\t\t$start_day = $GLOBALS['db']->convert(\"'{$start->asDb()}'\",'datetime');\n\t\t$end_day = $GLOBALS['db']->convert(\"'{$end->asDb()}'\",'datetime');\n\n\t\t$where = \"($field_date >= $start_day AND $field_date < $end_day\";\n\t\tif($rel_table != ''){\n\t\t\t$where .= \" AND $rel_table.accept_status != 'decline'\";\n\t\t}\n\n\t\t$where .= \")\";\n\t\treturn $where;\n\t}", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "private function sql_whereWiHitsLL( $where )\n {\n // Short var\n $table = $this->pObj->localTable;\n\n // Store current localisation mode\n $curr_int_localisation_mode = $this->pObj->objLocalise->get_localisationMode();\n // Set localisation mode to default language\n //$this->pObj->objLocalise->int_localisation_mode = PI1_DEFAULT_LANGUAGE;\n $this->pObj->objLocalise->setLocalisationMode( PI1_DEFAULT_LANGUAGE );\n\n // Get where localisation\n $llWhere = $this->pObj->objLocalise->localisationFields_where( $table );\n if ( $llWhere )\n {\n $where = $where . \" AND \" . $llWhere;\n }\n // Get where localisation\n // Reset localisation mode\n //$this->pObj->objLocalise->int_localisation_mode = $curr_int_localisation_mode;\n $this->pObj->objLocalise->setLocalisationMode( $curr_int_localisation_mode );\n\n // RETURN\n return $where;\n }", "private function tinydb_add_where($query)\n {\n return static::tinydb_add_where_for_pkey($this->get_id(), $query);\n }", "function addFieldWhere($fieldname, $where, $junction = 'AND')\n\t{\n\t\tif (isset($this->table->fields[$fieldname]))\n\t\t{\n\t\t\t$this->table->fields[$fieldname]->where[] = array('condition' => $where, 'junction' => $junction);\n\t\t}\n\t\telse\n\t\t\ttrigger_error(\"No field exists with the name: $fieldname\");\n\t}", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "protected function _setWhere(&$sql, $where, $whereValues) {\n\t\t\n\t\tif (!is_null($where)) $sql.= ' WHERE ' . $where;\n\t}" ]
[ "0.693467", "0.68739295", "0.652417", "0.6431958", "0.64248616", "0.6347953", "0.6341573", "0.6281545", "0.6212355", "0.6186861", "0.6175992", "0.6037601", "0.6001477", "0.5966626", "0.5864954", "0.58642596", "0.58557445", "0.58531785", "0.5849568", "0.5834001", "0.58245", "0.58242536", "0.57996047", "0.57887685", "0.5750941", "0.57071376", "0.57020456", "0.56798524", "0.5631886", "0.5628615", "0.5621697", "0.5609475", "0.5591628", "0.5579957", "0.55691034", "0.5565815", "0.55636096", "0.55602944", "0.5531532", "0.5515565", "0.55066705", "0.5499956", "0.5490216", "0.54600185", "0.5444269", "0.5410252", "0.53973067", "0.53967714", "0.5373634", "0.5373313", "0.5369128", "0.5361073", "0.5356517", "0.5340995", "0.533999", "0.5337834", "0.5334405", "0.5334405", "0.53274363", "0.5326535", "0.5319868", "0.53126335", "0.52955455", "0.52893037", "0.52882904", "0.5277658", "0.5272455", "0.525216", "0.524526", "0.52316797", "0.5211328", "0.52102655", "0.5205583", "0.520391", "0.5200654", "0.51949394", "0.519441", "0.51826787", "0.5177785", "0.51593035", "0.51513964", "0.5149909", "0.5145277", "0.5142858", "0.5136593", "0.5132241", "0.513114", "0.5128579", "0.51250553", "0.5119925", "0.51073307", "0.51037365", "0.50997025", "0.5098305", "0.50895566", "0.50877315", "0.50864655", "0.5083763", "0.5082155", "0.50801873" ]
0.6327462
7
Add a "where month" to the query.
public function month($column, $month, $boolean = 'and', $not = false) { return $this->where_assoc(array('month('.$column.')' => $month), $boolean, $not); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function whereMonth(Builder $query, $where)\n {\n return $this->dateBasedWhere('month', $query, $where);\n }", "public function scopeMonth($query,$filters){\n if($month = $filters['month']){\n $query->whereMonth('created_at', Carbon::parse($month)->month);\n }\n\n if($year = $filters['year']){\n $query->whereYear('created_at',$year);\n }\n\n }", "public function whereMonth($column, $operator, $value, $boolean = 'and')\n {\n return $this->addDateBasedWhere('Month', $column, $operator, $value, $boolean);\n }", "protected function whereMonth(Builder $builder, $where): string\n {\n return $this->dateBasedWhere('month', $builder, $where);\n }", "public function scopeMonth($query, $month)\n {\n return $query->whereMonth('created_at', $month);\n }", "public function filterPublishDate(int $year, ?int $month): self;", "function whereQuery() {\n // $arrDate1 = explode(\"-\", $bulantahunpenggajian);\n // $date1 = $arrDate1[0].'-'.$arrDate1[1].'-01';\n // $date2 = $arrDate1[0].'-'.$arrDate1[1].'-'.cal_days_in_month(CAL_GREGORIAN, $arrDate1[1], $arrDate1[0]);\n \n // $wer = \" A.MONTH = '\".$arrDate1[1].\"' AND A.YEAR = \".$arrDate1[0].\"\";\n \n // return $wer;\n return '';\n }", "public function two_months( $where ){\n\n\t\t$how_old = apply_filters( 'wptt_ics_feeds_how_old', '-6 weeks' );\n\n\t\t$where .= \" AND post_date > '\" . date('Y-m-d', strtotime( $how_old )) . \"'\";\n\t\treturn $where;\n\n\t}", "public function scopeByMonth($query, $month)\n {\n $month = now()->month((Integer) $month);\n \n return $query\n ->whereDate('issue_date', '>=', $month->firstOfMonth())\n ->whereDate('issue_date', '<=', $month->endOfMonth());\n }", "public function filterByMonth($month = null, $comparison = null)\n {\n if (is_array($month)) {\n $useMinMax = false;\n if (isset($month['min'])) {\n $this->addUsingAlias(MigrationPeer::MONTH, $month['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($month['max'])) {\n $this->addUsingAlias(MigrationPeer::MONTH, $month['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MigrationPeer::MONTH, $month, $comparison);\n }", "private function _sql_yearmonth() {\n\t\tglobal $wpdb;\n\t\tif ( !$this->yearmonth ) {\n\t\t\treturn '';\n\t\t}\n\t\t// e.g. AND DATE_FORMAT(wp_posts.post_modified, '%Y%m') = '201102'\n\t\treturn sprintf(\"%s DATE_FORMAT(%s.%s, '%%Y%%m') = %s\" // note the double percentage to placate sprintf \n\t\t\t, $this->join_rule\n\t\t\t, $wpdb->posts\n\t\t\t, $this->date_column\n\t\t\t, $wpdb->prepare('%s', $this->yearmonth)\n\t\t);\n\t}", "function get_transaction_by_month($conds = array())\n\t{\n\t\t//print_r(\"asdfasd\" .$conds);die;\n\t\t$this->db->select('rt_transactions_counts.*'); \n \t\t$this->db->from('rt_transactions_counts');\n \t\t$this->db->where('month(added_date)',$conds['added_date']);\n \t\t$this->db->where('rt_transactions_counts.shop_id',$conds['shop_id']);\n\n\t\treturn $this->db->get();\n\t\t // print_r($this->db->last_query());die;\n\t}", "public function scopeEventsOfMonth(Builder $query, int $year, int $month) : Builder\n {\n return $query->whereMonth('starts_at', '=', $month)\n ->whereYear('starts_at', '=', $year)\n ->orderBy('starts_at', 'DESC');\n }", "function searchmonthresultnow($mon)\n {\n $this->db->select('order.*,users.*,order.id as oid,file.*,package.*,cities.*,order.amount as am,guest.firstname as fr,guest.lastname as lr');\n $this->db->from('order');\n $this->db->join('package', 'package.id = order.package', 'left');\n $this->db->join('orderguest', 'orderguest.orderid = order.id', 'left');\n $this->db->join('guest', 'guest.id = orderguest.guest', 'left');\n $this->db->join('users', 'order.bookedby = users.id', 'left');\n $this->db->join('userprofile', 'userprofile.useid = users.id', 'left');\n $this->db->join('cities', 'cities.c_id = package.location', 'left');\n $this->db->join('file', 'file.id = userprofile. profilepic', 'left');\n $this->db->where('MONTH(order.orderplacedate)', $mon);\n // $this->db->order_by(\"order.orderplacedate\", \"desc\");\n $this->db->where('order.user_cancel', null); $this->db->where('order.admin_cancel', null);\n $query = $this->db->get();\n $row = $query->result_array();\n return $row;\n }", "public function scopeThisMonth($query)\n {\n $now = Carbon::now();\n $thisMonth = strtoupper($now->format('M')); // JUN\n\n return $query->where([\n ['year', '=', $now->year],\n ['month_ABC', '=', $thisMonth],\n ])->get();\n\n //return $query->where('year', '=', $now->year)->where('month', '=', $now->month);\n }", "public function onMonth($month)\n {\n $this->month = $month;\n return $this;\n }", "function thismonth(){\n\n $where = \"MONTH( reservation_startdate ) = MONTH( NOW() )\";\n\n $reservation = where( 'reservations', $where );\n\n echo json_encode( $reservation );\n exit;\n}", "public function scopeOnCurrentMonth($query)\n {\n return $query->whereBetween('created_at', [\n Carbon::now()->startOfMonth(),\n Carbon::now()->endOfMonth(),\n ]);\n }", "public function searchActiveCelebritiesWorldMonth($year = 2015, $month = 1)\n {\t\n\t\t\n\t\t$intervalStart = $year .'-' . sprintf(\"%02d\", $month) . '-01 00:00:00';\n\t\t$intervalEnd = $year .'-' . sprintf(\"%02d\", $month) . '-31 23:59:59';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n\t\t$dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "function wpfc_temp_filter_where( $where = '' ) {\n\t \t$where .= \" AND post_date >= '\".date(\"Y-m-d\", $_REQUEST['start']).\"' AND post_date < '\".date(\"Y-m-d\", $_REQUEST['end']).\"'\";\n\t \treturn $where;\n\t }", "function searchmonthresult($mon, $loc)\n {\n $this->db->select('order.*,users.*,order.id as oid,file.*,package.*,cities.*,order.amount as am,guest.firstname as fr,guest.lastname as lr');\n $this->db->from('order');\n $this->db->join('package', 'package.id = order.package', 'left');\n \n\t\n $this->db->join('orderguest', 'orderguest.orderid = order.id', 'left');\n $this->db->join('guest', 'guest.id = orderguest.guest', 'left');\n $this->db->join('users', 'order.bookedby = users.id', 'left');\n\t\t\n\t\t\n $this->db->join('userprofile', 'userprofile.useid = users.id', 'left');\n $this->db->join('cities', 'cities.c_id = package.location', 'left');\n $this->db->join('file', 'file.id = userprofile. profilepic', 'left');\n $this->db->where('package.location', $loc);\n $this->db->where('MONTH(order.orderplacedate)', $mon);\n // $this->db->order_by(\"order.orderplacedate\", \"desc\");\n $this->db->where('order.admin_cancel', null);\n\t\t $this->db->where('order.user_cancel', null);\n $query = $this->db->get();\n $row = $query->result_array();\n return $row;\n }", "public function ajax_get_reports_by_month() {\n $month = $this->input->post('month');\n $month = (!empty($month))? $month: date('Y-m');\n\n $data['month'] = (!empty($month))? date('F', strtotime($month)): date('F');\n $data['month_digit'] = (!empty($month))? date('Y-m', strtotime($month)): date('Y-m');\n\n $data['result'] = $this->Report_Model->get_membership_payments($month . '-%');\n\n echo json_encode($data);\n }", "public function scopeMonths($query) {\n\t\treturn $query->select(DB::raw('DISTINCT MONTH(user_log_timestamp) AS month'))\n ->orderBy('user_log_timestamp', 'asc');\n\t}", "function\nquery_for_month($language, $target_area, $season, $start_date, $stop_date, $freeze_date, $status)\n{\n $obs_query = \"SELECT ob.frequency, ob.\\\"date\\\", ob.\\\"time\\\", ob.o\"\n .\" FROM parsed_observations ob JOIN ms_use ms USING (stn)\"\n .\" WHERE status='$status'\"\n .\" AND ob.\\\"date\\\" BETWEEN '$start_date' AND '$stop_date'\"\n \t .\" AND ob.\\\"language\\\" = '$language' AND ms.\\\"language\\\" = '$language'\";\n if($freeze_date != \"\")\n $obs_query .= \" AND ob.row_timestamp <= TIMESTAMP '$freeze_date'\";\n\n // this sub query returns the sla targets for the ta, language and month\n $sla_query =\n \"SELECT start_time, min(target) AS target, primary_frequency, secondary_frequency FROM sla\"\n .\" WHERE season = '$season'\".\" AND target_area = '$target_area'\"\n .\" AND valid_from <= '$stop_date'\"\n .\" AND(valid_to IS NULL OR valid_to >= '$start_date')\"\n .\" AND \\\"language\\\" = '$language'\"\n .\" GROUP BY start_time, primary_frequency, secondary_frequency\";\n\n // this sub query collects the obervations into the sla bins and finds the max score for each bin\n return\n \" SELECT s.start_time, target, o.\\\"date\\\", max(o.o) AS o\"\n .\" FROM($sla_query) AS s LEFT JOIN($obs_query) AS o\"\n .\" ON o.\\\"time\\\" BETWEEN s.start_time AND(s.start_time + '00:30:00'::interval)\"\n .\" WHERE (o.frequency = ANY(s.primary_frequency) OR o.frequency = ANY(s.secondary_frequency))\"\n .\" GROUP BY s.start_time, s.target, o.\\\"date\\\"\";\n}", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "public function searchActiveContinentMonth($continent = false, $year = 2015, $month = 1)\n {\n\n\t\t$intervalStart = $year .'-' . sprintf(\"%02d\", $month) . '-01 00:00:00';\n\t\t$intervalEnd = $year .'-' . sprintf(\"%02d\", $month) . '-31 23:59:59';\n\t\t\n\t\t$query = ArtistPlan::find()->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->where('artistplan.show_status = :status') \n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime]);\n\t\t\n\t\t$query->addParams([':status' => 1]); \n\t\t\n\t\tif ($continent) {\n\t\t\t$query->andWhere(\"continent = :continent\");\n\t\t\t$query->addParams([':continent' => $this->getContinentName($continent)]); \n\t\t}\n\t\t\n\t\t$query->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "public function scopeFilter($query, $filters) {\n if( $month = $filters['month'] ) {\n\n // Carbon::parse($month)->month --> converts to month number. \n $query->whereMonth('created_at', Carbon::parse($month)->month );\n }\n\n if( $year = $filters['year'] ) {\n \n $query->whereYear('created_at', $year );\n }\n\n }", "protected function user_where_clause() {}", "function filter_where($where = '') {\n $postid = get_the_ID();\n $format = 'Y-m-d';\n $publish_date = get_the_date( $format, $postid);\n\n $where .= \" AND post_date <= '\" . $publish_date . \"'\";\n\n return $where;\n }", "protected function getWhereClause() {}", "protected function getMonths()\n {\n\t$year = $_REQUEST['year'] ;\n\tif( !$year )\n\t{\n\t print( \"Month query failed: no year has been specified\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\t$year = trim( $year ) ;\n\n\t// need to connect to the database here in order to run the\n\t// function mysql_real_escape_string\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\tif( $year )\n\t{\n\t $year = mysql_real_escape_string( $year ) ;\n\t}\n\n\t$params = $_REQUEST['params'] ;\n\tif( $params )\n\t{\n\t $params = trim( $params ) ;\n\t $params = mysql_real_escape_string( $params ) ;\n\t}\n\n\t$kinst = $_REQUEST['kinst'] ;\n\tif( $kinst )\n\t{\n\t $kinst = trim( $kinst ) ;\n\t $kinst = mysql_real_escape_string( $kinst ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT d.MONTH\" ;\n\tif( $kinst && !$params )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t}\n\telse if( $params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( $params && $kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( !$params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t}\n\n\t$query .= \" ORDER BY d.MONTH ASC\" ;\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }", "public static function select_count_by_current_month(){\n return DB::table('tb_order')\n ->whereRaw('month(datetime) = month(now()) and year(datetime) = year(now())', [])\n //->where('month(datetime)', 'month(now())')\n //->where('year(datetime)', 'year(now())')\n ->count();\n\t}", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "function this_month()\n{\n global $db; // golbalize db variable:\n $thisMonth = array(\n \"start\" => date('Y-m-d', strtotime('first day of this month', strtotime(date('Y-m-d')))),\n \"end\" => date('Y-m-d', strtotime('last day of this month', strtotime(date('Y-m-d'))))\n );\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisMonth['start'],\n 'dates.date' => $thisMonth['end']\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function events_calendar_query($month = 1, $year = 2010)\n\t{\n\t\t$this->events = $this->_process(\"http://tigedealers.com/month_events_api/$year/$month\");\n\t\t\n\t\tif($this->events):\n\t\t\t$this->result = simplexml_load_string($this->events);\n\t\telse:\n\t\t\t$this->result = array(array(\"text\" => \"Trouble on the western front\"));\n\t\tendif;\n\t\t\n\t\t$this->month = $month;\n\t\t$this->year = $year;\n\t\t\n\t\t$this->_get_calendar_array();\n\t}", "function GetLastMonthFilter($FldExpression, $dbid = 0) {\r\n\t$today = getdate();\r\n\t$lastmonth = mktime(0, 0, 0, $today['mon']-1, 1, $today['year']);\r\n\t$val = date(\"Y|m\", $lastmonth);\r\n\t$wrk = $FldExpression . \" BETWEEN \" .\r\n\t\tQuotedValue(DateValue(\"month\", $val, 1, $dbid), DATATYPE_DATE, $dbid) .\r\n\t\t\" AND \" .\r\n\t\tQuotedValue(DateValue(\"month\", $val, 2, $dbid), DATATYPE_DATE, $dbid);\r\n\treturn $wrk;\r\n}", "public function filter_where($where = '') {\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-30 days')) . \"'\";\n return $where;\n }", "public function setMonth($month)\n {\n $this->month = $month;\n }", "function setMonth($m)\r\n {\r\n if($m < 1 || $m > 12) {\r\n $this->mes = 1;\r\n } else {\r\n $this->mes = $m;\r\n }\r\n }", "public function setMonth($month) {\n\t\t$this->month = $month;\n\t}", "public function yearMonth($year = null, $month = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function setMonth($month = null): object\n {\n if (null !== $month && !($month instanceof FHIRString)) {\n $month = new FHIRString($month);\n }\n $this->_trackValueSet($this->month, $month);\n $this->month = $month;\n return $this;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "function form_select_month($name, $month, $id='') {\n\n\tglobal $cache2;\n\n\t// are we dealing with timestamp\n\tif ($month > 10000) {\n\t\t$month = fetch_month($month);\n\t}\n\n\t$id = ifr($id, $name);\n\n\treturn form_select($name, $cache2->getCalendarData('months_short'), '', $month, '', '', '', '', '', $id);\n\n}", "function get_month_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('m')] = month_converter($fecha->format('m'));\n }\n return $result;\n}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function addMonth($month = 1)\r\n {\r\n $date = date(self::MASK_TIMESTAMP_USER, mktime($this->hour, $this->minute, $this->second, $this->month + $month, $this->day, $this->year));\r\n $this->setValue($date);\r\n\r\n return $this;\r\n }", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "public function setMonth($month) {\n\t\t$this->schedule->setMonth($month);\n\n\t\treturn $this;\n\t}", "public function setMonth($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\StringValue::class);\n $this->month = $var;\n\n return $this;\n }", "public function setMonth(int $month)\n {\n $this->month = $month;\n\n return $this;\n }", "public function actionPostedInMonth()\n {\n\n $month = date('n', $_GET['time']); // 1 through 12\n $year = date('Y', $_GET['time']); // 2011\n if (isset($_GET['pnc'] ) && $_GET['pnc'] == 'n') $month++;\n if (isset($_GET['pnc'] ) && $_GET['pnc'] == 'p') $month--;\n\n $query=Article::find()->where(['status' =>Article::STATUS_ENABLED ])\n ->andWhere(['>','created_at',($firstDay = mktime(0,0,0,$month,1,$year))])\n ->andWhere(['<','created_at',(mktime(0,0,0,$month+1,1,$year))])\n ->orderBy('updated_at DESC');\n\n $pages = new Pagination(['totalCount' => $query->count()]);\n\n $pages->pageSize = \\Yii::$app->params['monthlyArchivesCount'];\n\n $materials = $query->offset($pages->offset)\n ->limit($pages->limit)\n ->all();\n\n return $this->render('month',array(\n 'materials' => $materials,\n 'pages' => $pages,\n 'firstDay' => $firstDay,\n ));\n }", "public function __month ( $sField, $mValue )\n {\n return \"EXTRACT(MONTH FROM $sField) = $mValue\";\n }", "public function setMonth($month)\n\t{\n\t\t$this->month = $month;\n\t}", "public function get_transaction_by_month($date){\n $this->load->database();\n\n $query = $this->db->select('date,type,is_of,amount')\n ->get_where('tbl_transactions',array('left(date,7)' => $date));\n return $query->result_array();\n }", "public function get_month($month_number)\n {\n }", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "public function scopeStats($query, $month=false, $year=false){\n\n\t\t$query = $query->select( DB::raw('libraries.code as library,holdings.state as state , count(*) as count, sum(holdings.size) as size') )\n ->from('holdings')\n\t\t\t\t\t\t\t->join('states', function($join){ $join->on('holdings.id','=','states.holding_id')->on('states.state','=','holdings.state'); })\n\t\t\t\t\t\t\t->join('libraries','holdings.library_id','=','libraries.id')\n\t\t\t\t\t\t\t->groupBy('libraries.code', 'holdings.state');\n\n\t\tif ($month && $month!='*') $query = $query->where(DB::raw('extract(month from states.created_at)'),$month);\n\t\tif ($year && $year!='*') \t$query = $query->where(DB::raw('extract(year from states.created_at)'),$year);\n\n\t\treturn $query;\n }", "public function filterAction(Request $request) {\n $year = $request->query->get('year');\n $month = $request->query->get('month');\n\n $em = $this->getDoctrine()->getManager();\n $repo = $em->getRepository('AppBundle:Data');\n if(!empty($month)){ \n $datas = $repo->findBy(array('year' => $year, 'month' => $month));\n \n } else {\n $datas = $repo->findBy(array('year' => $year));\n }\n\n return compact('datas','year', 'month');\n\n }", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "public function actionPostedInMonth()\n {\n $criteria=new CDbCriteria;\n $criteria->condition='status='.Post::STATUS_PUBLISHED.' AND t.publishTime<'.time();// MFM 1.1 migration Post to t.publishTime\n $criteria->order='createTime DESC';\n\n $criteria->condition.=' AND createTime > :time1 AND createTime < :time2';\n\n\tif (isset($_GET['month']))\n\t{\n\t\t$month = intval($_GET['month']);\n\t\t$year = intval($_GET['year']);//\tvar_dump($_GET); echo $month.\"#\".$year.\"<br/>\";\n\t}\n\tif (isset($_GET['time']))\n\t{\n\t\t$month = date('n', $_GET['time']);\n\t\t$year = date('Y', $_GET['time']);\t//\tvar_dump($_GET); echo $month.\"#\".$year.\"<br/>\";\n\t}\n\n if ($_GET['pnc'] == 'n') $month++;\n if ($_GET['pnc'] == 'p') $month--;\n $criteria->params[':time1']= $firstDay = mktime(0,0,0,$month,1,$year);\n $criteria->params[':time2']= mktime(0,0,0,$month+1,1,$year);\n\n $pages=new CPagination(Post::model()->count($criteria));\n $pages->pageSize=Yii::app()->params['postsPerPage'];\n $pages->applyLimit($criteria);\n\n $models=Post::model()->findAll($criteria);\n// $models=Post::model()->with('author')->findAll($criteria);\n\n $this->pageTitle=Yii::t('lan','Posts Issued on').' \"'.Yii::t('lan',date('F',$firstDay)).date(', Y',$firstDay).'\"';\n $this->render('month',array(\n 'posts'=>$models,\n 'pages'=>$pages,\n 'firstDay'=> $firstDay,\n ));\n }", "public function buildCalendar($month, $year);", "public function search($currentMonth = false)\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n $criteria->order = 'Fecha DESC';\n\t\t$criteria->compare('Gid',$this->Gid);\n\t\t$criteria->compare('Fecha',$this->Fecha,true);\n\t\t$criteria->compare('t.Descripcion',$this->Descripcion,true);\n\t\t$criteria->compare('Monto',$this->Monto,true);\n $criteria->compare('IdUsuario', Yii::app()->user->getId());\n if ($currentMonth) {\n //we want just the list of the current month in the index action\n $now = New DateTime();\n $current_date_first_day_of_month = $now->format('Y-m') . '-01';\n $db_compare_date = new CDbExpression(\"'$current_date_first_day_of_month'\");\n $criteria->addCondition(\"Fecha >= $db_compare_date\");\n \n //and we add the filter by category\n $cat_table = Categoria::model()->tableName();\n $criteria->join = \"LEFT JOIN $cat_table c ON t.IdCategoria = c.Cid\";\n $criteria->compare('c.Descripcion',$this->_categoryDescription, true);\n }\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 20),\n\t\t));\n\t}", "protected function getGeneralWhereClause() {}", "function wck_fep_filter_auto_drafts_where( $where = '' ){\n\t\t// posts older than 12 hours\n\t\t$where .= \" AND post_date <= '\" . date('Y-m-d H:i:s', strtotime('-12 hours')) . \"'\";\n\t\treturn $where;\n\t}", "public function searchMonth(Request $request){\n $result = Order::with('customer')->where('order_month',$request->order_month)->where('order_year',$request->order_year)->latest()->get();\n return response()->json($result);\n\n }", "function monthParamName() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_monthParamName = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_monthParamName;\n\t}", "public function addWhere($condition)\n\t{\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\t\t$this->wheres[] = $condition;\n\t\treturn $this;\n\t}", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "function getMonthlyReportData($month)\n{\n $sql = sprintf(\"SELECT * FROM PURCHASES WHERE strftime('%m', DATE) = '%s'\", $month);\n\n $rows = array();\n $result = $this->query($sql);\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n array_push($rows, $row);\n }\n return $rows;\n}", "public static function get_events_by_month($date, $limit = NULL, $offset = NULL)\n\t{\n\t\t//$month = ($month % 12 != -1) ? $month % 12 : 12;\n\t\n\t\t//$date = mktime(12, 0, 0, $month, 1, date('Y') + $year);\n\n\t\t$query = Jelly::select('event')\n\t\t ->where('status', '=', 'active')\n\t\t ->where('deleted', '=', NULL)\n\t\t ->where(DB::expr('MONTH(start_date)'), '=', date('m', $date))\n\t\t ->where(DB::expr('YEAR(start_date)'), '=', date('Y', $date))\n\t\t ->or_where(DB::expr('MONTH(end_date)'), '=', date('m', $date))\n\t\t ->where(DB::expr('YEAR(end_date)'), '=', date('Y', $date))\n\t\t ->order_by('start_date', 'ASC');\n\t\t\n\t\tif ($limit)\n\t\t{\n\t\t\t$query->limit($limit);\n\t\t}\n\t\t\n\t\tif ($offset)\n\t\t{\n\t\t\t$query->offset($offset);\n\t\t}\t\t\n\t\n\t\treturn $query->execute();\n\t}", "function sales_report_month($month){\n \t\t$this->db->select('products.PRODUCT, SUM(sales.QUANTITY_SOLD) SALES, products.COST_PRICE, products.SALES_PRICE');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->where('MONTH(sales.SALES_DATE)', $month['MONTH']);\n \t\t$this->db->where('YEAR(sales.SALES_DATE)', $month['YEAR']);\n \t\t$this->db->where('sales.STATUS', 'Confirmed');\n \t\t$this->db->group_by('sales.PRODUCT_ID');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "private function _getDateConditions($months, $year)\n\t{\n\t\t/* TODO: MAKE SURE ALL FIELDS ARE PRESENT BEFORE ARRAY ACCESSES */\n\t\t$dateConditions = array();\n\t\t$startDateConditions = array();\n\t\t$startDateConditions['OR'] = array();\n\t\t$startDateRanges = $this->_getStartDateRanges($months, $year);\n\t\tforeach ($startDateRanges as $pair){\n\t\t\t$and_array = array();\n\t\t\t$and_array['AND'] = array(\n\t\t\t\t'Rental.start_date >=' => $pair['start_date_min'],\n\t\t\t\t'Rental.start_date <=' => $pair['start_date_max']\n\t\t\t);\n\t\t\tarray_push($startDateConditions['OR'], $and_array);\n\t\t}\n\t\t\n\t\tarray_push($dateConditions, $startDateConditions);\t\n\t\treturn array('AND' => $dateConditions);\n\t}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "function get_monthly_birthdays($month)\r\n {\r\n $this->db->from($this->table);\r\n $this->db->where('graduated','0');\r\n $this->db->where('removed', '0');\r\n\r\n $this->db->like('dob', '-' . $month . '-', 'both');\r\n\r\n $this->db->order_by('lastname', 'asc');\r\n $query = $this->db->get();\r\n\r\n return $query->result();\r\n }", "function filter_where( $where = '' ) {\r\n\t$where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-99930 days')) . \"'\";\r\n\treturn $where;\r\n}", "protected function _generateColumnSumQuery($column)\n\t{\n\t\t$publicationId = $this->_getPublicationId();\n\t\t$versionId = $this->_getVersionId();\n\n\t\t$sumQuery = \"SELECT SUM($column)\n\t\t\tFROM `$this->_logsTable`\n\t\t\tWHERE `publication_id`=$publicationId AND `publication_version_id`=$versionId\n\t\t\tORDER BY `year` ASC, `month` ASC\";\n\n\t\treturn $sumQuery;\n\t}", "public function addWhere($where)\n {\n $this->wheres[$where] = $where;\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function modifyWhere(&$sql, $table = 'listings')\n {\n if (!$this->geo_filter_data['applied_location']\n || !$this->geo_filter_data['is_filtering']\n ) {\n return;\n }\n\n if (!$sql) {\n $sql = &$GLOBALS['sql'];\n }\n\n $data_key = $table == 'accounts' ? 'location_account_fields' : 'location_listing_fields';\n $data = $this->geo_filter_data[$data_key];\n\n // Return if location search already performed from the search form\n if (strpos($sql, key($this->geo_filter_data[$data_key]))) {\n return;\n }\n\n foreach ($data as $field => $value) {\n if ($value) {\n $sql .= \"AND `T1`.`{$field}` = '{$value}' \";\n }\n }\n }", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "public function SelectMonth()\r\n {\r\n if(isset($_POST['month'])){\r\n //$mois prends la valeur de month\r\n $mois = $_POST['month'];\r\n //Recupere dans $mois l'ID du mois\r\n $mois = $this->GetMois(substr($mois, 5,2));\r\n //MaisPage recupere $mois\r\n $this->MainPage($mois);\r\n }\r\n //Sinon MainPage ne recupere pas $mois\r\n else{\r\n $this->MainPage();\r\n }\r\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public function setByMonth($value)\n {\n if (!$this->piecesAreInRange($value, 12)) {\n throw new InvalidArgumentException('Invalid value for BYMONTH');\n }\n\n $this->byMonth = $value;\n\n return $this;\n }", "public function addMonths($month){\n\t\t$month = abs($month);\n\t\tif($this->_month+$month>12){\n\t\t\t$year = ceil(($month+$this->_month)/12) - 1;\n\t\t\t$this->_month = ($year * 12) - $this->_month + $month;\n\t\t\t$this->_year+= $year;\n\t\t} else {\n\t\t\t$this->_month+=$month;\n\t\t}\n\t\tif($this->_day>30||($this->_day>28&&$this->_month==2)){\n\t\t\t$this->_day = substr(self::getLastDayOfMonth($this->_month, $this->_year),-2);\n\t\t}\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "public function actionApiMilongas($month = null, $year = null, $all = false){\n\t\treturn $this->_apiEvents(self::DEFAULT_FILTER, $month, $year, $all);\n\t}", "function month( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_MONTH,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_DATE\n );\n\t}", "public function is_month()\n {\n }", "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function where($table,$column,$data = \"\");", "function posts_where($where, $wp_query)\n {\n }", "public function get_month_choices()\n {\n }", "public function month()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array('categories', 'category_fields', 'custom_fields', 'member_data', 'pagination', 'trackbacks');\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '0000'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '2400'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'enable',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'allowed_values' => $disable\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'first_day_of_week',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'start_date_segment',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 3\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\tif ($this->P->value('start_date_segment') AND ee()->uri->segment($this->P->value('start_date_segment')) AND strstr(ee()->uri->segment($this->P->value('start_date_segment')), '-'))\n\t\t\t{\n\t\t\t\tlist($year, $month) = explode('-', ee()->uri->segment($this->P->value('start_date_segment')));\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($year, $month, 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\t\t\t}\n\t\t}\n\t\telseif ($this->P->value('date_range_start', 'day') != 1)\n\t\t{\n\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->P->value('date_range_start', 'year'), $this->P->value('date_range_start', 'month'), 1);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day($this->CDT->days_in_month($this->P->value('date_range_start', 'month'), $this->P->value('date_range_start', 'year')) - 1));\n\t\t$this->P->set('pad_short_weeks', TRUE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\t'EVENTS_PLACEHOLDER',\n\t\t\t\t\t\t'{/',\n\t\t\t\t\t\t'{',\n\t\t\t\t\t\t'}'\n\t\t\t\t\t\t);\n\t\t$replace = array(\tee()->TMPL->tagdata,\n\t\t\t\t\t\t\tLD.T_SLASH,\n\t\t\t\t\t\t\tLD,\n\t\t\t\t\t\t\tRD\n\t\t\t\t\t\t\t);\n\t\tee()->TMPL->tagdata = str_replace($find, $replace, $this->view('month.html', array(), TRUE, $this->sc->addon_theme_path.'templates/month.html'));\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_month'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_month'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day_of_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day_of_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "function sumMonth($con, $monthDate) {\n //Sums the total payments for the given month\n $sql = \"UPDATE months\n SET totAmount = (SELECT SUM(amount) FROM notInInternalList WHERE SUBSTRING(transTime,1,7) = '$monthDate' )\n WHERE month = '$monthDate'\";\n if ($con->query($sql) === FALSE) {\n error_log('['.date(\"F j, Y, g:i a e O\").']'.\"\n Cannot sum for $monthDate: \" . $con->error . \"\\n\", 3, \"./errors.log\");\n }\n}" ]
[ "0.6655173", "0.65773475", "0.62803227", "0.62613374", "0.6123877", "0.60889935", "0.60463506", "0.6019553", "0.5865703", "0.58218545", "0.58139265", "0.57455605", "0.5684279", "0.56477785", "0.5612633", "0.55556333", "0.5487453", "0.54654545", "0.54116017", "0.5329375", "0.5295275", "0.52863294", "0.52060926", "0.5167491", "0.5163659", "0.5163084", "0.51553273", "0.5151822", "0.51445544", "0.5101902", "0.50874126", "0.5081745", "0.5066358", "0.50582486", "0.5050326", "0.5041087", "0.5037691", "0.5026257", "0.50243276", "0.5017439", "0.501074", "0.5002644", "0.49885827", "0.49867228", "0.4983906", "0.49488863", "0.49464598", "0.49429977", "0.49427545", "0.49422488", "0.49336568", "0.49320188", "0.4926348", "0.49238443", "0.49204072", "0.49200088", "0.49043038", "0.48909643", "0.48895136", "0.4889453", "0.48841754", "0.48817185", "0.48631173", "0.48614457", "0.48292795", "0.48246208", "0.48156375", "0.48115608", "0.48065484", "0.47982082", "0.47975692", "0.47733", "0.47699183", "0.47634256", "0.47546312", "0.47542542", "0.47528356", "0.4751789", "0.47404745", "0.47399774", "0.4736629", "0.47252908", "0.47203135", "0.47187975", "0.47105005", "0.47103336", "0.47085807", "0.46983278", "0.46924633", "0.46818364", "0.4675458", "0.4672059", "0.46687523", "0.46664593", "0.46609166", "0.46596375", "0.46551153", "0.46508232", "0.46406916", "0.4639939" ]
0.65504247
2
Add a "where date" to the query.
public function year($column, $year, $boolean = 'and', $not = false) { return $this->where_assoc(array('year('.$column.')' => $year), $boolean, $not); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpfc_temp_filter_where( $where = '' ) {\n\t \t$where .= \" AND post_date >= '\".date(\"Y-m-d\", $_REQUEST['start']).\"' AND post_date < '\".date(\"Y-m-d\", $_REQUEST['end']).\"'\";\n\t \treturn $where;\n\t }", "function filter_where($where = '') {\n $postid = get_the_ID();\n $format = 'Y-m-d';\n $publish_date = get_the_date( $format, $postid);\n\n $where .= \" AND post_date <= '\" . $publish_date . \"'\";\n\n return $where;\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function filter_where($where = '') {\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-30 days')) . \"'\";\n return $where;\n }", "protected function whereDate(Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return $this->wrap($where['column']).'::date '.$where['operator'].' '.$value;\n }", "protected function whereDate(Builder $query, $where)\n {\n return $this->dateBasedWhere('date', $query, $where);\n }", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "function whereQuery() {\n // $arrDate1 = explode(\"-\", $bulantahunpenggajian);\n // $date1 = $arrDate1[0].'-'.$arrDate1[1].'-01';\n // $date2 = $arrDate1[0].'-'.$arrDate1[1].'-'.cal_days_in_month(CAL_GREGORIAN, $arrDate1[1], $arrDate1[0]);\n \n // $wer = \" A.MONTH = '\".$arrDate1[1].\"' AND A.YEAR = \".$arrDate1[0].\"\";\n \n // return $wer;\n return '';\n }", "function filter_where( $where = '' ) {\r\n\t$where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-99930 days')) . \"'\";\r\n\treturn $where;\r\n}", "protected function getWhereClause() {}", "protected function user_where_clause() {}", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "protected function dateBasedWhere(string $type, Builder $query, array $where)\n {\n $value = $this->parameter($where['value']);\n\n return $type . '(' . $this->wrap($where['column']) . ') ' . $where['operator'] . ' ' . $value;\n }", "function wck_fep_filter_auto_drafts_where( $where = '' ){\n\t\t// posts older than 12 hours\n\t\t$where .= \" AND post_date <= '\" . date('Y-m-d H:i:s', strtotime('-12 hours')) . \"'\";\n\t\treturn $where;\n\t}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "protected function whereDate(Builder $builder, $where): string\n {\n return $this->dateBasedWhere('date', $builder, $where);\n }", "protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and')\n {\n return $this->callHook(\"where{$type}\", $this->packArgs(compact('column', 'operator', 'value', 'boolean')));\n }", "public function statistics_ref_duration_where( $where ) {\n\t\t\tglobal $wpdb;\n\t\t\t$after_date = $this->request->get_param( 'after' );\n\t\t\t$before_date = $this->request->get_param( 'before' );\n\n\t\t\tif ( $after_date ) {\n\t\t\t\t$s_date = strtotime( $after_date );\n\t\t\t\t$where .= ( false !== $s_date ) ? $wpdb->prepare( ' AND statref.create_time >= %s', $s_date ) : '';\n\t\t\t}\n\n\t\t\tif ( $before_date ) {\n\t\t\t\t$e_date = strtotime( $before_date );\n\t\t\t\t$where .= ( false !== $e_date ) ? $wpdb->prepare( ' AND statref.create_time <= %s', $e_date ) : '';\n\t\t\t}\n\n\t\t\treturn $where;\n\t\t}", "function filter_where($where = '') {\n global $popular_days;\n //posts in the last X days\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-'.$popular_days.' days')) . \"'\";\n return $where;\n}", "public function addDateFilter()\n\t{\n\t\t$this->_addFilter(new DataGrid\\Filters\\DateFilter());\n\t\treturn $this->getFilter();\n\t}", "protected function getGeneralWhereClause() {}", "public function today($where = []){\n return $this->where($where);\n }", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "private function getQueryStringDate() {\n\t\tif($this->date) {\n\t\t\treturn $this->date . '['.$this->qType.']';\n\t\t}\n\t\t$startDate = (new DateTime('-14 days'))->format('Ymd');\n\t\t$endDate = (new DateTime('tomorrow'))->format('Ymd');\n\t\t$qDate = '`'.$this->qType.' > '.$startDate.' < '.$endDate;\n\t\treturn $qDate;\n\t}", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n\t\tparent::_buildQueryWhere($query);\n\n\t\tif($this->_state->type) {\n\t\t\t$query->where('tbl.subscription_type', '=', $this->_state->type);\n\t\t} elseif($this->_state->type_name) {\n\t\t\t$table = $this->getService('com://admin/ninjaboard.database.table.watches');\n\t\t\t$query->where('tbl.subscription_type', '=', $table->getTypeIdFromName($this->_state->type_name));\n\t\t}\n\t\t\n\t\tif($this->_state->type_id) {\n\t\t\t$query->where('tbl.subscription_type_id', '=', $this->_state->type_id);\n\t\t}\n\t\t\n\t\tif($this->_state->by) {\n\t\t\t$query->where('tbl.created_by', '=', $this->_state->by);\n\t\t}\n\t}", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function whereDate($column, $operator, $value, $boolean = 'and')\n {\n return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean);\n }", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function addWhere($where)\n {\n $this->wheres[$where] = $where;\n }", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "function filterByDate($date) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_DATE);\n $this->setAdditionalProperty('date_filter_on', (string) $date);\n }", "private function filterDay()\n {\n try {\n if(empty($this->day)) {\n return;\n }\n\n $dayDT = new DateTime(DateHelper::parseDateTime($this->day), DateHelper::getSystemTimeZone());\n\n $endDT = clone $dayDT;\n $endDT->setTime(23,59,59);\n $end = $endDT->getTimestamp();\n\n $start = $dayDT->setTime(0,0,0)->getTimestamp();\n\n $this->query->andWhere(['<=', 'log_time', $end]);\n $this->query->andWhere(['>=', 'log_time', $start]);\n\n } catch (\\Exception $e) {\n Yii::error($e, 'admin');\n }\n }", "public static function posts_where( $where_sql, $query ) {\n\t\t\tglobal $wpdb;\n\n\t\t\t// if it's a true event query then we to setup where conditions\n\t\t\t// but only if we aren't grabbing a specific post\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\t$query->tribe_is_event\n\t\t\t\t\t|| $query->tribe_is_event_category\n\t\t\t\t)\n\t\t\t\t&& empty( $query->query_vars['name'] )\n\t\t\t\t&& empty( $query->query_vars['p'] )\n\t\t\t) {\n\n\t\t\t\t$postmeta_table = self::postmeta_table( $query );\n\n\t\t\t\t$start_date = $query->get( 'start_date' );\n\t\t\t\t$end_date = $query->get( 'end_date' );\n\t\t\t\t$use_utc = Tribe__Events__Timezones::is_mode( 'site' );\n\t\t\t\t$site_tz = $use_utc ? Tribe__Events__Timezones::wp_timezone_string() : null;\n\n\t\t\t\t// Sitewide timezone mode: convert the start date - if set - to UTC\n\t\t\t\tif ( $use_utc && ! empty( $start_date ) ) {\n\t\t\t\t\t$start_date = Tribe__Events__Timezones::to_utc( $start_date, $site_tz );\n\t\t\t\t}\n\n\t\t\t\t// Sitewide timezone mode: convert the end date - if set - to UTC\n\t\t\t\tif ( $use_utc && ! empty( $end_date ) ) {\n\t\t\t\t\t$end_date = Tribe__Events__Timezones::to_utc( $end_date, $site_tz );\n\t\t\t\t}\n\n\t\t\t\t// we can't store end date directly because it messes up the distinct clause\n\t\t\t\t$event_end_date = apply_filters( 'tribe_events_query_end_date_column', 'tribe_event_end_date.meta_value' );\n\n\t\t\t\t// event start date\n\t\t\t\t$event_start_date = \"{$postmeta_table}.meta_value\";\n\n\t\t\t\t// build where conditionals for events if date range params are set\n\t\t\t\tif ( $start_date != '' && $end_date != '' ) {\n\t\t\t\t\t$start_clause = $wpdb->prepare( \"($event_start_date >= %s AND $event_start_date <= %s)\", $start_date, $end_date );\n\t\t\t\t\t$end_clause = $wpdb->prepare( \"($event_end_date >= %s AND $event_start_date <= %s )\", $start_date, $end_date );\n\t\t\t\t\t$within_clause = $wpdb->prepare( \"($event_start_date < %s AND $event_end_date >= %s )\", $start_date, $end_date );\n\t\t\t\t\t$where_sql .= \" AND ($start_clause OR $end_clause OR $within_clause)\";\n\t\t\t\t} else {\n\t\t\t\t\tif ( $start_date != '' ) {\n\t\t\t\t\t\t$start_clause = $wpdb->prepare( \"{$postmeta_table}.meta_value >= %s\", $start_date );\n\t\t\t\t\t\t$within_clause = $wpdb->prepare( \"({$postmeta_table}.meta_value <= %s AND $event_end_date >= %s )\", $start_date, $start_date );\n\t\t\t\t\t\t$where_sql .= \" AND ($start_clause OR $within_clause)\";\n\t\t\t\t\t\tif ( $query->is_singular() && $query->get( 'eventDate' ) ) {\n\t\t\t\t\t\t\t$tomorrow = date( 'Y-m-d', strtotime( $query->get( 'eventDate' ) . ' +1 day' ) );\n\t\t\t\t\t\t\t$tomorrow_clause = $wpdb->prepare( \"{$postmeta_table}.meta_value < %s\", $tomorrow );\n\t\t\t\t\t\t\t$where_sql .= \" AND $tomorrow_clause\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $end_date != '' ) {\n\t\t\t\t\t\t\t$where_sql .= ' AND ' . $wpdb->prepare( \"$event_end_date < %s\", $end_date );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tremove_filter( 'option_page_on_front', array( __CLASS__, 'default_page_on_front' ) );\n\n\t\t\treturn $where_sql;\n\t\t}", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "public function modifyWhere(&$sql, $table = 'listings')\n {\n if (!$this->geo_filter_data['applied_location']\n || !$this->geo_filter_data['is_filtering']\n ) {\n return;\n }\n\n if (!$sql) {\n $sql = &$GLOBALS['sql'];\n }\n\n $data_key = $table == 'accounts' ? 'location_account_fields' : 'location_listing_fields';\n $data = $this->geo_filter_data[$data_key];\n\n // Return if location search already performed from the search form\n if (strpos($sql, key($this->geo_filter_data[$data_key]))) {\n return;\n }\n\n foreach ($data as $field => $value) {\n if ($value) {\n $sql .= \"AND `T1`.`{$field}` = '{$value}' \";\n }\n }\n }", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "protected function dateBasedWhere($type, Builder $builder, $where): string\n {\n $value = $this->parameter($where['value']);\n\n return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "public function addWhere($condition)\n\t{\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\t\t$this->wheres[] = $condition;\n\t\treturn $this;\n\t}", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function addDateRangeQuery(sfWebRequest $request, Doctrine_Query $q = null)\n {\n if (!$q)\n {\n $q = $this->createQuery('p');\n }\n\n return $q;\n }", "public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }", "public function addWhere(Expression $expression, $type = AbstractSearchQuery::WHERE_AND);", "function channel_entries_sql_where($sql, &$channel)\n\t{\n\n\t\tif ( is_string( $this->EE->extensions->last_call ) === TRUE )\n\t\t{\n\t\t\t$sql\t= $this->EE->extensions->last_call;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tShould we proceed?\n\t\t/** ----------------------------------------*/\n\n\t\tif ( $this->EE->TMPL->fetch_param('date_field') === FALSE OR $this->EE->TMPL->fetch_param('date_field') == '' )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( ( $this->EE->TMPL->fetch_param('date_field_start') === FALSE OR $this->EE->TMPL->fetch_param('date_field_start') == '' ) AND ( $this->EE->TMPL->fetch_param('date_field_stop') === FALSE OR $this->EE->TMPL->fetch_param('date_field_stop') == '' ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\tif ( empty( $this->EE->TMPL->site_ids ) )\n\t\t{\n\t\t\treturn $sql;\n\t\t}\n\n\t\t/** ----------------------------------------\n\t\t/**\tLoop for site ids and add DB queries\n\t\t/** ----------------------------------------*/\n\n\t\t$sql_a\t= array();\n\n\t\tforeach ( $this->EE->TMPL->site_ids as $site_id )\n\t\t{\n\t\t\tif ( ! empty( $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ] ) )\n\t\t\t{\n\t\t\t\t$field_id\t= $channel->dfields[$site_id][ $this->EE->TMPL->fetch_param('date_field') ];\n\n\t\t\t\t$sql_b\t= array();\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_start') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} >= '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_start') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\n\t\t\t\t}\n\n\t\t\t\tif ( $this->EE->TMPL->fetch_param('date_field_stop') != '' )\n\t\t\t\t{\n\t\t\t\t\t$sql_b[]\t= \" ( wd.field_id_{$field_id} < '\".$this->EE->localize->string_to_timestamp( $this->EE->db->escape_str( $this->EE->TMPL->fetch_param('date_field_stop') ) ).\"' AND wd.site_id = \" . $this->EE->db->escape_str( $site_id ) . \" )\";\n\t\t\t\t}\n\n\t\t\t\t$sql_a[]\t= implode( ' AND ', $sql_b );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $sql_a ) )\n\t\t{\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tPrepare the necessary DB join\n\t\t\t/** ----------------------------------------*/\n\n\t\t\tif ( strpos($sql, 'LEFT JOIN exp_channel_data') === FALSE )\n\t\t\t{\n\t\t\t\t$sql = str_replace( 'LEFT JOIN exp_members', 'LEFT JOIN exp_channel_data AS wd ON wd.entry_id = t.entry_id LEFT JOIN exp_members', $sql );\n\t\t\t}\n\n\t\t\t/** ----------------------------------------\n\t\t\t/**\tAdd our new conditions\n\t\t\t/** ----------------------------------------*/\n\n\t\t\t$sql\t.= \" AND ( \" . implode( ' OR ', $sql_a ) . \" )\";\n\t\t}\n\n\t\t/*\n\t\tif ( $SESS->userdata('group_id') == '1' )\n\t\t{\n\t\t\techo \"Visible only to Super Admins<br /><br />\";\n\t\t\tprint_r( $sql );\n\t\t\techo \"<br /><br />Visible only to Super Admins\";\n\t\t}\n\t\t*/\n\t\treturn $sql;\n\t}", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "protected function whereDay(Builder $query, $where)\n {\n return $this->dateBasedWhere('day', $query, $where);\n }", "function get_date_where($max_levels=3)\n {\n global $page;\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $y = $date[CYEAR];\n $res = \" AND $this->date_field BETWEEN '$y-01-01' AND '$y-12-31 23:59:59'\";\n }\n\n if (isset($date[CWEEK]) and $date[CWEEK]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CWEEK]['sql'].'='.$date[CWEEK];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n if (empty($res))\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n }\n return $res;\n }", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "protected function addCommonViewFiltersForDate(QueryBuilder $qb)\n {\n if (null === $this->request) {\n return $qb;\n }\n $routeName = $this->request->get('_route');\n if (false !== strpos($routeName, 'edit')) {\n return $qb;\n }\n \n $parameters = $this->getViewQuickNavParametersForDate();\n foreach ($parameters as $k => $v) {\n if ($k == 'catId') {\n if (intval($v) > 0) {\n // single category filter\n $qb->andWhere('tblCategories.category = :category')\n ->setParameter('category', $v);\n }\n continue;\n }\n if ($k == 'catIdList') {\n // multi category filter\n $qb = $this->categoryHelper->buildFilterClauses($qb, 'date', $v);\n continue;\n }\n if (in_array($k, ['q', 'searchterm'])) {\n // quick search\n if (!empty($v)) {\n $qb = $this->addSearchFilter('date', $qb, $v);\n }\n continue;\n }\n \n if (is_array($v)) {\n continue;\n }\n \n // field filter\n if ((!is_numeric($v) && $v != '') || (is_numeric($v) && $v > 0)) {\n if ($k == 'workflowState' && substr($v, 0, 1) == '!') {\n $qb->andWhere('tbl.' . $k . ' != :' . $k)\n ->setParameter($k, substr($v, 1, strlen($v)-1));\n } elseif (substr($v, 0, 1) == '%') {\n $qb->andWhere('tbl.' . $k . ' LIKE :' . $k)\n ->setParameter($k, '%' . substr($v, 1) . '%');\n } else {\n $qb->andWhere('tbl.' . $k . ' = :' . $k)\n ->setParameter($k, $v);\n }\n }\n }\n \n $qb = $this->applyDefaultFiltersForDate($qb, $parameters);\n \n return $qb;\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public function date($column, $date, $boolean = 'and', $not = false)\r\n {\r\n return $this->where('date('.$column.') = ?', $date, $boolean, $not);\r\n }", "static function before($query) {\n\t\t$before = Input::get('before');\n\t\tif ($before != '') {\n\t\t\t$beforeDate = new \\DateTime($before);\n\t\t\t$query = $query->where('create_date', '<=', $beforeDate);\n\t\t}\n\t\treturn $query;\n\t}", "private function sql_whereAnd_fromTS()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS value\n $andWhere = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'sql.' ][ 'andWhere' ];\n\n if ( !empty( $andWhere ) )\n {\n $andWhere = \" AND \" . $andWhere;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function makeFilter_date($field, $date, $negate = false) {\r\n\t\treturn TodoyuSearchFilterHelper::makeFilter_date(self::TABLE, $field, $date, $negate);\r\n\t}", "abstract public function where(array $where);", "function setWhere($where) {\n $this->where = $where;\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function whereAdd($where,$clause)\n{\n\tif(!strlen($clause))\n\t\treturn $where;\n\tif(!strlen($where))\n\t\treturn $clause;\n\treturn \"(\".$where.\") and (\".$clause.\")\";\n}", "public function filterDataTable($query, $request)\n {\n if (isset($request['req']['from']) && $request['req']['from'] != '') {\n $query->whereDate('created_at', '>=', $request['req']['from']);\n }\n\n if (isset($request['req']['to']) && $request['req']['to'] != '') {\n $query->whereDate('created_at', '<=', $request['req']['to']);\n }\n\n if (isset($request['req']['type']) && $request['req']['type'] != '') {\n $query->where('type', '=', $request['req']['type']);\n }\n \n \n\n \n\n \n return $query;\n }", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "function get_occurs_within_where_clause($table_name, $rel_table, $start_ts_obj, $end_ts_obj, $field_name='date_start', $view){\n\t\tglobal $timedate;\n\t\n\t\t$start = clone $start_ts_obj;\n\t\t$end = clone $end_ts_obj;\n\n\t\t$field_date = $table_name.'.'.$field_name;\n\t\t$start_day = $GLOBALS['db']->convert(\"'{$start->asDb()}'\",'datetime');\n\t\t$end_day = $GLOBALS['db']->convert(\"'{$end->asDb()}'\",'datetime');\n\n\t\t$where = \"($field_date >= $start_day AND $field_date < $end_day\";\n\t\tif($rel_table != ''){\n\t\t\t$where .= \" AND $rel_table.accept_status != 'decline'\";\n\t\t}\n\n\t\t$where .= \")\";\n\t\treturn $where;\n\t}", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "protected function appendWhereString($string)\n {\n $this->whereString .= $string;\n return $this;\n }", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function get_date_where($max_levels=3)\n {\n global $page;\n\n $date = $page['chronology_date'];\n while (count($date)>$max_levels)\n {\n array_pop($date);\n }\n $res = '';\n if (isset($date[CYEAR]) and $date[CYEAR]!=='any')\n {\n $b = $date[CYEAR] . '-';\n $e = $date[CYEAR] . '-';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $b .= sprintf('%02d-', $date[CMONTH]);\n $e .= sprintf('%02d-', $date[CMONTH]);\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $b .= sprintf('%02d', $date[CDAY]);\n $e .= sprintf('%02d', $date[CDAY]);\n }\n else\n {\n $b .= '01';\n $e .= $this->get_all_days_in_month($date[CYEAR], $date[CMONTH]);\n }\n }\n else\n {\n $b .= '01-01';\n $e .= '12-31';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n $res = \" AND $this->date_field BETWEEN '$b' AND '$e 23:59:59'\" . $res;\n }\n else\n {\n $res = ' AND '.$this->date_field.' IS NOT NULL';\n if (isset($date[CMONTH]) and $date[CMONTH]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CMONTH]['sql'].'='.$date[CMONTH];\n }\n if (isset($date[CDAY]) and $date[CDAY]!=='any')\n {\n $res .= ' AND '.$this->calendar_levels[CDAY]['sql'].'='.$date[CDAY];\n }\n }\n return $res;\n }", "protected function _myDdateFilter($collection, $column)\n {\n /*if (!$value = $column->getFilter()->getValue()) {\n return $this;\n }\n $from = $filters['from'];\n $to = $filters['to'];\n if ($from) {\n $this->getCollection()->addFieldToFilter('main_table.ddate', array(\n 'gteq' => $from->toString('yyyy-MM-dd')\n ));\n }\n if ($to) {\n $this->getCollection()->addFieldToFilter('main_table.ddate', array(\n 'lteq' => $to->toString('yyyy-MM-dd')\n ));\n }*/\n if (!$value = $column->getFilter()->getValue()) {\n return $this;\n }\n $filters = $column->getFilter()->getValue();\n\n $from = $filters['from'];\n $to = $filters['to'];\n if($from)\n $this->getCollection()->addFieldToFilter('main_table.ddate', array('gteq' => $from->toString('yyyy-MM-dd')));\n if($to)\n $this->getCollection()->addFieldToFilter('main_table.ddate', array('lteq' => $to->toString('yyyy-MM-dd')));\n }", "final public function addWhere(YMKM_SQL_Entity_Where $s)\n {\n $this->doAddWhere($s);\n return $this;\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "function where($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['where'])) $this->query['where'] = array();\n\t$this->query['where'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public static function where(array $where);", "protected function addWhere( $query, $key, $extraValue )\n\t{\n\t\tif ( $extraValue === 'NULL' )\n\t\t{\n\t\t\t$query->whereNull( $key );\n\t\t}\n\t\telseif ( $extraValue === 'NOT_NULL' )\n\t\t{\n\t\t\t$query->whereNotNull( $key );\n\t\t}\n\t\telseif ( Str::startsWith( $extraValue, '!' ) )\n\t\t{\n\t\t\t$query->where( $key, '!=', mb_substr( $extraValue, 1 ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query->where( $key, $extraValue );\n\t\t}\n\t}", "private function tinydb_add_where($query)\n {\n return static::tinydb_add_where_for_pkey($this->get_id(), $query);\n }", "function setDateFilter($value) {\n return $this->setAdditionalProperty('date_filter', $value);\n }", "private function buildWhere($existing, $add)\n {\n if(empty($existing))\n return \"WHERE {$add} \";\n else\n return \"{$existing} AND {$add} \";\n }", "static function after($query) {\n\t\t$after = Input::get('after');\n\t\tif ($after != '') {\n\t\t\t$afterDate = new \\DateTime($after);\n\t\t\t$query = $query->where('create_date', '>=', $afterDate);\n\t\t}\n\t\treturn $query;\n\t}", "function _add_where_clause($where_clauses, $join)\n {\n $clauses = array();\n foreach ($where_clauses as $clause) {\n extract($clause);\n if ($this->object->has_column($column)) {\n $column = \"`{$column}`\";\n }\n if (!is_array($value)) {\n $value = array($value);\n }\n foreach ($value as $index => $v) {\n $v = $clause['type'] == 'numeric' ? $v : \"'{$v}'\";\n $value[$index] = $v;\n }\n if ($compare == 'BETWEEN') {\n $value = \"{$value[0]} AND {$value[1]}\";\n } else {\n $value = implode(', ', $value);\n if (strpos($compare, 'IN') !== FALSE) {\n $value = \"({$value})\";\n }\n }\n $clauses[] = \"{$column} {$compare} {$value}\";\n }\n $this->object->_where_clauses[] = implode(\" {$join} \", $clauses);\n }", "public function getFileFilterByDate($conn, $date){\n\t\t//preparo lo statement che mi ricava tutte le informazioni \n\t\t$sth = $conn->prepare(\"select * from Filmato_Presentazione where data_inizio >= :data_inizio or data_fine >= :data_fine limit 1\");\n\t\t$sth->bindParam(':data_inizio', $date, PDO::PARAM_STR);\n\t\t$sth->bindParam(':data_fine', $date, PDO::PARAM_STR);\n\t\t$sth->execute();\n\t\treturn $sth; \n\t}", "public function addConditionToQuery($query, array $condition)\n\t{\n\t\t$value = trim(array_get($condition, 'value'));\n\t\t$field = array_get($condition, 'field');\n\t\t\n\t\tif ('xref_id' == $field) {\n\t\t\t$field = 'objectID';\n\t\t}\n\t\t\n\t\tif (array_get($condition, 'filter')) {\n\t\t\tif (is_numeric($value)) {\n\t\t\t\t$query['query']['numericFilters'][] = \"{$field}={$value}\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query['query']['facetFilters'][] = \"{$field}:{$value}\";\n\t\t\t}\n\t\t}\n\t\telse if (array_get($condition, 'lat')) {\n\t\t\t$query['query']['aroundLatLng'] = array_get($condition, 'lat') . ',' . array_get($condition, 'long');\n\t\t\t$query['query']['aroundRadius'] = array_get($condition, 'distance');\n\t\t}\n\t\telse {\n\t\t\t$query['terms'] .= ' ' . $value;\n\t\t\t\n\t\t\tif (!empty($field) && '*' !== $field) {\n\t\t\t\t$field = is_array($field) ? $field : array($field);\n\t\t\t\t$query['query']['restrictSearchableAttributes'] = implode(',', $field);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $query;\n\t}", "public function where($where, $data=null) {\n\t\treturn parent::where($where, $data);\n\t}", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "public function scopePublishedBefore($query, $date)\n {\n $query->where('created_at', '<=', $date);\n }", "public function updateQuery(AbstractSearch $searchManager, array $sql, \\wpdb $databaseAdapter)\n {\n\n $date = array(\n \"y\" => \"%\",\n \"m\" => \"%\",\n \"d\" => \"%\"\n );\n\n if ($year = get_query_var(\"year\")) {\n $date['y'] = $year;\n }\n\n if ($month = get_query_var(\"monthnum\")) {\n if ($month < 10) {\n $month = \"0\" . $month;\n }\n\n $date['m'] = $month;\n }\n\n if ($day = get_query_var(\"day\")) {\n $date['d'] = $day;\n }\n\n $formattedDate = implode(\"-\", $date);\n\n $sql['where'] .= $databaseAdapter->prepare(\"and p.post_date like '%s' \", $formattedDate);\n\n return $sql;\n }" ]
[ "0.6846684", "0.6713724", "0.66842854", "0.65861285", "0.6496779", "0.64480525", "0.6443426", "0.64316624", "0.63731253", "0.6287003", "0.6263355", "0.62250733", "0.62144685", "0.62063843", "0.61397207", "0.6050436", "0.6031684", "0.60042846", "0.60006547", "0.6000313", "0.5991623", "0.5954816", "0.59526074", "0.5951495", "0.59092516", "0.5886339", "0.5879139", "0.5864217", "0.5841473", "0.5818926", "0.5808391", "0.5805485", "0.57869685", "0.57770073", "0.57572085", "0.5746351", "0.5746056", "0.57318306", "0.57246554", "0.5690615", "0.5686666", "0.5651808", "0.5643243", "0.5643243", "0.56311274", "0.55899286", "0.55849427", "0.55642354", "0.55440044", "0.55115324", "0.5508477", "0.54990995", "0.5492234", "0.54767483", "0.5463828", "0.5422695", "0.5407326", "0.54041165", "0.5401697", "0.539549", "0.5392533", "0.5384564", "0.5377906", "0.53728056", "0.53641844", "0.53599894", "0.535613", "0.53552973", "0.53549546", "0.5351851", "0.53449565", "0.53448355", "0.5340238", "0.53358537", "0.533369", "0.53216463", "0.53211415", "0.5320321", "0.53195333", "0.53152883", "0.5312661", "0.5308566", "0.5307076", "0.5298195", "0.5296766", "0.5283885", "0.5281403", "0.52797604", "0.52776724", "0.5277025", "0.5276237", "0.52747965", "0.52718425", "0.52694404", "0.5263858", "0.525126", "0.52476376", "0.5234632", "0.52319545", "0.52267706", "0.5223993" ]
0.0
-1
Set fetch mode as assoc
public function as_assoc() { $this->fetch_mode = 'assoc'; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SetPdoFetchMode($mode = PDO::FETCH_ASSOC)\n {\n $this->pdoFetch = $mode;\n }", "public function setFetchMode($mode) {\n\t\t$this->_defaultFetchMode = $mode;\n\t}", "private static function setFetchType( $mode )\n {\n switch ( $mode ):\n case 'assoc':\n return self::$stmt->setFetchMode( \\PDO::FETCH_ASSOC );\n case 'bound':\n return self::$stmt->setFetchMode( \\PDO::FETCH_BOUND );\n case 'both':\n return self::$stmt->setFetchMode( \\PDO::FETCH_BOTH );\n case 'class':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS, self::$FETCH_CLASS );\n case 'class_prop':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, self::$FETCH_CLASS, self::$_FETCH_CLASS_PARAMS );\n case 'class_type':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS | \\PDO::FETCH_CLASSTYPE );\n case 'column':\n return self::$stmt->setFetchMode( \\PDO::FETCH_COLUMN, self::$FETCH_OFFSET );\n case 'column_group':\n return self::$stmt->setFetchMode( \\PDO::FETCH_GROUP, self::$FETCH_OFFSET );\n case 'column_unique':\n return self::$stmt->setFetchMode( \\PDO::FETCH_UNIQUE, self::$FETCH_OFFSET );\n case 'func':\n return self::$stmt->setFetchMode( \\PDO::FETCH_FUNC, self::$FETCH_FUNC );\n case 'into':\n return self::$stmt->setFetchMode( \\PDO::FETCH_INTO, self::$FETCH_CLASS );\n case 'key_pair':\n return self::$stmt->setFetchMode( \\PDO::FETCH_KEY_PAIR );\n case 'lazy':\n return self::$stmt->setFetchMode( \\PDO::FETCH_LAZY );\n case 'named':\n return self::$stmt->setFetchMode( \\PDO::FETCH_NAMED );\n case 'num':\n return self::$stmt->setFetchMode( \\PDO::FETCH_NUM );\n case 'obj':\n return self::$stmt->setFetchMode( \\PDO::FETCH_OBJ );\n case 'serialize':\n return self::$stmt->setFetchMode( \\PDO::FETCH_SERIALIZE );\n default:\n return self::$stmt->setFetchMode( \\PDO::FETCH_ASSOC );\n endswitch;\n }", "public function fetchAssoc(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_assoc\";\n return $this;\n }", "public function setFetchMode ($mode)\n {\n // check for PDO extension\n //if (! extension_loaded('pdo')) {\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n // throw new EhrlichAndreas_Db_Exception('The PDO extension is required for this adapter but the extension is not loaded');\n //}\n switch ($mode)\n {\n case EhrlichAndreas_Db_Abstract::FETCH_LAZY:\n \n case EhrlichAndreas_Db_Abstract::FETCH_ASSOC:\n \n case EhrlichAndreas_Db_Abstract::FETCH_NUM:\n \n case EhrlichAndreas_Db_Abstract::FETCH_BOTH:\n \n case EhrlichAndreas_Db_Abstract::FETCH_NAMED:\n \n case EhrlichAndreas_Db_Abstract::FETCH_OBJ:\n \n $this->_fetchMode = $mode;\n\n break;\n\n default:\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n throw new EhrlichAndreas_Db_Exception(\"Invalid fetch mode '$mode' specified\");\n\n break;\n }\n }", "public function fetchAssoc();", "public function fetchAssoc();", "public function setFetchMode($fetchMode);", "public abstract function fetchAssoc();", "public function setFetchMode($mode, $fetch_arga = NULL, $fetch_argb = NULL)\r\n\t{\r\n\t\tswitch($mode)\r\n\t\t{\r\n\t\t\tcase LikePDO::FETCH_ASSOC :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_ASSOC;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOTH :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOTH;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOUND :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOUND;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_CLASS :\r\n\t\t\t\tif(!class_exists($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($fetch_argb)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!is_array($fetch_argb))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Warning: LikePDOStatement::setFetchMode() expects parameter 3 to be array on parameter 1 is FETCH_CLASS, \".gettype($fetch_argb).\" given\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->fetchModeArguments = $fetch_argb;\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$this->fetchModeArguments = array();\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_CLASS;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\tbreak;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_INTO :\r\n\t\t\t\tif(!is_object($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_INTO;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_LAZY :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_LAZY;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NAMED :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NAMED;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NUM :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NUM;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_OBJ :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_OBJ;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\tthrow new LikePDOException(\"Invalid fetch mode\");\r\n\t\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function setFetchMode($fetch_mode) {\n\t\t$this->fetchMode = $fetch_mode;\n\t}", "public abstract function FetchAssoc();", "public function setFetchMode($mode, $classNameObject = null, $ctor_args = null): void\n {\n $driverMode = ResultSet::FETCH_OBJECT;\n\n // \\PDO::FETCH_ASSOC\n if ($mode === 2) {\n $driverMode = ResultSet::FETCH_ASSOC;\n }\n\n $this->fetchMode = $driverMode;\n }", "abstract protected function fetchAssoc();", "public function setFetchMode($mode, $PDO::FETCH_COLUMN, $colno, $PDO::FETCH_CLASS, $classname, $ctorargs, $PDO::FETCH_INTO, $object)\n {\n }", "public function fetch($fetchMode = \\PDO::FETCH_BOTH);", "public function set_fetchMode($type)\r\n {\r\n }", "public function setFetchMode(int $mode, mixed ...$args);", "function setFetchMode($mode, $params=null) \n {\n $ret = call_user_func_array(array('parent', 'setFetchMode'), func_get_args());\n return $ret ? $this : $ret;\n }", "public function fetchAssoc()\n {\n return $this->fetch();// \\PDO::FETCH_ASSOC\n }", "public function setFetchMode($fetchMode) {\n $this->_fetchMode = $fetchMode;\n }", "public function testResultFetchAssoc()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t\n \t$this->assertEquals(array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $result->fetchAssoc());\n \t$this->assertEquals(array('id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE'), $result->fetchAssoc());\n \t$this->assertNull($result->fetchAssoc());\n \t\n \t$result->resetPointer();\n \t$this->assertEquals(array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $result->fetchAssoc(), \"Fetch after reset pointer: \");\n }", "abstract protected function fetchRowAssocDb();", "public function as_assoc();", "protected function fetchAssoc()\n {\n return oci_fetch_assoc($this->resultID);\n }", "public function setFetchMode($fetchMode)\n {\n $this->fetchMode = $fetchMode;\n }", "public function fetch(int $mode = \\PDO::ATTR_DEFAULT_FETCH_MODE, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0);", "public function fetch_assoc()\n\t{\n\t\t$assoc = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$assoc[$key] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$assoc = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $assoc;\n\t}", "public function setFetchmode(Fetchmode $fetchmode) {\n $this->fetchmode[$fetchmode->getPath()]= $fetchmode->getMode();\n return $this;\n }", "public function fetchAll($fetchMode = \\PDO::FETCH_BOTH);", "public function getFetchMode()\n\t{\n\t\treturn $this->fetchMode;\n\t}", "public function mode(...$mode)\n\t{\n\t\tif (!$this->setFetchMode(...$mode))\n\t\t{\n\t\t\tthrow new UnableToSetFetchMode($mode);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getFetchMode()\n {\n return $this->fetchMode;\n }", "public function CMSFetchMode($mode)\n {\n $this->cmsFetchMode = $mode;\n }", "public function setFetchMode($fetchMode, $fetchArgument = null, array $fetchConstructorArgument = [])\n\t{\n $this->neoeloquent->setFetchMode($fetchMode);\n\t}", "function fetch_assoc()\n {\n if (!$this->res_result) {\n $this->error = \"No Resultset can be fetched from query\";\n return null;\n } else {\n $_rec = @isis_fetch_flat_array($this->res_result);\n }\n\n return $_rec;\n }", "abstract public function fetchByAssoc(\n &$result,\n $rowNum = -1, \n $encode = true);", "public function fetchMode($arg);", "protected function _fetchAssoc()\n {\n $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n return oci_fetch_assoc($id);\n }", "public function fetch_assoc($resultado){\r\n\r\n\t\tmysqli_fetch_assoc($resultado);\r\n\t}", "abstract public function fetch($fetchType = \\PDO::FETCH_ASSOC);", "public function setFetchMode(int $mode, mixed ...$args)\n {\n switch ($mode) {\n case PDO::FETCH_ASSOC:\n case PDO::FETCH_BOTH:\n case PDO::FETCH_OBJ:\n $this->fetchMode = $mode;\n\n break;\n default:\n throw new CacheException('Requested fetch mode is not yet supported.');\n }\n\n return true;\n }", "protected function _fetch_assoc()\n\t{\n\t\t$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n\t\treturn oci_fetch_assoc($id);\n\t}", "public function fetchAssoc($result)\n {\n // phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved\n return mysql_fetch_assoc($result);\n }", "private function correctFetchMode($PearDBFetchMode=DB_FETCHMODE_DEFAULT) {\n\t\tswitch($PearDBFetchMode) {\n\t\t\tcase DB_FETCHMODE_OBJECT:\n\t\t\t\t$fetch = PDO::FETCH_OBJ;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ASSOC:\n\t\t\t\t$fetch = PDO::FETCH_ASSOC;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ORDERED:\n\t\t\tcase DB_FETCHMODE_DEFAULT:\n\t\t\t\t$fetch = PDO::FETCH_NUM;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf(_(\"Unknown SQL fetchmode of %s\"),$fetch));\n\t\t\tbreak;\n\t\t}\n\t\treturn $fetch;\n\t}", "public function getFetchMode()\n {\n return $this->fetchModeAndArgs;\n }", "public function fetchAssoc($result = false){\n $this->resCalc($result);\n return mysql_fetch_assoc($result);\n }", "public function setFetchMode($fetchMode, $modeArg = null, array $ctorArgs = [])\n {\n $this->fetchMode = $fetchMode;\n $this->fetchClassName = '\\stdClass';\n $this->fetchCtorArgs = [];\n $this->fetchColumnNumber = 0;\n $this->fetchIntoObject = null;\n\n switch ($fetchMode) {\n case PDO::FETCH_CLASS:\n case PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE:\n if ($modeArg !== null) {\n $this->fetchClassName = $modeArg;\n }\n $this->fetchCtorArgs = $ctorArgs;\n break;\n case PDO::FETCH_INTO:\n if (!is_object($modeArg)) {\n throw new PDOException('$modeArg must be instance of an object');\n }\n $this->fetchIntoObject = $modeArg;\n break;\n case PDO::FETCH_COLUMN:\n $this->fetchColumnNumber = (int)$modeArg;\n break;\n }\n\n return true;\n }", "public function getSingleFetchMode()\n {\n return $this->singleFetchMode;\n }", "public function fetchAssoc($result)\n\t{\n\t\treturn mysqli_fetch_assoc($result);\n\t}", "function FetchAssoc($rs='')\n {\n $ret = false;\n if ($rs==null || $rs==\"\") $rs = $this->result;\n if ($rs->_numOfRows>0) $ret = $rs->GetRows();\n return $ret;\n }", "public function setFetchMode(string $fetchMode): DatabaseProviderInterface\n {\n $this->container['config']['database.fetch'] = $fetchMode;\n\n return $this;\n }", "function GetAssoc($force_array = false, $first2cols = false, $fetchMode = -1)\n\t{\n\t\t$records = $this->_numOfRows;\n\t\t$results = array();\n\t\tfor ( $i=0; $i < $records; $i++ ) {\n\t\t\tforeach ( $this->fields as $k=>$v ) {\n\t\t\t\tif ( is_array( $v ) ) {\n\t\t\t\t\tif ( $v['count'] == 1 ) {\n\t\t\t\t\t\t$results[$i][$k] = $v[0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_shift( $v );\n\t\t\t\t\t\t$results[$i][$k] = $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "private function correctFetchMode($PearDBFetchMode=DB_FETCHMODE_DEFAULT) {\n\t\tswitch($PearDBFetchMode) {\n\t\t\tcase DB_FETCHMODE_OBJECT:\n\t\t\t\t$fetch = PDO::FETCH_OBJ;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ASSOC:\n\t\t\t\t$fetch = PDO::FETCH_ASSOC;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_DEFAULT:\n\t\t\t\t$fetch = $this->correctFetchMode($this->defaultFetch);\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ORDERED:\n\t\t\t\t$fetch = PDO::FETCH_NUM;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf(_(\"Unknown SQL fetchmode of %s\"),$fetchmode));\n\t\t\tbreak;\n\t\t}\n\t\treturn $fetch;\n\t}", "public function fetch_array_assoc(&$result){\r\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\r\n\t\tif(!$result->EOF){\r\n\t\t \t$rs = $result->fields;\r\n\t\t \t$result->MoveNext(); \r\n\t\t \treturn $rs;\r\n\t\t}\r\n\t}", "protected function _fetchAssoc($result)\r\n {\r\n return pg_fetch_assoc($result);\r\n }", "function fetch_assoc($result) {\n\t\tif ($result === false) {\n\t\t\treturn array(); // Return an empty array, causing any subsequent foreach to fail gracefully.\n\t\t}\n\t\treturn $result->fetch_array(MYSQLI_ASSOC);\n\t}", "public function sql_fetch_assoc($result) {\n return @mysql_fetch_assoc($result);\n }", "function _fetch_assoc()\n\t{\n\t\treturn mysql_fetch_assoc($this->result_id);\n\t}", "public function __construct($dbKey,$fetchMode=self::DB_FETCH_ASSOC){\n\t\t$this->_dbKey=$GLOBALS['DB'][$dbKey];\n\t\t$this->_fetchMode=$fetchMode;\n\t}", "public function GetAssoc()\n\t{\n\t\treturn db_get_fetch_assoc($this->fields, $this->tables, $this->groupby, $this->filters, $this->sortfields, $this->limit);\n\t}", "function pdo_fetch_assoc($stmt) {\r\n return pdo_stmt($stmt)->fetch(PDO::FETCH_ASSOC);\r\n }", "function _fetch_assoc()\n\t{\n\t\treturn mysqli_fetch_assoc($this->result_id);\n\t}", "public function fetch_assoc()\r\n {\r\n return $this->resultID->fetch_assoc();\r\n }", "function _fetch_assoc()\n\t{\n\t\treturn sqlsrv_fetch_array($this->result_id, SQLSRV_FETCH_ASSOC);\n\t}", "function fetch_assoc($sql,$type){\n\t\tif ($this->conn) {\n\t\t\t$query = mysqli_query($this->conn,$sql);\n\t\t\tif($type==0){\n\t\t\t\twhile($row = mysqli_fetch_assoc($query)){\n\t\t\t\t\t$data[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\telse if ($type==1) {\n\t\t\t\t$data = mysqli_fetch_assoc($query);\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t}", "public function SetFetchMode($value)\n {\n $this->init();\n try {\n return $this->db->SetFetchMode($value);\n } catch (Exception $e) {\n trigger_error('ERROR SQL STATS: Error Caught: ' . print_r($e, 1));\n return false;\n }\n }", "function _fetch_assoc()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\t$i = $this->pdo_index;\r\n\t\t\t$this->pdo_index++;\r\n\t\t\tif ( isset($this->pdo_results[$i]))\r\n\t\t\t\treturn $this->pdo_results[$i];\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $this->result_id->fetch(PDO::FETCH_ASSOC);\r\n\t}", "public function delegateFetch(DbalStatement $dbal_statement, $mode, $fetch_class);", "public function as_assoc()\n {\n $this->_as_object = false;\n\n return $this;\n }", "abstract public function toAssoc(): array;", "function sql_fetch_assoc($res)\n {\n $results = array();\n if ($res)\n $results = $res->fetch(PDO::FETCH_ASSOC); \n return $results;\n }", "public function fetch($assoc=MYSQLI_ASSOC){\n\t\t$this->assoc=$assoc;\n\t\treturn @$this->qresult->fetch_array($this->assoc);\n\t}", "public function fetch($fetch_style = NULL, $cursor_orientation = false, $cursor_offset = false)\n {\n }", "public function setSingleFetchMode($value)\n {\n $this->singleFetchMode = (bool) $value;\n }", "private function setAttribute($sql, $fetchAction, $mode) {\n $this->mode = self::getMode($mode);\n $this->fetchAction = self::fetchAction($fetchAction);\n $this->pdo->setAttribute(\\PDO::ATTR_CASE, $this->mode);\n $this->query = $this->base_query($sql);\n $this->query->setFetchMode($this->fetchAction);\n return $this->query;\n }", "public function fetchRow( $type = FETCH_OBJ );", "function sql_fetch_assoc($result) {\n\t\treturn pg_fetch_assoc($result);\n\t}", "abstract public function fetchAll($fetchType = \\PDO::FETCH_ASSOC);", "public function fetchRows( $type = FETCH_OBJ );", "public function fetchArray(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_array\";\n return $this;\n }", "function __construct()\n\t{\n\t\t$this->connection = Application::getDatabaseConnection();\n\t\t$this->connection->SetFetchMode(2);\n\t}", "public function fetchAssoc($statement, array $params = array());", "abstract protected function _getRowAssoc($rs);", "public function setFetchStyle($fetchStyle);", "public function fetchAssoc($query = false)\r\n\t{\r\n\t\t$this->resCalc($query);\r\n\t\treturn mysqli_fetch_assoc($query);\r\n\t}", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "private function _set_fetch_mode_complete($current_fetch) {\n $this->setFetchMode($current_fetch[0], $current_fetch[1], $current_fetch[2]);\n }", "public function fetchAssoc($cursor = null)\n\t{\n\t\treturn false;\n\t}", "public function fetch($fetchStyle= null);", "public static function fetchAssoc(PDOStatement $stmt) {\n return self::convertTypes($stmt, $stmt->fetch(PDO::FETCH_ASSOC));\n }", "public function fetch($type = 'ASSOC')\n {\n return $this->query->fetch(self::_getFetchStyle(strtoupper($type)));\n }" ]
[ "0.7375443", "0.73749155", "0.7326046", "0.73070365", "0.7203805", "0.71755064", "0.71755064", "0.7157408", "0.7026203", "0.6987547", "0.69705033", "0.69305474", "0.68818355", "0.68524754", "0.68459135", "0.6844221", "0.67642236", "0.66008675", "0.6559908", "0.6525699", "0.65108633", "0.646734", "0.64096785", "0.64036125", "0.6276637", "0.6265399", "0.6234603", "0.61551756", "0.61528105", "0.6149398", "0.61264604", "0.6067409", "0.6053825", "0.6048398", "0.6007934", "0.59974885", "0.5983593", "0.597249", "0.59654295", "0.59247464", "0.5922319", "0.5902584", "0.5898682", "0.5887987", "0.5849667", "0.58194983", "0.5807766", "0.58060384", "0.5788838", "0.57663155", "0.5757894", "0.575731", "0.57515764", "0.57078946", "0.56919134", "0.565796", "0.5652267", "0.5622225", "0.56220406", "0.5620416", "0.56132555", "0.55999553", "0.55806774", "0.5577319", "0.5569225", "0.55680406", "0.555026", "0.55049753", "0.5468741", "0.5456656", "0.5451263", "0.5446694", "0.5439066", "0.54374146", "0.5425284", "0.5419116", "0.5416953", "0.54009116", "0.53856164", "0.5362895", "0.53554034", "0.53407776", "0.5333844", "0.53058696", "0.5297633", "0.5296212", "0.52960503", "0.52960503", "0.52960503", "0.52960503", "0.52960503", "0.52960503", "0.52960503", "0.52960503", "0.52960503", "0.52885664", "0.5275528", "0.5270289", "0.5265768", "0.52569014" ]
0.7389813
0
Set fetch mode as object
public function as_object() { $this->fetch_mode = 'object'; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setFetchMode($mode) {\n\t\t$this->_defaultFetchMode = $mode;\n\t}", "public function setFetchMode($fetchMode);", "public function setFetchMode($mode, $classNameObject = null, $ctor_args = null): void\n {\n $driverMode = ResultSet::FETCH_OBJECT;\n\n // \\PDO::FETCH_ASSOC\n if ($mode === 2) {\n $driverMode = ResultSet::FETCH_ASSOC;\n }\n\n $this->fetchMode = $driverMode;\n }", "public function setFetchMode($fetch_mode) {\n\t\t$this->fetchMode = $fetch_mode;\n\t}", "public function setFetchMode ($mode)\n {\n // check for PDO extension\n //if (! extension_loaded('pdo')) {\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n // throw new EhrlichAndreas_Db_Exception('The PDO extension is required for this adapter but the extension is not loaded');\n //}\n switch ($mode)\n {\n case EhrlichAndreas_Db_Abstract::FETCH_LAZY:\n \n case EhrlichAndreas_Db_Abstract::FETCH_ASSOC:\n \n case EhrlichAndreas_Db_Abstract::FETCH_NUM:\n \n case EhrlichAndreas_Db_Abstract::FETCH_BOTH:\n \n case EhrlichAndreas_Db_Abstract::FETCH_NAMED:\n \n case EhrlichAndreas_Db_Abstract::FETCH_OBJ:\n \n $this->_fetchMode = $mode;\n\n break;\n\n default:\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n throw new EhrlichAndreas_Db_Exception(\"Invalid fetch mode '$mode' specified\");\n\n break;\n }\n }", "private static function setFetchType( $mode )\n {\n switch ( $mode ):\n case 'assoc':\n return self::$stmt->setFetchMode( \\PDO::FETCH_ASSOC );\n case 'bound':\n return self::$stmt->setFetchMode( \\PDO::FETCH_BOUND );\n case 'both':\n return self::$stmt->setFetchMode( \\PDO::FETCH_BOTH );\n case 'class':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS, self::$FETCH_CLASS );\n case 'class_prop':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, self::$FETCH_CLASS, self::$_FETCH_CLASS_PARAMS );\n case 'class_type':\n return self::$stmt->setFetchMode( \\PDO::FETCH_CLASS | \\PDO::FETCH_CLASSTYPE );\n case 'column':\n return self::$stmt->setFetchMode( \\PDO::FETCH_COLUMN, self::$FETCH_OFFSET );\n case 'column_group':\n return self::$stmt->setFetchMode( \\PDO::FETCH_GROUP, self::$FETCH_OFFSET );\n case 'column_unique':\n return self::$stmt->setFetchMode( \\PDO::FETCH_UNIQUE, self::$FETCH_OFFSET );\n case 'func':\n return self::$stmt->setFetchMode( \\PDO::FETCH_FUNC, self::$FETCH_FUNC );\n case 'into':\n return self::$stmt->setFetchMode( \\PDO::FETCH_INTO, self::$FETCH_CLASS );\n case 'key_pair':\n return self::$stmt->setFetchMode( \\PDO::FETCH_KEY_PAIR );\n case 'lazy':\n return self::$stmt->setFetchMode( \\PDO::FETCH_LAZY );\n case 'named':\n return self::$stmt->setFetchMode( \\PDO::FETCH_NAMED );\n case 'num':\n return self::$stmt->setFetchMode( \\PDO::FETCH_NUM );\n case 'obj':\n return self::$stmt->setFetchMode( \\PDO::FETCH_OBJ );\n case 'serialize':\n return self::$stmt->setFetchMode( \\PDO::FETCH_SERIALIZE );\n default:\n return self::$stmt->setFetchMode( \\PDO::FETCH_ASSOC );\n endswitch;\n }", "public function set_fetchMode($type)\r\n {\r\n }", "public function setFetchMode($mode, $PDO::FETCH_COLUMN, $colno, $PDO::FETCH_CLASS, $classname, $ctorargs, $PDO::FETCH_INTO, $object)\n {\n }", "function setFetchMode($mode, $params=null) \n {\n $ret = call_user_func_array(array('parent', 'setFetchMode'), func_get_args());\n return $ret ? $this : $ret;\n }", "public function setFetchMode(int $mode, mixed ...$args);", "public function setFetchMode($fetchMode) {\n $this->_fetchMode = $fetchMode;\n }", "public function setFetchMode($mode, $fetch_arga = NULL, $fetch_argb = NULL)\r\n\t{\r\n\t\tswitch($mode)\r\n\t\t{\r\n\t\t\tcase LikePDO::FETCH_ASSOC :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_ASSOC;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOTH :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOTH;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_BOUND :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_BOUND;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_CLASS :\r\n\t\t\t\tif(!class_exists($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($fetch_argb)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!is_array($fetch_argb))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Warning: LikePDOStatement::setFetchMode() expects parameter 3 to be array on parameter 1 is FETCH_CLASS, \".gettype($fetch_argb).\" given\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->fetchModeArguments = $fetch_argb;\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$this->fetchModeArguments = array();\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_CLASS;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\tbreak;\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_INTO :\r\n\t\t\t\tif(!is_object($fetch_arga))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new LikePDOException(\"No fetch class specified\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_INTO;\r\n\t\t\t\t$this->fetchModeDefinition = $fetch_arga;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_LAZY :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_LAZY;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NAMED :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NAMED;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_NUM :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_NUM;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tcase LikePDO::FETCH_OBJ :\r\n\t\t\t\t$this->fetchMode = LikePDO::FETCH_OBJ;\r\n\t\t\t\t$this->fetchModeDefinition = NULL;\r\n\t\t\t\t$this->fetchModeArguments = array();\r\n\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\tthrow new LikePDOException(\"Invalid fetch mode\");\r\n\t\t\t\treturn false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function SetPdoFetchMode($mode = PDO::FETCH_ASSOC)\n {\n $this->pdoFetch = $mode;\n }", "public function setFetchMode($fetchMode)\n {\n $this->fetchMode = $fetchMode;\n }", "public function fetchObject();", "public function fetchObject();", "public function setFetchmode(Fetchmode $fetchmode) {\n $this->fetchmode[$fetchmode->getPath()]= $fetchmode->getMode();\n return $this;\n }", "public function getFetchMode()\n {\n return $this->fetchMode;\n }", "public function getFetchMode()\n\t{\n\t\treturn $this->fetchMode;\n\t}", "public function fetch($fetchMode = \\PDO::FETCH_BOTH);", "public function CMSFetchMode($mode)\n {\n $this->cmsFetchMode = $mode;\n }", "public abstract function fetchObject();", "public function fetchMode($arg);", "public function fetchObject(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_object\";\n return $this;\n }", "public function setFetchMode($fetchMode, $fetchArgument = null, array $fetchConstructorArgument = [])\n\t{\n $this->neoeloquent->setFetchMode($fetchMode);\n\t}", "public function mode(...$mode)\n\t{\n\t\tif (!$this->setFetchMode(...$mode))\n\t\t{\n\t\t\tthrow new UnableToSetFetchMode($mode);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setFetchMode($fetchMode, $modeArg = null, array $ctorArgs = [])\n {\n $this->fetchMode = $fetchMode;\n $this->fetchClassName = '\\stdClass';\n $this->fetchCtorArgs = [];\n $this->fetchColumnNumber = 0;\n $this->fetchIntoObject = null;\n\n switch ($fetchMode) {\n case PDO::FETCH_CLASS:\n case PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE:\n if ($modeArg !== null) {\n $this->fetchClassName = $modeArg;\n }\n $this->fetchCtorArgs = $ctorArgs;\n break;\n case PDO::FETCH_INTO:\n if (!is_object($modeArg)) {\n throw new PDOException('$modeArg must be instance of an object');\n }\n $this->fetchIntoObject = $modeArg;\n break;\n case PDO::FETCH_COLUMN:\n $this->fetchColumnNumber = (int)$modeArg;\n break;\n }\n\n return true;\n }", "public function getFetchMode()\n {\n return $this->fetchModeAndArgs;\n }", "public abstract function FetchObject();", "public function getSingleFetchMode()\n {\n return $this->singleFetchMode;\n }", "function FetchObj() {}", "public function setSingleFetchMode($value)\n {\n $this->singleFetchMode = (bool) $value;\n }", "public function setFetchMode(string $fetchMode): DatabaseProviderInterface\n {\n $this->container['config']['database.fetch'] = $fetchMode;\n\n return $this;\n }", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "private function correctFetchMode($PearDBFetchMode=DB_FETCHMODE_DEFAULT) {\n\t\tswitch($PearDBFetchMode) {\n\t\t\tcase DB_FETCHMODE_OBJECT:\n\t\t\t\t$fetch = PDO::FETCH_OBJ;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ASSOC:\n\t\t\t\t$fetch = PDO::FETCH_ASSOC;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ORDERED:\n\t\t\tcase DB_FETCHMODE_DEFAULT:\n\t\t\t\t$fetch = PDO::FETCH_NUM;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf(_(\"Unknown SQL fetchmode of %s\"),$fetch));\n\t\t\tbreak;\n\t\t}\n\t\treturn $fetch;\n\t}", "public function setFetchMode(int $mode, mixed ...$args)\n {\n switch ($mode) {\n case PDO::FETCH_ASSOC:\n case PDO::FETCH_BOTH:\n case PDO::FETCH_OBJ:\n $this->fetchMode = $mode;\n\n break;\n default:\n throw new CacheException('Requested fetch mode is not yet supported.');\n }\n\n return true;\n }", "public function fetch($fetchStyle= null);", "abstract public function fetch($fetchType = \\PDO::FETCH_ASSOC);", "public function fetch_object()\n\t{\n\t\t$object = null;\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$object->$key = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$object = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $object;\n\t}", "private function correctFetchMode($PearDBFetchMode=DB_FETCHMODE_DEFAULT) {\n\t\tswitch($PearDBFetchMode) {\n\t\t\tcase DB_FETCHMODE_OBJECT:\n\t\t\t\t$fetch = PDO::FETCH_OBJ;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ASSOC:\n\t\t\t\t$fetch = PDO::FETCH_ASSOC;\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_DEFAULT:\n\t\t\t\t$fetch = $this->correctFetchMode($this->defaultFetch);\n\t\t\tbreak;\n\t\t\tcase DB_FETCHMODE_ORDERED:\n\t\t\t\t$fetch = PDO::FETCH_NUM;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf(_(\"Unknown SQL fetchmode of %s\"),$fetchmode));\n\t\t\tbreak;\n\t\t}\n\t\treturn $fetch;\n\t}", "public function setFetchStyle($fetchStyle);", "abstract public function fetch();", "abstract public function fetch();", "public function fetch() {}", "public function SetFetchMode($value)\n {\n $this->init();\n try {\n return $this->db->SetFetchMode($value);\n } catch (Exception $e) {\n trigger_error('ERROR SQL STATS: Error Caught: ' . print_r($e, 1));\n return false;\n }\n }", "public function fetchObject($result = false){\n $this->resCalc($result); \n return mysql_fetch_object($result);\n }", "public function fetch(int $mode = \\PDO::ATTR_DEFAULT_FETCH_MODE, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0);", "public function fetchObject($result)\n\t{\n\t\treturn mysqli_fetch_object($result);\n\t}", "public function testResultFetchObject()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t\n \t$this->assertEquals((object)array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $result->fetchObject());\n \t$this->assertEquals((object)array('id'=>2, 'key'=>'two', 'title'=>'next row', 'status'=>'ACTIVE'), $result->fetchObject());\n \t$this->assertNull($result->fetchObject());\n \t\n \t$result->resetPointer();\n \t$this->assertEquals((object)array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $result->fetchObject(), \"Fetch after reset pointer: \");\n }", "function _fetch_object()\n\t{\n\t\treturn mysqli_fetch_object($this->result_id);\n\t}", "public function delegateFetch(DbalStatement $dbal_statement, $mode, $fetch_class);", "public function fetch_object() {\n $row = $this->fetch_array();\n return $row ? (object) $row : false;\n }", "public function fetch($fetch_style = NULL, $cursor_orientation = false, $cursor_offset = false)\n {\n }", "public function fetchObject()\n {\n return sasql_fetch_object($this->result);\n }", "function _fetch_object()\n\t{\n\t\treturn sqlsrv_fetch_object($this->result_id);\n\t}", "public function fetchObj(){\n try{\n $this->obj = $this->resultado->fetch(PDO::FETCH_OBJ);\n } catch (PDOException $e){\n $this->errors[] = 'error: function fetchObj<br/>'.$e->getMessage();\n $this->obj = NULL;\n }\n return $this->obj;\n }", "public function fetch($result_set, $class_name = null)\n\t{\n\t\t$object = $result_set->fetch_object(Builder::className($class_name));\n\t\tif ($object instanceof Abstract_Class) {\n\t\t\t$this->prepareFetch($object->class);\n\t\t\t$object = $this->read($this->getObjectIdentifier($object), $object->class);\n\t\t}\n\t\t// execute actions stored into $prepared_fetch\n\t\tforeach ($this->prepared_fetch as $property_name => $actions) {\n\t\t\tforeach ($actions as $action) {\n\t\t\t\tif ($action === self::GZINFLATE) {\n\t\t\t\t\t/** @noinspection PhpUsageOfSilenceOperatorInspection if not deflated */\n\t\t\t\t\t$value = @gzinflate($object->$property_name);\n\t\t\t\t\tif ($value !== false) {\n\t\t\t\t\t\t$object->$property_name = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($action instanceof Data_Link) {\n\t\t\t\t\t$value = $action->readProperty($object, $property_name);\n\t\t\t\t\tif (isset($value)) {\n\t\t\t\t\t\t$object->$property_name = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $object;\n\t}", "public function fetch_object($query);", "public function fetchRow( $type = FETCH_OBJ );", "public function fetchAll($fetchMode = \\PDO::FETCH_BOTH);", "abstract protected function fetchObject(string $className = 'stdClass');", "function __construct()\n\t{\n\t\t$this->connection = Application::getDatabaseConnection();\n\t\t$this->connection->SetFetchMode(2);\n\t}", "function fetch() {\n\t\t$this->i++;\n\t\treturn $this->result->fetch_object($this->class_name);\n\t}", "public function fetchInto(){\n\t\t\t}", "protected function _fetch_object()\n\t{\n\t\t$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n\t\treturn oci_fetch_object($id);\n\t}", "function fetch_obj($class = null)\n {\n if($class === null) { try { return $this->result->fetch(PDO::FETCH_OBJ); } catch(PDOException $e) { throw new DBException($e->getMessage()); } }\n $d = $this->fetch_assoc();\n if(!$d) return false;\n $o = new $class;\n foreach($d as $k=>$v) $o->$k = $v;\n if( method_exists($o, '__construct') ) $o->__construct();\n return $o;\n }", "function _fetch_object()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\t$i = $this->pdo_index;\r\n\t\t\t$this->pdo_index++;\r\n\t\t\tif ( isset($this->pdo_results[$i])) {\r\n\t\t\t\t$back = '';\r\n\t\t\t\tforeach ( $this->pdo_results[$i] as $key => $val ) {\r\n\t\t\t\t\t$back->$key = $val;\r\n\t\t\t\t}\r\n\t\t\t\treturn $back;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $this->result_id->fetch(PDO::FETCH_OBJ);\r\n\t}", "public function fetchRows( $type = FETCH_OBJ );", "function __construct($queryID,$mode=false)\n\t{\n\t\tif ($mode === false) {\n\t\t\tglobal $ADODB_FETCH_MODE;\n\t\t\t$mode = $ADODB_FETCH_MODE;\n\t\t}\n\t\tswitch ($mode)\n\t\t{\n\t\tcase ADODB_FETCH_NUM:\n\t\t\t$this->fetchMode = LDAP_NUM;\n\t\t\tbreak;\n\t\tcase ADODB_FETCH_ASSOC:\n\t\t\t$this->fetchMode = LDAP_ASSOC;\n\t\t\tbreak;\n\t\tcase ADODB_FETCH_DEFAULT:\n\t\tcase ADODB_FETCH_BOTH:\n\t\tdefault:\n\t\t\t$this->fetchMode = LDAP_BOTH;\n\t\t\tbreak;\n\t\t}\n\n\t\tparent::__construct($queryID);\n\t}", "function FetchObject() {\n\t\t\treturn pg_fetch_object($this->result);\n\t\t}", "function pdo_fetch_object($stmt, $classname=\"stdClass\", $params=array()) {\r\n return pdo_stmt($stmt)->fetchObject($classname, $params);\r\n }", "public function fetch()\n {\n return mysql_fetch_object($this->res);\n }", "private function _set_fetch_mode_complete($current_fetch) {\n $this->setFetchMode($current_fetch[0], $current_fetch[1], $current_fetch[2]);\n }", "function sql_fetch_object($res)\n {\n $results = NULL;\n if ( $res && is_object( $res ) )\n $results = $res->fetchObject(); \n return $results;\n }", "public function fetch($res, $as_object = true, $index = null)\n\t{\n\t\t\n\t}", "function msql_fetch_object($result)\n{\n}", "protected function _fetchObject()\n {\n $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n return @oci_fetch_object($id);\n }", "public function testQueryFetchObject() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \\PDO::FETCH_OBJ]);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }", "public static function fetch_object($object)\n {\n return @mysql_fetch_object($object);\n }", "public function fetchObject($statement, array $params = array(), $class = 'stdClass', $args = array());", "public function fetchAssoc(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_assoc\";\n return $this;\n }", "public abstract function fetchAllObjects();", "public function __construct($dbKey,$fetchMode=self::DB_FETCH_ASSOC){\n\t\t$this->_dbKey=$GLOBALS['DB'][$dbKey];\n\t\t$this->_fetchMode=$fetchMode;\n\t}", "public function fetchAll($fetch_style = NULL, $fetch_argument = NULL, $ctor_args = array())\n {\n }", "public function as_assoc() {\r\n $this->fetch_mode = 'assoc';\r\n return $this;\r\n }", "private function getSelectQueryFetchType()\n {\n switch ($this->returnType) {\n case ExtendedPDO::RETURN_TYPE_OBJECT:\n return \\PDO::FETCH_OBJ;\n case ExtendedPDO::RETURN_TYPE_ASSOC:\n return \\PDO::FETCH_ASSOC;\n }\n return $this->returnType;\n }", "function maxdb_fetch_object($result)\n{\n}", "public abstract function fetch($result_set, $class_name = null);", "public function fetchResult();", "abstract public function fetchAll($fetchType = \\PDO::FETCH_ASSOC);", "public function fetch($type = SQLAnywhereClient::FETCH_OBJECT)\n {\n $data = null;\n if ($this->result) {\n switch ($type) {\n case 'array':\n $data = sasql_fetch_object($this->result);\n break;\n\n case 'assoc':\n $data = sasql_fetch_object($this->result);\n break;\n\n case 'row':\n $data = sasql_fetch_object($this->result);\n break;\n\n case 'field':\n $data = sasql_fetch_object($this->result);\n break;\n\n case 'object':\n $data = sasql_fetch_object($this->result);\n break;\n\n default:\n $data = sasql_fetch_object($this->result);\n break;\n }\n }\n return $data;\n }", "public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEXT, $cursorOffset = 0): mixed\n {\n if ($fetchMode === null) {\n $fetchMode = $this->fetchMode;\n }\n\n $toLowercase = ($this->connection->getAttribute(PDO::ATTR_CASE) === PDO::CASE_LOWER);\n $nullToString = ($this->connection->getAttribute(PDO::ATTR_ORACLE_NULLS) === PDO::NULL_TO_STRING);\n $nullEmptyString = ($this->connection->getAttribute(PDO::ATTR_ORACLE_NULLS) === PDO::NULL_EMPTY_STRING);\n\n switch ($fetchMode) {\n case PDO::FETCH_BOTH:\n case PDO::FETCH_ASSOC:\n $resultSet = @\\odbc_fetch_array($this->statement);\n\n if (\\odbc_error()) {\n $this->throwException();\n }\n\n if ($resultSet === false) {\n return false;\n }\n\n if ($toLowercase) {\n $resultSet = \\array_change_key_case($resultSet);\n }\n\n return $resultSet;\n\n case PDO::FETCH_OBJ:\n $resultSet = @\\odbc_fetch_array($this->statement);\n\n if (\\odbc_error()) {\n $this->throwException();\n }\n\n if ($resultSet === false) {\n return false;\n }\n\n if ($toLowercase) {\n $resultSet = \\array_change_key_case($resultSet);\n }\n\n $object = new stdClass();\n\n foreach ($resultSet as $field => $value) {\n if (\\is_null($value) && $nullToString) {\n $resultSet[$field] = '';\n }\n\n if (empty($resultSet[$field]) && $nullEmptyString) {\n $resultSet[$field] = null;\n }\n\n $object->{$field} = $value;\n }\n\n return $object;\n }\n\n return false;\n }" ]
[ "0.7906302", "0.7636589", "0.7575183", "0.75684166", "0.7475607", "0.7452579", "0.7240747", "0.721035", "0.7185556", "0.7177745", "0.71699196", "0.7161423", "0.71062243", "0.699693", "0.6991355", "0.6991355", "0.6889996", "0.6797998", "0.6792901", "0.67674714", "0.67601454", "0.6722747", "0.67175364", "0.66913", "0.6637604", "0.65785664", "0.6568577", "0.6497622", "0.64930844", "0.64666384", "0.63883686", "0.6371448", "0.6307427", "0.6283308", "0.6283308", "0.6283308", "0.6283308", "0.6283308", "0.6283308", "0.6283308", "0.6283308", "0.6283308", "0.6199059", "0.6196413", "0.6183917", "0.61540747", "0.61120117", "0.60631496", "0.60611653", "0.6042492", "0.6042492", "0.597721", "0.595852", "0.59451485", "0.591803", "0.5904698", "0.58920515", "0.588321", "0.58736825", "0.58605844", "0.58195084", "0.5773425", "0.57593066", "0.57558185", "0.5750069", "0.5732408", "0.5675771", "0.56710535", "0.5665407", "0.56101215", "0.56019413", "0.5600437", "0.5537961", "0.5517436", "0.5511124", "0.5488922", "0.54847205", "0.54748863", "0.5461039", "0.5452917", "0.5446006", "0.5444823", "0.54402214", "0.54105574", "0.54058397", "0.5401668", "0.5400529", "0.5399198", "0.53852355", "0.5356821", "0.5346174", "0.5322705", "0.53214663", "0.53193337", "0.53183955", "0.53115165", "0.5294627", "0.52846354", "0.5271953", "0.5267924" ]
0.7120214
12
CALCULATIONS Return the "count" result of the query
public function count($columns = '*') { return (int) $this->select('count('.$columns.') count')->value('count'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function totalCount();", "public function totalCount();", "public function getTotalNumberOfResults();", "public function countQuery();", "function getCount() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = \"SELECT count(*) FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' ';\n\n\t\t$count =self::$global['dbCon']->fetchRow($query,MYSQLI_NUM);\n\t\treturn $count[0];\n\n\t}", "public function countquery(){ \n\t\treturn $this->query_total; \n\t}", "public function getResultCount()\n {\n return $this->count(self::_RESULT);\n }", "public function getResultCount()\n {\n return $this->count(self::_RESULT);\n }", "public function getQueryCount();", "protected function _performCount()\n {\n $query = $this->cleanCopy();\n $counter = $this->_counter;\n if ($counter) {\n $query->counter(null);\n\n return (int)$counter($query);\n }\n\n $complex = (\n $query->clause('distinct') ||\n count($query->clause('group')) ||\n count($query->clause('union')) ||\n $query->clause('having')\n );\n\n if (!$complex) {\n // Expression fields could have bound parameters.\n foreach ($query->clause('select') as $field) {\n if ($field instanceof ExpressionInterface) {\n $complex = true;\n break;\n }\n }\n }\n\n if (!$complex && $this->_valueBinder !== null) {\n $order = $this->clause('order');\n $complex = $order === null ? false : $order->hasNestedExpression();\n }\n\n $count = ['count' => $query->func()->count('*')];\n\n if (!$complex) {\n $query->getEagerLoader()->enableAutoFields(false);\n $statement = $query\n ->select($count, true)\n ->enableAutoFields(false)\n ->execute();\n } else {\n $statement = $this->getConnection()->newQuery()\n ->select($count)\n ->from(['count_source' => $query])\n ->execute();\n }\n\n $result = $statement->fetch('assoc')['count'];\n $statement->closeCursor();\n\n return (int)$result;\n }", "public function getTotalResults();", "public function count()\n\t{\n\t\t// Get a \"count all\" query\n $db = $this->getDbo();\n\n $query = $this->buildQuery(true);\n\n $query->clear('select')->clear('order')->select('COUNT(*)');\n\n\t\t// Run the \"before build query\" hook and behaviours\n $this->triggerEvent('onBuildCountQuery', array(&$query));\n\n $total = $db->setQuery($query)->loadResult();\n\n\t\treturn $this->count = $total;\n\t}", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count() {\n $this->_active_query->fields($this->func()->count());\n $query = $this->query( $this->_active_query->getQuery(), $this->_active_query->getParams() );\n return (int)$query->rowCount();\n }", "public function _count();", "public function getResultCount()\n {\n return ! empty($this->result) ? $this->result->getResultCount() : 0;\n }", "private function getCountAllResults()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('count(' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');\n $qb->from($this->metadata->getName(), $this->tableName);\n\n $this->setWhereCallbacks($qb);\n\n return (int) $qb->getQuery()->getSingleScalarResult();\n }", "public function count()\n {\n return count($this->getResults());\n }", "public function getCount()\n {\n if ($this->_queryResult === null) {\n return 0;\n }\n\n return $this->_queryResult->count();\n }", "public function count() \n { \n $query = $this->processInput();\n \n $model = $this->model;\n \n $result['total'] = $model::countAll($query['where']);\n\n $jsend = JSend\\JSendResponse::success($result);\n return $jsend->respond();\n }", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "public function count()\r\n {\r\n\t\tif ( null === $this->totalResults )\r\n\t\t{\r\n\t\t\t$this->warmUp();\r\n\t\t}\r\n\r\n\t\treturn $this->totalResults;\r\n\t}", "public function count(): int\n {\n if ($this->numberOfResults === null) {\n $this->initialize();\n if ($this->queryResult !== null) {\n $this->numberOfResults = count($this->queryResult ?? []);\n } else {\n parent::count();\n }\n }\n\n return $this->numberOfResults;\n }", "public function total_results()\n\t{\n\t\t$results = $this->get_results();\n\t\t$total = 0;\n\n\t\tforeach\t( $results as $set ) {\n\t\t\t$total = $total + count( $set );\n\t\t}\n\n\t\treturn $total;\n\t}", "private function getCountFilteredResults()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('count(distinct ' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');\n $qb->from($this->metadata->getName(), $this->tableName);\n\n $this->setLeftJoin($qb);\n $this->setWhere($qb);\n $this->setWhereCallbacks($qb);\n\n return (int) $qb->getQuery()->getSingleScalarResult();\n }", "public function getTotalResults()\n {\n $query = $this->deliverQueryObject();\n\n return $query->resetQueryParts(['groupBy', 'orderBy'])->select('count(distinct uph.upID)')->setMaxResults(1)->execute()->fetchColumn();\n }", "public function getCount()\n {\n return $this->doQuery(null, false, false)->count();\n }", "public function getCount() : int\n\t{\n\t\treturn (int)$this->getResult();\n\t}", "public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows \n\t\t\tFROM\n\t\t\t\tStudent st, Faculty f, Studies ss\n\t\t\tWHERE st.stds = ss.id_stds\n\t\t\tAND ss.fac = f.id_fac\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM compra_coletiva '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function getCount() {\n \treturn $this->count();\n }", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM aluno '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "function count_all() {\n\t\t// from table\n\t\t$this->db->from( $this->table_name );\n\n\t\t// where clause\n\t\t$this->custom_conds();\n\n\t\t// return the count all results\n\t\treturn $this->db->count_all_results();\n\t}", "private function getCount()\n {\n $bd = Core::getBdd()->getDb();\n $u_insc_c = \"SELECT DISTINCT COUNT(u.id) as c FROM c_user u\";\n $insc = 0 + $bd->query($u_insc_c)->fetchObject()->c;\n return ($insc);\n }", "public function count() {\n $total = 0;\n $this->setColumns(array('COUNT(*) '.$this->modx->escape('ct')));\n if ($this->execute()) {\n $count = $this->getResults();\n if (!empty($count) && !empty($count[0]['ct'])) {\n $total = intval($count[0]['ct']);\n }\n $this->close();\n }\n return $total;\n }", "public function getCount()\n {\n $query = $this->createSearchQuery()\n ->select(\"COUNT(p.id)\")\n ->getQuery();\n \n $queryPath = $this->getCreatedSearchQueryCachePath();\n $query->useResultCache(true, self::CACHE_DAY, $this->getCachePrefix(__FUNCTION__) . $queryPath);\n \n $result = $query->getScalarResult();\n\n return $result[0][1];\n }", "public function count()\n {\n $result = new QueryResult($this);\n return $result->count();\n }", "public function count()\n {\n return $this->queryResult->getSize();\n }", "public function count()\r\n\t{\r\n//\t\techo json_encode($this->db->query_first($sql));\r\n\t\techo json_encode(array('total'=>30));\r\n\t}", "public function toCount()\n {\n return $this->buildCountQuery($this->toQuery())->count();\n }", "public function getNbResults()\n {\n $this->sphinxQL->execute();\n\n $helper = Helper::create($this->sphinxQL->getConnection());\n $meta = $helper->showMeta()->execute()->fetchAllAssoc();\n\n foreach ($meta as $item) {\n if ('total_found' === $item['Variable_name']) {\n return (int) $item['Value'];\n }\n }\n\n return 0;\n }", "public function getCount();", "public function getCount();", "public function getCount();", "protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM ano_letivo '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function count() {\n $repo = $this->getRepository();\n\n return $repo->aggregate($this->limit(0), __FUNCTION__, $repo->getPrimaryKey());\n }", "public function count() {\n $queryId = $this->getQueryId('##count##');\n\n if ($this->willCacheResult) {\n $resultId = $this->getResultId($queryId);\n\n $cachedResult = $this->cache->getResult($resultId);\n if ($cachedResult) {\n return $cachedResult->getResult();\n }\n }\n\n $connection = $this->model->getMeta()->getConnection();\n\n $cachedQuery = $this->cache->getQuery($queryId);\n if (!$cachedQuery) {\n $statement = self::$queryParser->parseQueryForCount($this);\n\n $statementParser = $connection->getStatementParser();\n\n $sql = $statementParser->parseStatement($statement);\n $usedModels = $this->getUsedModels($statement);\n\n $cachedQuery = new QueryCacheObject($sql, $usedModels);\n\n $this->cache->setQuery($queryId, $cachedQuery);\n } else {\n $sql = $cachedQuery->getSql();\n $usedModels = $cachedQuery->getUsedModels();\n }\n\n $sql = $this->parseVariablesIntoSql($sql, $connection);\n\n $result = $connection->execute($sql);\n\n if ($result->getRowCount()) {\n $row = $result->getFirst();\n $result = $row[QueryParser::ALIAS_COUNT];\n } else {\n $result = 0;\n }\n\n if ($this->willCacheResult) {\n $cachedResult = new ResultCacheObject($result);\n\n $this->cache->setResult($resultId, $cachedResult, $usedModels);\n }\n\n return $result;\n }", "public static function countAll(){\n\t\t\t$qb = new QueryBuilder(get_called_class());\n\t\t\t$res = $qb->select(\"COUNT(*) as total\")->get();\n\t\t\treturn $res?$res[\"total\"]:0;\n\t\t}", "abstract public function countTotal();", "public function findCount()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT t.number, COUNT(f.id) as cnt\n FROM GazMainBundle:Finance f\n LEFT JOIN f.terminal t\n LEFT JOIN f.clientSale cs\n\t\t\t\t\t\t\tLEFT JOIN f.clientBuy cb\n\t\t\t\t\t\t\tWHERE f.financeType = FALSE\n\t\t\t\t\t\t\tGROUP BY t.number\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }", "public function getCount()\n {\n $dqlStr = $this->getQuery()->getDQL();\n $stmt = Connection::conn()->prepare(\"SELECT count(*) AS total FROM ({$this->getQuery()->getSQL()}) data\");\n $params = $this->getQuery()->getParameters();\n\n $orderParam = array();\n foreach ($params as $param) {\n /* @var $param \\Doctrine\\ORM\\Query\\Parameter */\n $orderParam[ strpos($dqlStr, \":{$param->getName()}\") ] = $param;\n }\n ksort($orderParam);\n\n $orderParamSorted = array_values($orderParam);\n foreach ($orderParamSorted as $index => $param) {\n $stmt->bindValue(1 + $index, $param->getValue(), $param->getType());\n }\n $stmt->execute();\n\n $row = $stmt->fetch();\n return (int) $row['total'];\n }", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "public function count()\n {\n $this->field('count(*) AS count', false);\n $list = $this->__select();\n $result = 0;\n if (count($list) == 1) {\n $result = intval($list[0]['count']);\n }\n elseif (count($list) > 1) {\n $result = array();\n foreach ($list as $row) {\n $result[] = $row['count'];\n }\n }\n return $result;\n }", "public function getTotal() {\n\t\treturn $this->find('count', array(\n\t\t\t'contain' => false,\n\t\t\t'recursive' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__,\n\t\t\t'cacheExpires' => '+24 hours'\n\t\t));\n\t}", "public function count() {\n if ($this->_count <= 0) {\n $where = new Where();\n if (isset($this->_options[\"eventData\"]) && $this->_options[\"eventData\"] != '') {\n $where->expression($this->_sql_search_expression, \"%\" . $this->_options[\"eventData\"] . \"%\");\n }\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from($this->table)->where($where)->columns(array('count' => new Expression('COUNT(*)')));\n $sqlTxt = $sql->getSqlStringForSqlObject($select);\n $resultSet = $this->adapter->query($sqlTxt, Adapter::QUERY_MODE_EXECUTE);\n foreach ($resultSet as $row) {\n $this->_count = intval($row->count);\n break;\n }\n }\n return $this->_count;\n }", "public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM negociacao_contas '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM conta_a_pagar '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}", "public function record_count() {\r\n return $this->db->count_all(\"pessoafisica\");\r\n }", "public function count()\n\t{\n\t\treturn $this->result->count();\n\t}", "public function getCount() {}", "public function getCount() {}", "public function getCount() {}", "public function getNumTotalQueryResults() : int{\n return $this->numTotalQueryResults;\n }", "final public static function count( ) {\n\t\treturn self::$intQueryCount;\n\t}", "public function computeCount() {\n if ($str = elis_consumer_http_request($this->url_pattern . '&rows=0', array('Accept' => 'application/json'))) {\n if ($json = json_decode($str)) {\n $this->totalCount = $json->response->numFound;\n }\n }\n return $this->totalCount;\n }", "function selectCountac_consumos($criterio){\n\t\t\t$this->connection = Connection::getinstance()->getConn();\n\t\t\t$PreparedStatement = \"SELECT COUNT(*) AS count FROM asapasc.ac_consumos WHERE consumo_id = consumo_id \";\n\t\t\t$PreparedStatement = $this->defineCriterias($criterio,$PreparedStatement);\n\t\t\t$ResultSet = mysql_query($PreparedStatement,$this->connection);\n\t\t\tlogs::set_log(__FILE__,__CLASS__,__METHOD__, $PreparedStatement);\n\n\t\t\t$rows = 0;\n\t\t\twhile ($row = mysql_fetch_array($ResultSet)) {\n\t\t\t\t$rows = ceil($row['count'] / TABLE_ROW_VIEW);\n\t\t\t}\n\t\t\tmysql_free_result($ResultSet);\n\t\t\treturn $rows;\n\t\t}", "public static function count();", "public function qTotal(){\n return Manager::getManager($this)->select()->count();\n }", "public function count()\n\t{\n\t\t$query = clone $this->df;\n\n\t\t$query->removeClause('select')\n\t\t\t->removeClause('limit')\n\t\t\t->removeClause('offset')\n\t\t\t->removeClause('order by')\n\t\t\t->select('count(*)');\n\n\t\treturn $this->count = (int)$query->fetchSingle();\n\t}", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \".$this->table_name. \"\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n return $row['total_rows'];\n }", "public function count()\n {\n return $this->model->paginate(1, $this->select)->total();\n }", "public function processedCount() {\n $query = $this->connection->select($this->mapTable);\n $query->addExpression('COUNT(*)', 'count');\n $count = $query->execute()->fetchField();\n return $count;\n }", "public function count()\n {\n return $this->client->count($this->compile())['count'];\n }", "protected function fetchTotalCount()\n {\n //get total if fetching a list\n $this->main_model_obj = new $this->main_model();\n $total_builder = $this->main_model_obj->getModelsManager()->createBuilder()\n ->columns(['COUNT(1) AS total'])\n ->from($this->main_model);\n\n $this->formJoinsUsingFilters($total_builder);\n $this->formConditions($total_builder);\n\n $result_obj = $total_builder->getQuery()->getSingleResult();\n $this->total_count = (empty($result_obj['total'])) ? 0 : $result_obj['total'];\n }", "public function count($criterio=\"\"){\n\t\t$sql = 'SELECT COUNT(id) AS qtd FROM grupo_usuario_tabelas '.$criterio.'';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$rs=$this->execute($sqlQuery);\n return $rs[0][\"qtd\"];\n\t}" ]
[ "0.7843255", "0.7843255", "0.7843255", "0.7793861", "0.7793861", "0.76860577", "0.76576495", "0.7613788", "0.75755256", "0.7458681", "0.745866", "0.7429166", "0.7418025", "0.7315104", "0.72967297", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7276325", "0.7270358", "0.724742", "0.72381073", "0.72192824", "0.7162934", "0.713334", "0.71282965", "0.7116673", "0.7115884", "0.71157295", "0.7083596", "0.7079185", "0.7047687", "0.7047094", "0.7046652", "0.7043731", "0.70337856", "0.70286113", "0.7026103", "0.7026039", "0.7025683", "0.7022858", "0.70195085", "0.7018962", "0.7017639", "0.69986844", "0.69961745", "0.69936603", "0.69897383", "0.69897383", "0.69897383", "0.69882715", "0.6976299", "0.69735473", "0.69675857", "0.6967337", "0.69631547", "0.69626504", "0.6955107", "0.6955091", "0.6954287", "0.69534767", "0.69469", "0.6944848", "0.6942037", "0.6934054", "0.6931852", "0.69274986", "0.69139713", "0.69137704", "0.69137704", "0.69120234", "0.6897085", "0.6893103", "0.688451", "0.6870327", "0.686225", "0.6855955", "0.6853729", "0.68450457", "0.6840968", "0.6837872", "0.6833438", "0.6832841" ]
0.0
-1
Return the max value of a column
public function max($column) { return $this->select('max('.$column.') max')->value('max'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function maximalVal( string $column = '' )\n {\n return $this->show()->max( $column );\n }", "public function max() : ColumnVector\n {\n return ColumnVector::quick(array_map('max', $this->a));\n }", "function getMaxValue( $colValueName, $tblName) { // selected column name, table name\n\t\n\tglobal $dbf;\n $sql_get = \"SELECT MAX($colValueName) as $colValueName FROM $tblName\";\n\t\n\t$getValue = $dbf;\n\t$getValue->query($sql_get);\n\t$getValue->next_record();\n\n\t$rowValue = $getValue->rowdata();\n\t$theValue = $rowValue[$colValueName];\n\n\treturn $theValue;\n\n}", "public function max(string $column)\n {\n return $this->execute(\n $this->syntax->selectSyntax(get_object_vars($this->aggregate($column, __FUNCTION__)))\n )[0][__FUNCTION__];\n }", "public function max($column)\n {\n return $this->aggregate(__FUNCTION__, (array) $column);\n }", "public function max(string $column): float\n {\n return (float) $this->selection->max($column);\n }", "public function max($column)\n {\n return $this->aggregate(__FUNCTION__, [$column]);\n }", "public function max($max=null)\n {\n $max = LambdaUtils::toSelectCallable($max);\n $temp = $this->select($max)->toArray();\n return max($temp);\n }", "public function max(string $column): ?int\n {\n if ($this->shouldEmulateExecution()) {\n return null;\n }\n\n return (int) $this->executeScript('Max', !empty($column) ? $column : $this->attribute);\n }", "public function max($column)\n {\n $agg = new Aggregate(Aggregate::MAX, $column);\n return $this->query->aggregate($agg, $this->filter);\n }", "public function getMax()\n {\n return $this->_fields['Max']['FieldValue'];\n }", "function get_max($table, $field) {\r\n\t\t$m = @mysql_query(\"select max($field) from $table\");\r\n\t\t$m = @mysql_fetch_array($m, MYSQL_ASSOC);\r\n\t\treturn $m[\"max($field)\"];\t\r\n\t}", "public function max($type, $column, IFilterable $filter) {\n return Functions::retype($this->_dataHandler->aggregate('MAX', $column, $this->_table, $filter->resultFilter()), $type);\n }", "public function max($model, $column, $dateColumn = null)\n {\n return $this->aggregate('max', $model, $column, $dateColumn);\n }", "public function max($column)\n {\n $results = $this->model->max($column);\n\n $this->resetModel();\n\n return $results;\n }", "public static function max($attribute = null);", "function get_max_id($table_name,$col_name=\"id\") {\n\tglobal $db, $dbname;\n //$stmt = $db->prepare(\"SELECT MAX($col_name) AS max_id FROM `$dbname`.`$table_name`\");\n $stmt->execute();\n $invNum = $stmt->fetch(PDO::FETCH_ASSOC); //echo \"Max:\".$invNum['max_id'];\n return $invNum['max_id'];\n}", "public function max(): int|float|null|object|bool|string\n {\n return max($this->internalMap);\n }", "public function getMax();", "public function max($field)\n {\n $this->field(\"MAX(`{$field}``) AS max\", false);\n $list = $this->__select();\n $result = 0;\n if (count($list) == 1) {\n $result = intval($list[0]['max']);\n }\n elseif (count($list) > 1) {\n $result = array();\n foreach ($list as $row) {\n $result[] = $row['max'];\n }\n }\n return $result;\n }", "function max() { return $this->max; }", "public function max($field = 'id'){\n return $this->model->max($field);\n }", "public function max($col = '*', $as = NULL) \n {\n $col = $this->clean($col);\n \n // Empty out the old junk\n $this->clear();\n \n // Build our sql statement\n $as = ($as !== NULL) ? \" AS \".$as : \"\";\n $this->sql = \"SELECT MAX(\". $col .\")\". $as;\n return $this;\n }", "function getMax() { return $this->readMaxValue(); }", "public function max(): Option;", "public function getMaximum() {\r\n return $this->maximumvalue;\r\n }", "public function getMax()\n {\n return $this->_fMax;\n }", "protected function max_value() {\n $max = 0;\n foreach ($this->data_collections as $data_collection) {\n foreach ($data_collection->get_items() as $item) {\n if ($max < $item->get_value()) {\n $max = $item->get_value();\n }\n }\n }\n return $max;\n }", "public function max(string $unit, $model, $column, $dateColumn = null)\n {\n return $this->aggregate('max', $unit, $model, $column, $dateColumn);\n }", "protected function _getMax(): int\n {\n $field = $this->_config['right'];\n $rightField = $this->_config['rightField'];\n $edge = $this->_scope($this->_table->find())\n ->select([$field])\n ->orderByDesc($rightField)\n ->first();\n\n if ($edge === null || empty($edge[$field])) {\n return 0;\n }\n\n return $edge[$field];\n }", "public function getMaximum()\n {\n return $this->max;\n }", "public function getMax() {\n return $this->max;\n }", "public function getMax()\n {\n return $this->_maxValue;\n }", "public function getMaxId($table, $column_name) {\n return $this->db->select_max($column_name)->get($table)->row();\n }", "function GetMax($table,$field)\n\t{\n\t\t$this->db->select_max($field);\n\t\treturn $this->db->get($table);\n\t}", "public function getMaximum()\n {\n return $this->maximum;\n }", "public function getMax(): int;", "public function getMax() {\n\n $this->db->select_max('codigo');\n $query = $this->db->get($this->table);\n if($query -> num_rows() >= 1)\n {\n return $query->row_array();\n }\n else\n {\n\n return $this->db->get_compiled_select();\n } \n\n }", "function saisonMaximum(){\n \t// On va récupreer la journée Maximum de la dernière saison \n\tglobal $bdd;\n\t// On récupère la saison maximum\n\t$rMaxSaison = mysqli_query($bdd, 'SELECT max(saison) FROM positions');\n\t$donnees = mysqli_fetch_assoc($rMaxSaison);\n\t$maxSaison = $donnees['max(saison)'];\n\tmysqli_free_result($rMaxSaison);\n\n\treturn $maxSaison;\n}", "function max() {\n static $max = false;\n $max = $max ?: curry(function($a, $b){\n return $a > $b ? $a : $b;\n });\n return _apply($max, func_get_args());\n}", "public function getMaxValue()\n {\n return $this->get('MaxValue');\n }", "public function getLatest($column);", "function getmaxno()\n\t{\n\t\t$this->db->select_max('device_no', 'no');\n\t\treturn $this->db->get($this->table);\n\t}", "public function getMax(): float;", "public function getMaxId($_column = null, $_next = false)\n {\n $column = $_column ? $_column : $this->primary;\n if (!$column) {\n return false;\n }\n\n $select = $this->getSql()->select();\n $select->columns(array('col' => new Expression('MAX(' . $column . ')')));\n $row = $this->selectWith($select)->toArray();\n $val = gv('col', gv(0, $row));\n if ($_next && is_numeric($val)) {\n return (int) $val + 1;\n }\n else {\n return (int) $val;\n }\n }", "public function setMaxColumn($value)\n {\n return $this->set('MaxColumn', $value);\n }", "public function getMaxOfRecord ($field,$table);", "final public function getMaxValue($tableName=\"\",$coloumnName=\"\") {\r\n if($tableName==\"\"||$coloumnName==\"\") {\r\n die(NOT_ENOUGH_ARGUMENT_SUPPLIED);\r\n }\r\n else {\r\n return $this->returnMaxValue($tableName,$coloumnName);\r\n }\r\n }", "public function max($callback, $type = \\SORT_NUMERIC);", "public function getMaxValue();", "public function getMaxValue();", "public function argMax(): vector {\n $v = vector::factory($this->row, vector::INT);\n if ($this->dtype === self::DOUBLE) {\n for ($i = 0; $i < $this->row; ++$i) {\n $v->data[$i] = core\\blas::dmax($this->rowAsVector($i));\n }\n } elseif ($this->dtype === self::FLOAT) {\n for ($i = 0; $i < $this->row; ++$i) {\n $v->data[$i] = core\\blas::smax($this->rowAsVector($i));\n }\n }\n return $v;\n }", "public function max($request, $model, $unit, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, $unit, 'max', $column, $dateColumn);\n }", "public function max(Query $query, string $field): float;", "public static function get_max_value() {\n return self::MAX_VALUE;\n }", "public abstract function max(callable|Comparator $cmp = null): Optional;", "public function getMaxValueCharacteristic(){\n\t\t$maxValue = 1;\n\t\t\n\t\tforeach( $this->attributes as $key => $value ){\n\t\t\tif( $key!='knights_id' && $maxValue < $value ) $maxValue = $value; \n\t\t}\t\t\n\t\treturn $maxValue;\n\t}", "function getHighestPriorityRecord() {\n $count = sizeOf($this->records);\n for ($i = 0; $i < $count; $i++) {\n if ($this->records[$i]->getCol() != -1) {\n return $i;\n }\n }\n return -1;\n }", "public function get_max_product_price()\n\t{\n\t\t$this->db->select('MAX(product_selling_price) AS price')->from('product')->where(\"product_status = 1\");\n\t\t$query = $this->db->get();\n\t\t$result = $query->row();\n\t\t\n\t\treturn $result->price;\n\t}", "public function getMax($field, $table, $where = null, $fieldview = null){\n\t\t// check field to display\n\t\tif( is_array($field) ){\n\t\t\tforeach ($table as $key => $val) {\n\t\t\t\t$dttable[] = $this->prefixTable( $val );\n\t\t\t}\n\t\t\t$field = implode(',', $dttable);\n\t\t}\n\n if(!empty($fieldview)){\n $this->db->select_max($field, $fieldview);\n $fieldview = $fieldview;\n } else {\n $this->db->select_max($field);\n $fieldview = $field;\n }\n\n if(!empty($where)){\n $this->db->where($where);\n }\n\n if( is_array($table) ){\n $dttable = array();\n foreach ($table as $key => $value) {\n $dttable[] = $this->prefixTable( $value );\n }\n $theTable = implode(',', $dttable);\n } else {\n $theTable = $this->prefixTable($table);\n }\n \n $latest = $this->db->get( $theTable )->row_array()[$fieldview];\n return $latest;\n }", "function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }", "function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }", "abstract public function maxMax(): int;", "private function chartmax($data){\n\t\t\t$max = 0;\n\t\t\tforeach($data as $row){\n\t\t\t\t$max = max($max,$row['value']);\n\t\t\t}\n\t\t\treturn $max;\n\t\t}", "public function maxBy(callable $callback): Option;", "public function getMaxPriceInt()\n {\n $stats = $this->_getFieldStats();\n $max = $stats['max'];\n if (!is_numeric($max)) {\n $max = parent::getMaxPriceInt();\n }\n return $max;\n }", "function getMaxBatch(){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"SELECT MAX(batch_no) from breeding_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['MAX(batch_no)'];\n\n\t}\n\n\t$crud->disconnect();\n}", "function highest()\n\t{\n\t\tend($this->_data);\n\t\treturn key($this->_data);\n\t}", "public function max($value) {\n return $this->setProperty('max', $value);\n }", "public function max($value) {\n return $this->setProperty('max', $value);\n }", "public function getMax()\r\n {\r\n if (count($this->aNotes) === 0) {\r\n return 0;\r\n }\r\n $fMax = $this->aNotes[0];\r\n foreach ($this->aNotes as $fNote) {\r\n if ($fNote > $fMax) {\r\n $fMax = $fNote;\r\n }\r\n }\r\n return $fMax;\r\n }", "function get_max_id($table_name) {\n\tglobal $db, $dbname;\n $stmt = $db->prepare(\"SELECT MAX(id) AS max_id FROM `$dbname`.`$table_name`\");\n $stmt->execute();\n $invNum = $stmt->fetch(PDO::FETCH_ASSOC);\n return $invNum['max_id'];\n}", "private function getMaxRightKey(){\n\t\t\t$conn = Db::getInstance();\n\t\t\t$st = $conn->prepare(\"SELECT MAX(`right_key`) FROM `\" . static::db_table . \"`\");\n\t\t\t$st->execute();\n\t\t\treturn intval($st->fetchColumn());\n\t\t}", "function get_x_max()\n\t{\n\t\t$values = array();\n\n\t\tforeach($this->_config[self::VALUES] as $index=>$value)\n\t\t{\n\t\t\t$values[] = $value['right'];\n\t\t}\n\n\t\t$x = array_values($values);\n\t\tsort($x);\n\t\treturn array_pop($x);\n\t}", "function getCalibrationMaxSerial($DbConnection)\n{\n\t$query =\"select Max(sno)+1 as seiral_no from calibration\"; \n\t$result=mysql_query($query,$DbConnection);\n\t$row=mysql_fetch_row($result);\n\treturn $row[0];\n}", "public function max($field) {\n return $this->getRepository()->aggregate($this, __FUNCTION__, $field);\n }", "public function highest($arr)\n {\n $max = array_shift($arr);\n\n foreach ($arr as $key => $val) {\n if ($val > $max) {\n $max = $val;\n }\n }\n\n return $max;\n }", "public function maxNumber(): int\n {\n try {\n return (int) $this->createQueryBuilder('b')\n ->select('max(b.number) as maxi')\n ->getQuery()\n ->getSingleScalarResult()\n ;\n } catch (NonUniqueResultException $exception) {\n //this should not be reached.\n return 0;\n } catch (NoResultException $exception) {\n return 0;\n }\n }", "public static function max()\n {\n $args = func_get_args();\n $self = array_shift($args);\n\n //return the max of the elements\n return max($args);\n }", "function maxBy() {\n static $maxBy = false;\n $maxBy = $maxBy ?: curry(function($fn, $a, $b){\n return $fn($a) > $fn($b) ? $a : $b;\n });\n return _apply($maxBy, func_get_args());\n}", "function get_max_ordering() {\n $this->db->select_max('ordering');\n $query = $this->db->get($this->get_scope());\n $row = $query->row();\n return $row->ordering;\n }", "public function maxSortingNumber(){\n $result = $this->repo->maxSortingNumber();\n return $result;\n }", "public function idMax ()\n {\n $db = $this->dbConnect ();\n $req = $db->query ('SELECT id_chapter,number_chapter FROM chapter ORDER BY id_chapter DESC LIMIT 0,1');\n $resultat = $req->fetch ();\n return $resultat;\n }", "public function max()\n {\n $maximum = round($this->centre + $this->centre * $this->deviation);\n\n return $this->unsigned ? max($maximum, 0) : $maximum;\n }", "public function getmaxbid ($itemid){\n //returns the max bid for an itel\n $itemid = mysql_real_escape_string( $itemid);\n $sql = \"SELECT MAX(bidAmount)\n FROM bid \n WHERE itemid= '$itemid'\";\n $bidarray = mysql_fetch_array(mysql_query($sql));\n $bid = $bidarray[0];\n return $bid; \n }", "function getMaxValue() { return $this->readMaxValue(); }", "private function get_last_display_column()\r\n\t\t{\r\n\t\t\t$last_display_col = 0;\r\n\t\t\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display']) $last_display_col = $key_col;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $last_display_col;\r\n\t\t}", "public function getMaxId(){\n\t\t$result = mysql_query(\"Select MAX(cust_id) from customer\");\n\t\tif($row = mysql_fetch_array($result)){\n\t\t\treturn $row[0];\n\t\t}\n\t\treturn NULL;\n\t}", "function max_post_id(){\n $query = \"SELECT MAX(ID) AS max\n FROM \".PREFIX.\"entries\";\n $result = mysql_query($query) or die(\"max_id: Anfrage fehlgeschlagen: \" . mysql_error());\n $row = mysql_fetch_array($result);\n mysql_free_result($result);\n return intval($row['max']);\n}", "function getMaxValue() { return $this->readMaxValue(); }", "function get_maxcustindexrecnbr($debug = false) {\n\t\t$q = (new QueryBuilder())->table('custindex');\n\t\t$q->field($q->expr('MAX(recno)'));\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery();\n\t\t} else {\n\t\t\t$sql->execute();\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}", "public function getHighestOrderNumber()\n {\n return ((int) self::max($this->determineOrderColumnName())) + 1;\n }", "public function ultimoPedido(){\n //$conexao = $c->conexao();\n\n $query = \"SELECT max(idpedido)idpedido FROM tbpedidos c;\";\n $query = $this->conexao->query($query);\n $row = $query->fetch_assoc();\n\n return $row;\n\n }", "public function getMaxPrice() {\n return $this->get(self::MAXPRICE);\n }", "public function max($request, $model, $column, $groupBy)\n {\n return $this->aggregate($request, $model, 'max', $column, $groupBy);\n }", "public function getMaxMenuPosition()\n {\n $value=DB::table('links')\n ->max('menu_position');\n return $value;\n }", "function max_id($table, $id=\"id\")\n {\n $sth = $this->dbh->prepare($sql=\"SELECT MAX($id) FROM $table\");\n if ($sth == false) {\n $this->err(\"max_id: $sql\");\n return -1;\n }\n\n $sth->execute();\n $val = $sth->fetch(PDO::FETCH_NUM);\n\n return $val[0];\n }", "public function max($selector = '.')\n {\n if (\\Sledgehammer\\is_closure($selector)) {\n $closure = $selector;\n } else {\n $closure = PropertyPath::compile($selector);\n }\n $max = null;\n $first = true;\n foreach ($this as $item) {\n $value = $closure($item);\n if ($first) {\n $first = false;\n $max = $value;\n } elseif ($value > $max) {\n $max = $value;\n }\n }\n\n return $max;\n }", "function find_max_index($arr) \n {\n $max = $arr[0]; \n for ($i = 1, $len = count($arr); $i < $len; $i++) {\n\n $max = ($arr[$i] > $max) ? $arr[$i] : $max;\n } \n return $max;\n }", "protected function getMaxId($table,$primary_key){\n $con = $this->connect();\n $sql = \"SELECT MAX($primary_key) AS max_id FROM $table \";\n $query_sql = mysqli_query($con, $sql);\n $result = NULL;\n while ($data = mysqli_fetch_object($query_sql)) {\n $result = $data->max_id;\n }\n return $result;\n }" ]
[ "0.8157877", "0.76023036", "0.76007396", "0.748381", "0.74628323", "0.7446232", "0.7394084", "0.7329289", "0.72956514", "0.7241916", "0.6980449", "0.6963158", "0.69619757", "0.6939059", "0.69261956", "0.6905312", "0.6855219", "0.68463826", "0.6806998", "0.6803747", "0.6765313", "0.67330366", "0.67161924", "0.67087704", "0.670508", "0.66567767", "0.6650856", "0.66460705", "0.66442174", "0.66439074", "0.6612065", "0.6600887", "0.6589997", "0.65736073", "0.653276", "0.6529715", "0.6520175", "0.6457494", "0.64463645", "0.64398247", "0.64038545", "0.63771856", "0.637594", "0.63551664", "0.6354605", "0.6352322", "0.6338089", "0.630929", "0.63024193", "0.6299153", "0.6299153", "0.629336", "0.6287324", "0.628171", "0.6265656", "0.626215", "0.6253004", "0.6249092", "0.62464", "0.6240062", "0.622542", "0.622542", "0.6203503", "0.6200452", "0.61872494", "0.61809605", "0.6138684", "0.6108841", "0.60950917", "0.60950917", "0.60694295", "0.60675484", "0.6065646", "0.6061027", "0.6053186", "0.60509634", "0.6047995", "0.60467905", "0.6045654", "0.6036769", "0.6032104", "0.6028189", "0.6017153", "0.6014175", "0.60051244", "0.600237", "0.6000096", "0.5996596", "0.597379", "0.596333", "0.59581065", "0.5951348", "0.5949055", "0.5944755", "0.59384435", "0.5931422", "0.59257245", "0.5922957", "0.5919196", "0.5904598" ]
0.79775774
1
Return the min value of a column
public function min($column) { return $this->select('min('.$column.') min')->value('min'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function minimalVal( string $column = '' )\n {\n return $this->show()->min( $column );\n }", "public function min($min=null)\n {\n $min = LambdaUtils::toSelectCallable($min);\n $temp = $this->select($min)->toArray();\n return min($temp);\n }", "public function min(string $column)\n {\n return $this->execute(\n $this->syntax->selectSyntax(get_object_vars($this->aggregate($column, __FUNCTION__)))\n )[0][__FUNCTION__];\n }", "public function min(string $column): float\n {\n return (float) $this->selection->min($column);\n }", "public function min($column)\n {\n return $this->aggregate(__FUNCTION__, (array) $column);\n }", "public function min($column)\n {\n return $this->aggregate(__FUNCTION__, [$column]);\n }", "public function min($column)\n {\n $agg = new Aggregate(Aggregate::MIN, $column);\n return $this->query->aggregate($agg, $this->filter);\n }", "public function min() : ColumnVector\n {\n return ColumnVector::quick(array_map('min', $this->a));\n }", "public function min(string $column): ?int\n {\n if ($this->shouldEmulateExecution()) {\n return null;\n }\n\n return (int) $this->executeScript('Min', !empty($column) ? $column : $this->attribute);\n }", "public function min($model, $column, $dateColumn = null)\n {\n return $this->aggregate('min', $model, $column, $dateColumn);\n }", "public function getMin();", "public function min($field)\n {\n $this->field(\"min({$field}) AS min\", false);\n $list = $this->__select();\n $result = 0;\n if (count($list) == 1) {\n $result = intval($list[0]['min']);\n }\n elseif (count($list) > 1) {\n $result = array();\n foreach ($list as $row) {\n $result[] = $row['min'];\n }\n }\n return $result;\n }", "public function min($column)\n {\n $results = $this->model->min($column);\n\n $this->resetModel();\n\n return $results;\n }", "public function min($col = '*', $as = NULL) \n {\n $col = $this->clean($col);\n \n // Empty out the old junk\n $this->clear();\n \n // Build our sql statement\n $as = ($as !== NULL) ? \" AS \".$as : \"\";\n $this->sql = \"SELECT MIN(\". $col .\")\". $as;\n return $this;\n }", "public static function min($attribute = null);", "public function min(string $unit, $model, $column, $dateColumn = null)\n {\n return $this->aggregate('min', $unit, $model, $column, $dateColumn);\n }", "function getMin() { return $this->readMinValue(); }", "public function setMinColumn($value)\n {\n return $this->set('MinColumn', $value);\n }", "public function getMin()\n {\n return $this->_fMin;\n }", "public function getMin()\n {\n return $this->_minValue;\n }", "public function getMin() {\n return $this->min;\n }", "public function min($request, $model, $unit, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, $unit, 'min', $column, $dateColumn);\n }", "public function getMinimum() {\r\n return $this->minimumvalue;\r\n }", "function min() { return $this->min; }", "public function getXMin() {}", "public function getXMin() {}", "public function minimum($params=''){\n\t\t$this->_connect();\n\t\t$numberArguments = func_num_args();\n\t\t$params = Utils::getParams(func_get_args(), $numberArguments);\n\t\tif(isset($params['column'])) {\n\t\t\tif(!$params['column']){\n\t\t\t\t$params['column'] = $params[0];\n\t\t\t}\n\t\t} else {\n\t\t\t$params['column'] = $params[0];\n\t\t}\n\t\tif($this->_schema){\n\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$table = $this->_source;\n\t\t}\n\t\tif(isset($params['group'])&&$params['group']){\n\t\t\t$select = 'SELECT '.$params['group'].',MIN('.$params['column'].') AS minimum FROM '.$table.' ' ;\n\t\t} else {\n\t\t\t$select = 'SELECT MIN('.$params['column'].') AS minimum FROM '.$table.' ' ;\n\t\t}\n\t\tif(isset($params['conditions'])&&$params['conditions']){\n\t\t\t$select.= ' WHERE '.$params['conditions'].' ';\n\t\t}\n\t\tif(isset($params['group'])){\n\t\t\t$select.=' GROUP BY '.$params['group'].' ';\n\t\t}\n\t\tif(isset($params['having'])){\n\t\t\t$select.=' HAVING '.$params[\"having\"].' ';\n\t\t}\n\t\tif(isset($params['order'])&&$params['order']){\n\t\t\t$select.=' ORDER BY '.$params['order'].' ';\n\t\t} else {\n\t\t\t$select.=' ORDER BY 1 ';\n\t\t}\n\t\tif(isset($params['limit'])&&$params['limit']){\n\t\t\t$select = $this->_limit($select, $params['limit']);\n\t\t}\n\t\treturn $this->_getGroupResult($params, $select, 'minimum');\n\t}", "public function getMinXValue() {\r\n return $this->chart->getMinXValue($this);\r\n }", "public function getMinimum()\n {\n return $this->minimum;\n }", "public function min(): Option;", "public function getMin(): int;", "function get_x_min()\n\t{\n\t\t$values = array();\n\n\t\tforeach($this->_config[self::VALUES] as $index=>$value)\n\t\t{\n\t\t\t$values[] = $value['left'];\n\t\t}\n\n\t\t$x = array_values($values);\n\t\trsort($x);\n\t\treturn array_pop($x);\n\t}", "public function getMinValue()\n {\n return $this->get('MinValue');\n }", "public function argMin(): vector {\n $v = vector::factory($this->row, vector::INT);\n if ($this->dtype === self::DOUBLE) {\n for ($i = 0; $i < $this->row; ++$i) {\n $v->data[$i] = core\\blas::dmin($this->rowAsVector($i));\n }\n } elseif ($this->dtype === self::FLOAT) {\n for ($i = 0; $i < $this->row; ++$i) {\n $v->data[$i] = core\\blas::smin($this->rowAsVector($i));\n }\n }\n return $v;\n }", "public function getMinValue();", "public function getMinValue();", "public function get_score_min()\n\t{\n\t\treturn $this->score_min;\n\t}", "public function getMin(): float;", "public function min($field) {\n return $this->getRepository()->aggregate($this, __FUNCTION__, $field);\n }", "public static function get_min_value() {\n return self::MIN_VALUE;\n }", "public function min(Query $query, string $field): float;", "public function get_min_product_price()\n\t{\n\t\t$this->db->select('MIN(product_selling_price) AS price')->from('product')->where(\"product_status = 1\");\n\t\t$query = $this->db->get();\n\t\t$result = $query->row();\n\t\t\n\t\treturn $result->price;\n\t}", "public function minSize($key)\n {\n\n if (! isset(static::$cols[$key])) {\n Error::report('asked for wrong Validation data: '.$key.' in '.get_class($this));\n\n return null;\n }\n\n return static::$cols[$key][self::COL_MIN];\n\n }", "public function min($field, $alias = '')\n {\n return $this->prepareAggregateStatement($field, $alias, 'MIN');\n }", "public function min(string $column, string $alias)\n {\n $this->columns[] = array(\n 'type' => 'min',\n 'name' => $column,\n 'alias' => $alias\n );\n return $this;\n }", "function min() {\n static $min = false;\n $min = $min ?: curry(function($a, $b){\n return $a < $b ? $a : $b;\n });\n return _apply($min, func_get_args());\n}", "public function getMinchar() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(2, $this->_result)) return (string) $this->_result[2];\n\t\t\telse parent::throwGetColException('Not set CampaignDefinitionsModel::getMinchar', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignDefinitionsModel::getMinchar', __LINE__, __FILE__);\n\t}", "public function minByHours($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_HOURS, 'min', $column, $dateColumn);\n }", "public function min($request, $model, $column, $groupBy)\n {\n return $this->aggregate($request, $model, 'min', $column, $groupBy);\n }", "private function min()\n {\n return Carbon::create(1, 1, 1, 0, 0, 0);\n }", "public function min($value) {\n return $this->setProperty('min', $value);\n }", "public function min($value) {\n return $this->setProperty('min', $value);\n }", "public function select_min($select = '', $alias = '')\n\t{\n\t\treturn $this->_max_min_avg_sum($select, $alias, 'MIN');\n\t}", "public abstract function min(callable|Comparator $cmp = null): Optional;", "public function getMinNumber()\n {\n return $this->minNumber;\n }", "function getMinPrice(){\r\n $q = \"SELECT * FROM minimum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }", "public function min()\n {\n $minimum = round($this->centre - $this->centre * $this->deviation);\n\n return $this->unsigned ? max($minimum, 0) : $minimum;\n }", "public function getMin()\r\n {\r\n if (count($this->aNotes) === 0) {\r\n return 0;\r\n }\r\n $fMin = $this->aNotes[0];\r\n foreach ($this->aNotes as $fNote) {\r\n if ($fNote < $fMin) {\r\n $fMin = $fNote;\r\n }\r\n }\r\n return $fMin;\r\n }", "public function minByDays($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_DAYS, 'min', $column, $dateColumn);\n }", "function getMinValue() { return $this->readMinValue(); }", "function getMinValue() { return $this->readMinValue(); }", "protected function getMin() {\n\n\t\t$min = 1;\n\n\t\tif (!empty($this->tagsArray)) {\n\n\t\t\t$preAmount = 999999;\n\n\t\t\tforeach ($this->tagsArray as $key => $value) {\n\t\t\t\t$currentAmount = $value['amount'];\n\t\t\t\tif ($currentAmount < $preAmount) {\n\t\t\t\t\t$min = $currentAmount;\n\t\t\t\t\t$preAmount = $currentAmount;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $min;\n\t}", "public function getMinimum(): float\n {\n return $this->min;\n }", "abstract public function minMin(): int;", "function minimum ($tab)\r\n{\r\n $min = $tab[0]; // ASTUCE: INITIALISER LA VALEUR AU PREMIER ELEMENT\r\n foreach($tab as $current) \r\n {\r\n if ($current < $min) {\r\n $min = $current; // ON MET A JOUR LA VALEUR MINIMALE\r\n }\r\n }\r\n return $min; // IL FAUT ATTENDRE LA FIN DE LA BOUCLE\r\n}", "public function getMinPriceInt()\n {\n $stats = $this->_getFieldStats();\n $min = $stats['min'];\n if (!is_numeric($min)) {\n $min = 0;\n }\n return $min;\n }", "public function getMin($field, $table, $where = null, $fieldview = null){\n if(!empty($fieldview)){\n $this->db->select_min($field, $fieldview);\n $fieldview = $fieldview;\n } else {\n $this->db->select_min($field);\n $fieldview = $field;\n }\n\n if(!empty($where)){\n $this->db->where($where);\n }\n\n if( is_array($table) ){\n $dttable = array();\n foreach ($table as $key => $value) {\n $dttable[] = $this->prefixTable( $value );\n }\n $theTable = implode(',', $dttable);\n } else {\n $theTable = $this->prefixTable($table);\n }\n \n $latest = $this->db->get( $theTable )->row_array()[$fieldview];\n return $latest;\n }", "public function getFirstDate()\n {\n $query = \"SELECT MIN(stat_date) AS first FROM \" . $this->tableName;\n $data = $this->SelectData($query, PDO::FETCH_ASSOC);\n\n if (false === $data) {\n return false;\n } else {\n return $data[0]['first'];\n }\n }", "public function lowest($arr)\n {\n $min = array_shift($arr);\n\n foreach ($arr as $key => $val) {\n if ($val < $min) {\n $min = $val;\n }\n }\n\n return $min;\n }", "public function setMinRow($value)\n {\n return $this->set('MinRow', $value);\n }", "public function getMinLat() {\n return $this->minLat;\n }", "public static function min()\n {\n $args = func_get_args();\n $self = array_shift($args);\n\n //return the minimum of the arguments\n return min($args);\n }", "public function min($callback, $type = \\SORT_NUMERIC);", "public static function min_with_key($array, $key) {\n if (!is_array($array) || count($array) == 0) return false;\n $min = $array[0][$key];\n foreach($array as $a) {\n if($a[$key] < $min) {\n $min = $a[$key];\n }\n }\n return $min;\n }", "public function minByMinutes($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_MINUTES, 'min', $column, $dateColumn);\n }", "public function minByWeeks($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_WEEKS, 'min', $column, $dateColumn);\n }", "protected function GetAxisMinValue($axis)\n {\n if($this->single_axis || empty($this->dataset_axis) || \n empty($this->multi_graph))\n return $this->GetMinValue();\n\n $min = array();\n $datasets = count($this->values);\n for($i = 0; $i < $datasets; ++$i) {\n if($this->DatasetYAxis($i) == $axis)\n $min[] = $this->values->GetMinValue($i);\n }\n return empty($min) ? NULL : min($min);\n }", "public function GetMinVal()\n\t{\n\t\tif (function_exists('bcpow')) {\n\t\t\treturn round(bcpow(10, $this->scale[0], 15), 14);\n\t\t}\n\n\t\treturn round(pow(10, $this->scale[0]), 14);\n\t}", "public function minByMonths($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_MONTHS, 'min', $column, $dateColumn);\n }", "public function getStartAtMin(): ?string\n {\n return $this->startAtMin;\n }", "function addMin($field, $name) {\n\t\t$name = \"`\".$this->db->escape_string($name).\"`\";\n\t\t$this->fields[] = array(\"MIN(\".$name.\")\", $this->db->escape_string($field));\n\t\treturn $this;\n\t}", "public function minBy(callable $callback): Option;", "public function min($table, $field = \"*\", $params = [], $joins = [])\n {\n $query = $this->query($this->selectContext($table, $field, $joins, $params, \"SELECT\", 'MIN'));\n if ($query) {\n $max = $query->fetchColumn();\n return is_numeric($max) ? $max + 0 : $max;\n }\n else {\n return false;\n }\n }", "public function getMinimumQuantity()\n {\n $this->load('product');\n $minimum = $this->product->price()\n ->where('date_start', '<=', 'NOW()')\n ->whereRaw('(date_end > NOW() OR date_end IS NULL)')\n ->where('site_id', $this->invoice->getBaseSiteId())\n ->orderBy('min_quantity')\n ->first();\n return $minimum->min_quantity;\n }", "public function getMinimumOffset() {\r\n return $this->minimumOffset;\r\n }", "public function getStartColumn()\n {\n return $this->start_column;\n }", "public function evalMin()\n {\n $users = User::students()->get();\n $min = 100;\n foreach ( $users as $user )\n {\n if ($this->evalGradeExists($user))\n {\n if ($this->userPercentage($user) < $min)\n {\n $min = $this->userPercentage($user);\n }\n }\n\n }\n return $min;\n\n }", "public static function get_default_min()\n\t{\n\t\treturn self::get_value('1970-01');\n\t}", "public function getMinimum($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function min(): ?DateTime {\n\t\t$min = $this->attribute(\"min\");\n\n\t\tif(!is_string($min)) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\t$min = new DateTime($min);\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\tAppLog::error(\"invalid minimum time\", __FILE__, __LINE__, __FUNCTION__);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $min;\n\t}", "private function arrayMin(array $array = array())\n {\n ksort($array);\n return (int) $array[0];\n }", "public function oldest($column = 'created_at')\n {\n return $this->orderBy($column, 'asc');\n }", "public function selectMinKey(): ?int;", "function minBy() {\n static $minBy = false;\n $minBy = $minBy ?: curry(function($fn, $a, $b){\n return $fn($a) < $fn($b) ? $a : $b;\n });\n return _apply($minBy, func_get_args());\n}", "public function havingLessThan(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '<', $value);\n }", "public function min($min = null)\n {\n $this->min = $min;\n\n return $this;\n }", "function find_minimum($entities) {\r\n \r\n\tglobal $userconnection_distance;\r\n $keys = array_keys ($entities);\r\n $minid = $entities[$keys[0]];\r\n $mindist = $userconnection_distance[$minid];\r\n foreach ($keys as $key) {\r\n $tentity = $entities[$key];\r\n if ($userconnection_distance[$tentity] < $mindist) {\r\n $mindist = $userconnection_distance[$tentity];\r\n $minid = $tentity;\r\n }\r\n }\r\n return $minid;\r\n}", "public function getMinPrice();", "public function getFirstCol() : int\n {\n\n // Convert A1:D3 to A1.\n list($startRef,) = explode(':', $this->getTableNode()->getAttribute('ref'));\n\n // Convert A1 to 1.\n $startCol = preg_replace('/([0-9])/', '', $startRef);\n\n return XlsxTools::convRefToNumber($startCol);\n }", "function setMin($min) {\n $this->field['min'] = (int) $min;\n\n return $this;\n }" ]
[ "0.83389103", "0.7783479", "0.7715271", "0.77041084", "0.76586914", "0.75963473", "0.75149596", "0.74753135", "0.7382603", "0.7271558", "0.7227676", "0.71789867", "0.71417737", "0.7042497", "0.6965243", "0.6918407", "0.6869645", "0.6865416", "0.68371135", "0.67951876", "0.672667", "0.6717195", "0.6686871", "0.6675085", "0.66674656", "0.66674656", "0.6624638", "0.65886945", "0.6551204", "0.65379834", "0.6531461", "0.6522018", "0.650909", "0.6471915", "0.64625996", "0.64625996", "0.64573085", "0.64382464", "0.64360917", "0.6432969", "0.6412525", "0.6397961", "0.63802886", "0.6356124", "0.63381994", "0.63333976", "0.63021386", "0.6283634", "0.6283598", "0.62744373", "0.62697184", "0.62697184", "0.6235278", "0.6204467", "0.6181442", "0.61770797", "0.61764777", "0.61629355", "0.61566055", "0.6150235", "0.6150183", "0.61356485", "0.61333334", "0.6132241", "0.6119793", "0.60992604", "0.6066867", "0.60594946", "0.6033037", "0.60041726", "0.6002715", "0.59986174", "0.59819067", "0.59816194", "0.5966979", "0.59614354", "0.59529704", "0.59518015", "0.59067726", "0.5904807", "0.58609074", "0.5850657", "0.58481884", "0.5830855", "0.5783157", "0.5781983", "0.57651144", "0.57617074", "0.57611537", "0.5755774", "0.5752422", "0.57503957", "0.57326984", "0.5713154", "0.5712693", "0.5701766", "0.5697338", "0.5663707", "0.5658246", "0.5649341" ]
0.82759273
1
Return the sum of a column
public function sum($column) { $rs = $this->select('sum('.$column.') sum')->value('sum'); return $rs ?: 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sum(string $column): float;", "public function getSumColumn();", "public function sum(string $column): float\n {\n return (float) $this->selection->sum($column);\n }", "public function sum(string $column): int\n {\n if ($this->shouldEmulateExecution()) {\n return 0;\n }\n\n return (int) $this->executeScript('Sum', !empty($column) ? $column : $this->attribute);\n }", "public function sum($column)\n {\n return $this->aggregate(__FUNCTION__, (array) $column);\n }", "public function sum($column)\n {\n return $this->aggregate(__FUNCTION__, [$column]);\n }", "public function sum($column)\n {\n $results = $this->model->sum($column);\n\n $this->resetModel();\n\n return $results ?: 0;\n }", "public function sum($column)\n {\n $agg = new Aggregate(Aggregate::SUM, $column);\n return $this->query->aggregate($agg, $this->filter);\n }", "public function sum(string $column)\n {\n return $this->execute(\n $this->syntax->selectSyntax(get_object_vars($this->aggregate($column, __FUNCTION__)))\n )[0][__FUNCTION__];\n }", "public function sum() : ColumnVector\n {\n return ColumnVector::quick(array_map('array_sum', $this->a));\n }", "function sum_column($arr, $column) {\n $output = 0;\n foreach ($arr as $row) {\n $value = lavnn($column, $row, 0);\n if (is_numeric($value))\n $output += $value;\n }\n return $output;\n}", "public function sum($model, $column, $dateColumn = null)\n {\n return $this->aggregate('sum', $model, $column, $dateColumn);\n }", "function sum($s)\n{\n\tif (!$this->getSql()) return 0;\n\t$rows = $this->getClone()->select(\"sum($s) as n\");\n\treturn +$rows[0]['n'];\n}", "public function sum($col = '*', $as = NULL) \n {\n $col = $this->clean($col);\n \n // Empty out the old junk\n $this->clear();\n \n // Build our sql statement\n $as = ($as !== NULL) ? \" AS \".$as : \"\";\n $this->sql = \"SELECT SUM(\". $col .\")\". $as;\n return $this;\n }", "public function sum();", "protected function _generateColumnSumQuery($column)\n\t{\n\t\t$publicationId = $this->_getPublicationId();\n\t\t$versionId = $this->_getVersionId();\n\n\t\t$sumQuery = \"SELECT SUM($column)\n\t\t\tFROM `$this->_logsTable`\n\t\t\tWHERE `publication_id`=$publicationId AND `publication_version_id`=$versionId\n\t\t\tORDER BY `year` ASC, `month` ASC\";\n\n\t\treturn $sumQuery;\n\t}", "public function sum(string $unit, $model, $column, $dateColumn = null)\n {\n return $this->aggregate('sum', $unit, $model, $column, $dateColumn);\n }", "public function sum()\n {\n return array_sum($this->data);\n }", "function days_total($table,$column,$filter){\n\tglobal $connection; \n $total= mysqli_query($connection,\"SELECT SUM($column) AS total FROM $table WHERE $filter\") or die(\"Error\".mysqli_error($connection));\n $row = mysqli_fetch_assoc($total);\n if (is_null($row['total'])) {\n \t$total =0;\n }else{\n \t$total = $row['total'];\n }\n return $total;\n}", "public function sum() {\n\t\treturn array_sum($this->_value);\n\t}", "function sumRecord($campo,$tabla,$where){\n\t$query=$GLOBALS['cn']->query('SELECT SUM('.$campo.') AS suma FROM '.$tabla.' '.$where);\n\t$array=mysql_fetch_assoc($query);\n\treturn $array['suma'];\n}", "function sumRecord($campo,$tabla,$where){\n\t$query=$GLOBALS['cn']->query('SELECT SUM('.$campo.') AS suma FROM '.$tabla.' '.$where);\n\t$array=mysql_fetch_assoc($query);\n\treturn $array['suma'];\n}", "public static function getSumByField(string $field)\n {\n return DB::table(static::$schema)->sum($field);\n }", "public function sum($request, $model, $unit, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, $unit, 'sum', $column, $dateColumn);\n }", "public function getSum()\n {\n return array_sum($this->values);\n }", "public function sum($sum=null)\n {\n $sum = LambdaUtils::toSelectCallable($sum);\n $temp = $this->select($sum)->toArray();\n return array_sum($temp);\n }", "public static function sum($attribute = null);", "public function sum() {\r\n $summedData = 123;\r\n\r\n return $summedData;\r\n }", "public function getSum(): float;", "public function sum() {\n\t\t$sum = 0;\n\t\tforeach ($this as $value) {\n\t\t\t$sum += $value;\n\t\t}\n\t\treturn $sum;\n\t}", "function aggregateSum($fileCSV, $options) {\n\n\t\t//check if the choosed option exists. if not, display the initial data file\n\t\tif( !optionExists('aggregate-sum', $options) )\n\t\t\treturn $fileCSV;\n\n\t\t//get the column choosed\n\t\t$column = array_column($fileCSV, $options['aggregate-sum']);\n\n\t\t$sum = 0;\n\n\t\t$sum = array_reduce($column, function($sum, $column) {\n\t\t\t$sum += $column;\n\t\t\treturn $sum;\t\n\t\t});\n\n\t\t//print the output\n\t\twrite('Aggregated sum is: '.$sum);\n\t\texit;\n\t}", "public function sum($request, $model, $column, $groupBy)\n {\n return $this->aggregate($request, $model, 'sum', $column, $groupBy);\n }", "public function sum(string $column, string $alias)\n {\n $this->columns[] = array(\n 'type' => 'sum',\n 'name' => $column,\n 'alias' => $alias\n );\n return $this;\n }", "function sum_from_table($table, $attr = array())\n{\n if (!isset($attr['field'])) {\n show_error('sum_from_table(); function expect field to be passed.');\n }\n\n $CI =& get_instance();\n if (isset($attr['where']) && is_array($attr['where'])) {\n $i = 0;\n foreach ($attr['where'] as $key => $val) {\n if (is_numeric($key)) {\n $CI->db->where($val);\n unset($attr['where'][$key]);\n }\n $i++;\n }\n $CI->db->where($attr['where']);\n }\n $CI->db->select_sum($attr['field']);\n $CI->db->from($table);\n $result = $CI->db->get()->row();\n\n return $result->{$attr['field']};\n}", "public function sum($field) {\n return $this->getRepository()->aggregate($this, __FUNCTION__, $field);\n }", "public function colSumTotal($colName) {\r\n $this->colSumTotals[] = $colName;\r\n }", "public function sum($field = null)\n {\n if ($field === null) {\n return array_sum($this->items);\n }\n $result = 0;\n foreach ($this->items as $item) {\n $result += dataGet($item, $field);\n }\n return $result;\n }", "public function getColumnSum(array &$tasks, $field)\n {\n $sum = 0;\n\n foreach ($tasks as $task) {\n $sum += $task[$field];\n }\n\n return $sum;\n }", "public function sum(Query $query, string $field): float;", "static public function mdlSumaTotalEntradas($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(neto) as total FROM $tabla\");\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public function getSum()\n {\n return $this->amount;\n }", "function addSum($field, $name) {\n\t\t$name = \"`\".$this->db->escape_string($name).\"`\";\n\t\t$this->fields[] = array(\"SUM(\".$name.\")\", $this->db->escape_string($field));\n\t\treturn $this;\n\t}", "static public function mdlSumaTotalIngresos($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(total) as total FROM $tabla WHERE banco = 'MercadoPago'\" );\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "static public function mdlSumaTotalAutoconsumos($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(neto) as total FROM $tabla\");\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "function get_army_value()\n\t{\n\t\t$result = pg_query(\"SELECT sum(point_cost) as point_total FROM warhammer.user_army\");\n\t\t$result_a = pg_fetch_array($result,0,PGSQL_ASSOC);\n\t\treturn $result_a[\"point_total\"];\n\t}", "function totalboaralla(){\n\n\t$crud = new CRUD();\n\t$crud->disconnect();\n\n\t$crud -> sql(\"select SUM(native_boar) as totalboaralla from farmers_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['totalboaralla'];\n\t}\n\t$crud->disconnect();\n}", "public static function getSumColRpt(){return file_get_contents('queries/cumulativecollegerpt.txt');}", "public function sum($field)\n {\n return $this->withMeta(['sum' => $field]);\n }", "public function sum_nilai_adjust() \n {\n return $get_data = $this->db->query(\"SELECT sum(nilai_adjust) as nilai_adjust FROM temp_adjust_barang where id_karyawan='\".$this->session->userdata('id_karyawan').\"'\");\n }", "public function totalCeldasHoja(int $hoja, string $columna) {\n $hoja = $this->LibroExcel->setActiveSheetIndex($hoja);\n $lastRow = $hoja->getHighestRow();\n $sumaCeldas = 0;\n for ($row = 1; $row <= $lastRow; $row++) {\n $celda = $hoja->cellExists($columna . $row);\n $sumaCeldas = $sumaCeldas + $celda;\n }\n return $sumaCeldas;\n }", "function total() {\n\t\t$sql = \"\n\t\t\tSELECT SUM(biaya) as totalbiaya FROM tiket \n\t\t\tWHERE tgl_pemesanan >= '\".date(\"Y-m-d\").\"' AND tgl_pemesanan <= '\".date(\"Y-m-d\").\"'\n\t\t\tORDER BY id_tiket ASC\"; \n\t\t\n\t\t$query = $this->db->query($sql);\n\t\t$row = $query->row();\n\t\treturn $row->totalbiaya;\n\t}", "public function SumeColumnaEsp($NombreColumnaSuma, $NombreColumnaFiltro,$filtro)\r\n {\r\n\t\r\n\t//print_r($this->NombreCol);\r\n\t$ColSuma=$this->NombreCol[$NombreColumnaSuma];\r\n\t$ColumnaFiltro=$this->NombreCol[$NombreColumnaFiltro];\r\n\t\r\n\t$sql=\"SELECT SUM($ColSuma) AS suma FROM $this->tabla WHERE $ColumnaFiltro = '$filtro'\";\r\n\t//print($sql);\r\n\t$reg=mysql_query($sql, $this->con) or die('no se pudo obtener la suma en SumeColumna: ' . mysql_error());\r\n\t$reg=mysql_fetch_array($reg);\r\n\t\r\nreturn($reg[\"suma\"]);\r\n\r\n\t}", "public function sumByDays($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_DAYS, 'sum', $column, $dateColumn);\n }", "public function getTotalAttribute()\n {\n $incremento =$this->monto*($this->interes/100);\n\n return $this->monto+$incremento;\n }", "public function sum($table, $field = \"*\", $params = [], $joins = [])\n {\n $query = $this->query($this->selectContext($table, $field, $joins, $params, \"SELECT\", 'SUM'));\n return $query ? 0 + $query->fetchColumn() : false;\n }", "public function sumPaidWorkers() \r\n\t{\r\n\t\t$query = \"SELECT sum(plata) as Ukupno FROM \" . $this->table . \" \r\n\t\tWHERE id_plata = 1\";\r\n\r\n\t\t$stmt = $this->conn->prepare($query);\r\n\t\t$stmt->execute();\r\n\r\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t$ukupno = $row['Ukupno'];\r\n\t\t\r\n\t\treturn $ukupno;\r\n\t}", "function ventas_totales(){\n\t\tglobal $link;\n\t\n\t\t$sql =\"SELECT SUM(importe) FROM consumos\";\n\t\t$query = mysqli_query($link,$sql);\n\t\t$total = mysqli_fetch_assoc($query);\n\t\t\n\t\treturn $total[\"SUM(importe)\"];\n}", "public function sum($field, $alias = '')\n {\n return $this->prepareAggregateStatement($field, $alias, 'SUM');\n }", "public function getSum()\n {\n $balance = 0;\n\n foreach ($this->getEntries() as $entry) {\n $balance += ($entry->getAmount() * ((double) $entry->getAccount()->getType()->getValue().'1'));\n }\n\n return $balance;\n }", "public function gettotal()\n {\n $query = $this->db->query(\"SELECT SUM(`price`) as total FROM `sales` WHERE DATE(`date`)=CURDATE()\");\n return $query->result();\n\n }", "public function getTotalAttribute() {\n return $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum();\n }", "public function getTotal($idColumn = null)\n\t{\n\t\tif (empty($idColumn))\n\t\t{\n\t\t\treturn parent::getTotal();\n\t\t}\n\n\t\t// Get a storage key.\n\t\t$store = $this->getStoreId('getTotal');\n\n\t\t// Try to load the data from internal storage.\n\t\tif (isset($this->cache[$store]))\n\t\t{\n\t\t\treturn $this->cache[$store];\n\t\t}\n\n\t\t// Load the total.\n\t\t$query = $this->getListQuery();\n\t\t$query->clear('SELECT')->clear('limit')->clear('offset')->clear('order');\n\t\t$query->select(\"COUNT(DISTINCT ($idColumn))\");\n\t\t$this->_db->setQuery($query);\n\n\t\ttry\n\t\t{\n\t\t\t$total = (int) $this->_db->loadResult();\n\t\t}\n\t\tcatch (Exception $exc)\n\t\t{\n\t\t\t$this->setError($exc->getMessage());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Add the total to the internal cache.\n\t\t$this->cache[$store] = $total;\n\n\t\treturn $this->cache[$store];\n\t}", "public function select_sum($select = '', $alias = '')\n\t{\n\t\treturn $this->_max_min_avg_sum($select, $alias, 'SUM');\n\t}", "public function income_total_event() {\n\n $event_id = $this->input->post('id');\n\n $result = $this->db->query(\"SELECT SUM(nominal) AS 'total_pendapatan'\n FROM events_income\n WHERE event_id = \" . $event_id);\n\n if ($result->num_rows() > 0) {\n $result = $result->row_array();\n\n echo number_format($result['total_pendapatan']);\n } else {\n echo 0;\n }\n\n }", "public function getChargeSum()\n {\n return $this->get(self::CHARGE_SUM);\n }", "public function mean() : ColumnVector\n {\n return $this->sum()->divideScalar($this->n);\n }", "function po_total($po_id){\n global $connection;\n $total_po = mysqli_query($connection,\"SELECT SUM(total) AS gtotal FROM kp_po_items WHERE po_id='$po_id'\") or die(\"Error\");\n $row = mysqli_fetch_assoc($total_po);\n $total = $row['gtotal'];\n return $total;\n}", "public function getValorTotal(){\n $sum = 0;\n foreach($this->itens as $i):\n $sum += $i->getPreco() * $i->getQuantidade();\n endforeach;\n\n return $sum;\n }", "public function getTotalAttribute() {\n return $this->products()->get(['price', 'amount'])->sum(function($product) {\n return $product->price * $product->amount;\n });\n }", "public function getRowTotal() {\n return $this->item->getRowTotal();\n }", "public function getSumRowsOfTable ($field,$tableName);", "private function compute($row, $column) {\n $upper_row = $this->getNextRow(Direction::UP, $row);\n $lower_row = $this->getNextRow(Direction::DOWN, $row);\n $rows = array($upper_row, $row, $lower_row);\n \n $left_column = $this->getNextColumn(Direction::LEFT, $column);\n $right_column = $this->getNextColumn(Direction::RIGHT, $column);\n $columns = array($left_column, $column, $right_column);\n \n //compute the sum of 3 by 3 square\n $sum = 0;\n foreach($rows as $row) {\n foreach($columns as $column) {\n $sum += $this->get($row, $column);\n }\n }\n return $sum;\n }", "public function sumUnpaidWorkers() \r\n\t{\r\n\t\t$query = \"SELECT sum(plata) as Ukupno FROM \" . $this->table . \" \r\n\t\tWHERE id_plata = 2\";\r\n\r\n\t\t$stmt = $this->conn->prepare($query);\r\n\t\t$stmt->execute();\r\n\r\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t$ukupno = $row['Ukupno'];\r\n\t\t\r\n\t\treturn $ukupno;\r\n\t}", "public function total();", "public function total();", "public function total();", "public function sum(): int\n {\n $out = 0;\n foreach ($this->arr as $v) {\n $out += $v;\n }\n return $out;\n }", "public function sumByHours($request, $model, $column, $dateColumn = null)\n {\n return $this->aggregate($request, $model, Trend::BY_HOURS, 'sum', $column, $dateColumn);\n }", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "public function sum_qty() {\n\t\t$q = SalesHistoryDetailQuery::create();\n\t\t$q->withColumn('SUM('.SalesHistoryDetail::get_aliasproperty('qty_ordered').')', 'sum');\n\t\t$q->select('sum');\n\t\t$q->filterByOrdernumber($this->oehhnbr);\n\t\treturn $q->findOne();\n\t}", "public function getMontoTotal() {\n $command = Yii::app()->db->createCommand()\n ->select('sum(t.monto) as total')\n ->from('pago t');\n return $command->queryRow()['total'];\n }", "function totale_retegas_netto(){\r\nglobal $db;\r\n$qry = \"SELECT\r\nSum(retegas_dettaglio_ordini.qta_arr*retegas_articoli.prezzo)\r\nFROM\r\nretegas_dettaglio_ordini\r\nInner Join retegas_articoli ON retegas_dettaglio_ordini.id_articoli = retegas_articoli.id_articoli\";\r\n \r\n$res = $db->sql_query($qry);\r\n$row = $db->sql_fetchrow($res);\r\n\r\nreturn (int) $row[0]; \r\n \r\n}", "abstract public function getAddStatement(DColumnDefinition $column);", "public function getLikesSum()\n {\n return intval($this->getData('likes.summ'));\n }", "public function sum($value){\n\t\t\tif($value != 0)\n\t\t\treturn array_sum(array_column($value, 'price'));\n\t\t}", "public function total(): float;", "public function total(): float;", "public function get_sum_receber()\n \t{\n \t $this->db->select([\n \n 'FORMAT(SUM(REPLACE( conta_receber_valor, \",\",\"\")),2) as conta_receber_valor',\n\n ]);\n\n $this->db->where(' conta_receber_status',0);\n\n \t return $this->db->get('contas_receber')->row();\n \n \t}", "public function sumItems(): float\n\t{\n\t\treturn $this->storage->sum();\n\t}", "function sum_month($month)\n{\n $results = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n if($month->num_rows) {\n while($row2 = $month->fetch_row()) {\n foreach($row2 as $key=>$value) {\n /*is it correct? maybe $val == 0*/\n if ($key == 0 ) continue;\n $results[$key] += $value;\n }\n }\n }\n return $results;\n}", "public function count($col);", "public function get_rows_total_price()\n\t{\n\t\t// TODO: This price should be stored not calculated every time!\n\t\t$total = 0;\n\n\t\tforeach ($this->get_rows() as $row)\n\t\t{\n\t\t\t$total += $row->prop(\"price\") * $row->prop(\"items\");\n\t\t}\n\n\t\treturn $total;\n\t}", "function getSum($u_id , $searchDate)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t $myarr['total'] =0;\n\t\t\t $query = \"select SUM(total_price) AS total from check_tb where u_id='\".$u_id.\"' \".$searchDate.\" \"; \n $res=$mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\t\n\t\t\t$myarr=mysqli_fetch_assoc($res);\n\t\t\tif($myarr['total'] == \"\")\n\t\t\t{\n\t\t\t\techo \"0\";\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $myarr['total'];\n\t\t\t}\n\t\t}", "public function amount()\n {\n return $this->products()->select('price')->get()->sum(function ($product) {\n return $product->price;\n });\n }", "public function getRechargeSum()\n {\n return $this->get(self::_RECHARGE_SUM);\n }", "public function sumFile($fileName)\n {\n $data = file($fileName);\n\n // Could use array_sum(), but the instructions say to not use existing functionality\n $sum = array_reduce($data, function ($sum, $num) { return $sum + $num; }, 0);\n return $sum;\n }", "public function setPieColumnSumSeries($allsum, $columnsum, $fields){\n\t\t$this->series_array['series'][0]['type'] = 'pie';\n\t\t$this->series_array['series'][0]['name'] = 'Column Sum/Total';\n\t\t\n\t\tforeach($allsum as $allsum_item){\n\t\t\t$total = $allsum_item['allsum'];\n\t\t}\n\t\t\n\t\tforeach($columnsum as $columnsum_key => $columnsum_value){\n\t\t\tfor($i=0;$i<count($fields);$i++){\n\t\t\t\t$this->series_array['series'][0]['data'][$i][0] = \"Sum of \" . $fields[$i];\n\t\t\t\t$this->series_array['series'][0]['data'][$i][1] = $columnsum_value[$fields[$i]]/$total * 100;\n\t\t\t}\n\t\t}\n\t}", "public function increment($column, $amount = 1)\n\t{\n\t\treturn $this->_adjust($column, $amount, ' + ');\n\t}", "public function get_sum_pagar()\n \t{\n \t $this->db->select([\n \n 'FORMAT(SUM(REPLACE( conta_pagar_valor, \",\",\"\")),2) as conta_pagar_valor',\n\n ]);\n\n $this->db->where('conta_pagar_status',0);\n\n \t return $this->db->get('contas_pagar')->row();\n \n \t}", "public function getAmountAttribute()\n {\n return $this->lines()->get()->reduce(function($carry, $line) {\n return $carry + $line->cost * $line->quantity;\n }, 0);\n }" ]
[ "0.8647104", "0.8499365", "0.7758407", "0.7692701", "0.7644959", "0.76248354", "0.7552687", "0.74420583", "0.73561084", "0.7191984", "0.7156892", "0.6833508", "0.67949677", "0.67245424", "0.65877986", "0.6511779", "0.6461906", "0.64491606", "0.6437211", "0.6375705", "0.6361341", "0.6361341", "0.6335447", "0.6315502", "0.624036", "0.62391186", "0.62373114", "0.61884373", "0.6177631", "0.61765105", "0.6138343", "0.60872924", "0.60849774", "0.6026628", "0.59998596", "0.59774196", "0.59582627", "0.5906689", "0.5892431", "0.5871813", "0.5849645", "0.58281404", "0.57855755", "0.57604253", "0.5754159", "0.57290745", "0.5698874", "0.5689292", "0.56453925", "0.55976707", "0.5595639", "0.55677015", "0.55610424", "0.5529908", "0.5524292", "0.55152166", "0.549586", "0.5495151", "0.549377", "0.54889345", "0.5488487", "0.5487058", "0.5485097", "0.5479737", "0.54715645", "0.5459195", "0.54549164", "0.54547703", "0.54426944", "0.5439785", "0.5439114", "0.5435611", "0.5428881", "0.54273784", "0.54273784", "0.54273784", "0.5425265", "0.54118156", "0.54103005", "0.5403297", "0.54004765", "0.53996587", "0.53973556", "0.53921854", "0.5386608", "0.5370165", "0.5370165", "0.53620994", "0.53427196", "0.5341173", "0.5339647", "0.5328352", "0.53260225", "0.53121567", "0.53052485", "0.5300299", "0.5290799", "0.5289476", "0.5285903", "0.5280509" ]
0.80192965
2
EXECUTORS Find a record by its primary key.
public function find($id, $primary_key = 'id') { $this->where(array($primary_key => $id)); if (!is_array($id)) { return $this->first(); } return $this->execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnFindByPK($id);", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "public abstract function find($primary_key, $model);", "public function fetch($primaryKey);", "public static function find($primary_key) {\n $table_name = self::table_name();\n return $table_name::unique([\"id\" => intval($primary_key)]); // convert to where struct and pass\n }", "public function returnDetailFindByPK($id);", "public static function find($primary_key)\n {\n return static::select()\n ->where(static::getPrimaryKey(), $primary_key)\n ->fetchOne();\n }", "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\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)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "public static function find($id, $key = 'id');", "public function find($arg) {\n if ($arg instanceof IFilterable) {\n $condition = $arg->resultFilter();\n } else {\n $condition = $this->getPrimaryKeyCondition($arg);\n }\n \n $this->_dataHandler->select('*', $this->_table, $condition);\n return $this->_dataHandler->fetchObject();\n }", "public function returnMoreFindByPK($id);", "public function find($pk = null) {\n\t\t//Prepare the SELECT SQL Query\n\t\t$sql = $this->prepareSelect($pk);\n\t\t\n\t\t//Clear actual dataSet\n\t\t$this->clearDataSet();\n\t\t\n\t\t$modelName = get_class($this->getModel());\n\t\t\n\t\tif($sql != null) {\n\t\t\t$this->execute($sql);\n\t\t\t$this->resultSet = &$this->getModel()->getConnection()->executeSQL($sql);\n\t\t} else {\n\t\t\tPhpBURN_Message::output(\"[!No query found!] - <b>$modelName</b>\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Set cursor at the first position\n\t\t$this->setPointer(0);\n\t\t\n\t\t//Prepare DataSet\n\t\t//$this->setDataSet($dataSet);\n\t\t\n\t\t//Returns the amount result\n\t\treturn $this->getModel()->getConnection()->affected_rows($this->resultSet);\n\t}", "public static function findByPrimaryKey($primary_key)\n {\n return self::find($primary_key);\n }", "private function _fetch_primary_key()\n {\n if($this->primaryKey == NULl)\n {\n $this->primaryKey = $this->db->query(\"SHOW KEYS FROM `\".$this->_table.\"` WHERE Key_name = 'PRIMARY'\")->row()->Column_name;\n }\n }", "public function find($primaryValue);", "abstract function getPrimaryKey();", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function getRecordByPK($pkValue, \\PDO $recordInstancePdoConnection = null): ActiveRecordInterface;", "function GetRecordByPrimaryKey($unirecid)\n {\n return $this->GetRecordByPk($unirecid);\n }", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n if ($rs->EOF) {\n return null;\n }\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public\tfunction\tfind($primary = NULL)\n\t\t{\n\t\t\t$this->_relate();\n\t\t\t\n\t\t\t$access\t=\t$this->_database->getAccess();\n\t\t\t$query\t=\t$this->getQuery('find');\n\t\t\treturn\t$query;\n\t\t\t$filter\t=\t$this->getQuery('filter');\n\t\t\tvar_dump($filter);\n\t\t\t$access->query($this->getQuery('find'), array());\n\t\t\t\n\t\t\t$output\t=\tarray();\n\t\t\twhile($row = $access->fetch()) {\n\t\t\t\t$output[]\t=\t$this->_fetch($row);\n\t\t\t}\n\t\t\texit();\n\t\t}", "public static function find_by_id($id){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"SELECT * FROM \".$table.\" WHERE \".$keyColumn.\" = \".$id;\n $res = mysqli_query(static::$conn,$sql);\n $row = mysqli_fetch_object($res,get_called_class());\n return $row;\n }", "public function findByPk($primary)\n {\n $stmt = $this->Adapter->prepare(\"SELECT * FROM $this->table WHERE $this->primaryName=:id\");\n $stmt->execute(['id' => $primary]);\n return $stmt->fetch($this->pdoFetch);\n }", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_identification\n\t\t\t\tWHERE idf_id=?\";\n\t\t$this->db->query($sql, array($this->idf_id));\n\t\treturn $query;\n\t}", "public function findById($id)\n {\n $sql = $this->getSelectStatement() . ' WHERE ' . $this->getPrimaryKeyName() . '=:id';\n \n $statement = DatabaseHelper::runQuery($this->connection, $sql, array(':key'=> $key));\n return $statement->fetch();\n }", "public function find(int $key);", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "function find($id);", "public\tfunction\tfind($primary = NULL)\n\t\t{\n\t\t\tif(!$this->_related)\t$this->setRelations();\n\t\t\t\n\t\t\t$access\t=\t$this->_database->getAccess();\n\t\t\t$query\t=\t$this->getQuery('find');\n\t\t\t$filter\t=\t$this->getQuery('filter');\n\t\t\tvar_dump($filter);\n\t\t\t$access->query($this->getQuery('find'), array());\n\t\t\t\n\t\t\t$output\t=\tarray();\n\t\t\twhile($row = $access->fetch()) {\n\t\t\t\t$output[]\t=\t$this->_fetch($row);\n\t\t\t}\n\t\t\texit();\n\t\t}", "abstract public function primaryKey(): string;", "static function retrieveByPK($id) {\n\t\treturn static::retrieveByPKs($id);\n\t}", "public static function Get($key) {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$primary = $model->index('primary');\r\n\t\tif (is_null($primary)) {\r\n\t\t\tthrow new Exception(\"The schema for {$cls} does not identify a primary key\");\r\n\t\t}\r\n\t\tif (!is_array($key)) {\r\n\t\t\tif (count($primary['fields']) > 1) {\r\n\t\t\t\tthrow new Exception(\"The schema for {$cls} has more than one field in its primary key\");\r\n\t\t\t}\r\n\t\t\t$key = array(\r\n\t\t\t\t$primary['fields'][0] => $key\r\n\t\t\t);\r\n\t\t}\r\n\t\tforeach ($primary['fields'] as $field) {\r\n\t\t\tif (!isset($key[$field])) {\r\n\t\t\t\tthrow new Exception(\"No value provided for the {$field} field in the primary key for \" . get_called_class());\r\n\t\t\t}\r\n\t\t\t$model->where(\"{$field} = ?\", $key[$field]);\r\n\t\t}\r\n\t\t//$src = Dbi_Source::GetModelSource($model);\r\n\t\t$result = $model->select();\r\n\t\tif ($result->count()) {\r\n\t\t\tif ($result->count() > 1) {\r\n\t\t\t\tthrow new Exception(\"{$cls} returned multiple records for primary key {$id}\");\r\n\t\t\t}\r\n\t\t\t$record = $result[0];\r\n\t\t} else {\r\n\t\t\t$record = new Dbi_Record($model, null);\r\n\t\t\t$record->setArray($key, false);\r\n\t\t}\r\n\t\treturn $record;\r\n\t}", "abstract public function find($id);", "public function findByPrimaryKey($key)\n {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "private function findRecord()\n {\n /** If the request is a read record request, we need to do this so eager loading occurs. */\n if ($this->jsonApiRequest->isReadResource()) {\n return $this->store->readRecord(\n $this->jsonApiRequest->getResourceType(),\n $this->jsonApiRequest->getResourceId(),\n $this->jsonApiRequest->getParameters()\n );\n }\n\n return $this->store->find($this->jsonApiRequest->getResourceIdentifier());\n }", "function find($id=true,$fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n if(is_string($id) || is_numeric($id)){\n $this->where($this->getPk(),'=',$id);\n }\n return $this->db->find($fetch_type);\n }", "public function findByPk($id, $typeResult = self::FETCH_OBJ){\n\t$query = \"SELECT * FROM $this->tableName USE INDEX(PRIMARY) WHERE ID=?\";\n\treturn $this->createResult($query, array($id), $typeResult);\n}", "public function findById(){\n\t\t$parametro = func_get_args();\n\t\t$resultado=$this->execSql($this->FINDBYID,$parametro);\n\t\tif (!$resultado){\n\t\t\t$this->onError(\"COD_FIND\",\"x ID NOTICIAS\");\n\t\t}\n\t\treturn $resultado;\n\t}", "function find($table, $value, $pk = null)\n {\n if(is_null($pk)){\n $pk = \"id\";\n }\n $this->query(\"SELECT * FROM $table WHERE $pk = '$value'\");\n return oci_fetch_array($this->result);\n }", "public function test_getByRecordId_exists_executesCorrectly()\r\n\t{\r\n\t\t$recordId = \"aDummyRecordId\";\r\n\t\t\r\n\t\t$this->prepareSetRecordId($recordId);\r\n\t\t$this->prepareFind(true);\r\n\t\r\n\t\t$actual = $this->service->getByRecordId($recordId);\r\n\t\t$this->assertEquals($this->dbObjectMock, $actual);\r\n\t}", "public function fetchByPrimaryKey($pk){\n\t\t$sql = \"SELECT * FROM \".$this->_tableName.\" WHERE \".$this->_primaryKeyColumn.\"=?\";\n\n\t\ttry{\n\t\t\t$resultArray = $this->_dbConnection->fetchAssoc($sql, array($pk));\n\t\t} catch (\\Exception $e){\n\t\t\t$resultArray = array();\n\t\t}\n\t\t\n\t\treturn $resultArray;\n\t}", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "function getPrimaryKey () {\n\t\t\n\t\t$count = $this->find('count');\n\t\t\n\t\t$primaryKey = $count+1;\n\t\t\n\t\tif( $this->find('count',array('conditions'=>array($this->name . '.' . $this->primaryKey=>$primaryKey))) > 0) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t$i = (int) $count;\n\n while ( $i >= 1 ) {\n\n $i += 1;\n\t\t\t\t\t\n\t\t\t\t\t$primaryKey = $i;\n \n\t\t\t\t\t$returnValue = $this->find('count',array('conditions'=>array($this->name . '.' . $this->primaryKey=>$primaryKey)));\n\n if ($returnValue == 0) {\n \t\t\t\t\t\t\t\t\t\n break;\n }\n\t\t\t\t\t\n\t\t\t\t\t$i++;\n }\n\n return $primaryKey;\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\treturn $primaryKey;\n\n\t\t}\t\n\t\n\t}", "function find($entity, $model = FALSE)\n {\n $retval = NULL;\n // Get primary key of the entity\n $pkey = $this->object->get_primary_key_column();\n if (!is_numeric($entity)) {\n $entity = isset($entity->{$pkey}) ? intval($entity->{$pkey}) : FALSE;\n }\n // If we have an entity ID, then get the record\n if ($entity) {\n $results = $this->object->select()->where_and(array(\"{$pkey} = %d\", $entity))->limit(1, 0)->run_query();\n if ($results) {\n $retval = $model ? $this->object->convert_to_model($results[0]) : $results[0];\n }\n }\n return $retval;\n }", "public function find($id){\n return $this->db->find($this->table,$id);\n }", "public function get($primaryKeyValue)\n\t{\n\t\t// Get only one record using the primary key\n\t\treturn $this->getOne(array($this->getPrimaryKeyField(), '=', $primaryKeyValue));\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}", "public function selectById()\n {\n $sql = \"SELECT * FROM \" . self::TABLE_NAME . \" WHERE id=?\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"s\", $this->getId());\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n return $result->fetch_assoc();\n }", "protected function _getPrimaryKeyValue(){\n $primaryKey = $this->_getPrimaryKey();\n return $this->{$primaryKey};\n }", "function getPrimaryKey() {\n\n $count = $this->find('count');\n $primaryKey = $count + 1;\n\n if ($this->find('count', array('conditions' => array($this->name . '.' . $this->primaryKey => $primaryKey))) > 0) {\n\n $i = (int) $count;\n\n while ($i >= 1) {\n\n $i += 1;\n\n $primaryKey = $i;\n\n $returnValue = $this->find('count', array('conditions' => array($this->name . '.' . $this->primaryKey => $primaryKey)));\n\n if ($returnValue == 0) {\n\n break;\n }\n\n $i++;\n }\n\n return $primaryKey;\n } else {\n\n return $primaryKey;\n }\n }", "public function get($primaryKeyValue = 0)\n\t{\n\t\t// Create new row object\n\t\tif(!$primaryKeyValue) {\n\t\t\t$row = new $this->rowClass();\n\t\t\treturn $row;\n\t\t\n\t\t// Find record by primary key\n\t\t} else {\n\t\t\treturn $this->first(array($this->getPrimaryKeyField() => $primaryKeyValue));\n\t\t}\n\t}", "public function find(int $id) ;", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `USER_ID`, `NAME`, `DESCRIPTION`, `BARE_PATH`, `CLONE_PATH`, `FORKED_FROM_ID`, `FORKED_AT`, `CREATED_AT`, `UPDATED_AT` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "function findById($id);", "public function find( $id );", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `NAME`, `VALUE`, `REMOTE` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function get_primary_row(){\r\n $result = $this->db->query(\"SHOW KEYS FROM \". $this->db->formatTableName($this->table). \"\r\n WHERE Key_name = %s\"\r\n , \"PRIMARY\");\r\n $pk = \"\";\r\n foreach ($result as $res){\r\n $pk = $res[\"Column_name\"];\r\n }\r\n return $pk;\r\n }", "public function fetch_row($table_name,$key,$id)\n {\n\t\t$res=pg_query($this->connection,\"SELECT * FROM $table_name WHERE $key=$id\");\n\t\treturn pg_fetch_assoc($res);\n }", "public function findOne() {\n $this->buildSql();\n $rows = $this->db->findOne($this->sql);\n return $rows;\n }", "public function findByPK($id) {\n // prepare SELECT statement\n $statement = $this->pdo->prepare('SELECT id, symbol, company\n FROM stocks\n WHERE id = :id');\n // bind value to the :id parameter\n $stmt->bindValue(':id', $id);\n \n // execute the statement\n $stmt->execute();\n \n // return the result set as an object\n return $stmt->fetchObject();\n }", "public function getPrimaryKey()\n\t{\n $indexes = $this->getIndexes();\n\n foreach ($indexes as $index){\n if ($index['Key_name'] == \"PRIMARY\"){\n return $index;\n }\n }\n\n \t\t\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = RepositoryPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(RepositoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "protected function actionGetByPrimaryKey($primaryKey)\n {\n return $this->_static_block->getByPrimaryKey($primaryKey);\n }", "public function find($id){\n return parent::find($this->table, $id);\n }", "public function findByPrimaryKey(stubBaseReflectionClass $entityClass, array $primaryKeys);", "public function findByPK($id) {\n // prepare SELECT statement\n $stmt = $this->pdo->prepare('SELECT id, symbol, company\n FROM stocks\n WHERE id = :id');\n // bind value to the :id parameter\n $stmt->bindValue(':id', $id);\n \n // execute the statement\n $stmt->execute();\n \n // return the result set as an object\n return $stmt->fetchObject();\n }", "public static function find($id);", "static function retrieveByPKs($id) {\n\t\tif (null === $id) {\n\t\t\treturn null;\n\t\t}\n\t\tif (static::$_poolEnabled) {\n\t\t\t$pool_instance = static::retrieveFromPool($id);\n\t\t\tif (null !== $pool_instance) {\n\t\t\t\treturn $pool_instance;\n\t\t\t}\n\t\t}\n\t\t$q = new Query;\n\t\t$q->add('id', $id);\n\t\treturn static::doSelectOne($q);\n\t}", "public function findRecordById($id)\n {\n $rowset = $this->select(['id' => $id]);\n $row = $rowset->current();\n\n return $row;\n }", "function fetchRecordInfo($identifier) {\n $db_obj = new db_class();\n $primary_key = $db_obj->getPrimaryKey($this->table_title);\n $sql = 'SELECT * FROM ' . $this->table_title . ' WHERE ' . $primary_key . '=?';\n \n $keyTypeHash = $db_obj->columnTypeHash($this->table_title);\n $keyType = $keyTypeHash[$this->primary_key];\n $db_table = $db_obj->simpleOneParamRequest($sql, $keyType, $identifier);\n $db_obj->closeDB();\n \n return $db_table[0];\n }", "public final function find($key, $fields=array(), $callbacks=array())\n {\n $this->reset(true);\n $this->filter = $this->alias . '.' . $this->pk . '= {int:' . $this->pk . '}';\n $this->param = array($this->pk => $key);\n\n if (!empty($fields))\n {\n if (!is_array($fields))\n $fields = array(\n $fields\n );\n\n $this->fields = $fields;\n }\n\n return $this->read('row', $callbacks);\n }", "public function findFirstByKey($key);", "public function byPrimaryKeys()\n {\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->exactly(2))\n ->method('fetch')\n ->will($this->onConsecutiveCalls(false, array('id' => 'mock', 'bar' => 'Here is bar.', 'default' => 'And this is default.')));\n $this->assertNull($this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), array('id' => 'mock')));\n $singlePrimaryKey = $this->dbFinder->findByPrimaryKeys($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), array('id' => 'mock'));\n $this->assertEquals('mock', $singlePrimaryKey->getId());\n $this->assertEquals('Here is bar.', $singlePrimaryKey->withAnnotation());\n $this->assertEquals('And this is default.', $singlePrimaryKey->withDefaultValue());\n $this->assertEquals('foo', $this->mockQueryBuilder->getSelect()->getBaseTableName());\n }", "public function find($id)\n\t{\n\t\treturn $this->fetchRow(array(\n\t\t\t$this->getAdapter()->quoteIdentifier($this->getPrimaryName()) . ' = ?' => $id\n\t\t));\n\t}", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = SearchIndexPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n // the object is already in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(SearchIndexPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public static function getPk(){\n return static::$_primaryKey;\n }", "function findFirst($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\t$obj = $statement->fetchObject($this->resultClass, array($this));\n\t\treturn $obj;\n\t}", "private function _find($id, $lockForUpdate = false)\n {\n $prepSql = \"SELECT {$this->_columnNames} FROM `{$this->_tableName}` \"\n . 'WHERE `id` = ? ';\n \n if ($lockForUpdate) {\n $prepSql .= 'FOR UPDATE ';\n }\n \n $pstmt = $this->_prepare($prepSql);\n $bindings = [$id];\n\n $pstmt->execute($bindings);\n \n $dbRecord = $pstmt->fetch(\\PDO::FETCH_ASSOC);\n $pstmt->closeCursor();\n $entity = $this->_toEntity($dbRecord);\n \n return $entity;\n }", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = DireccionRequerimientoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(DireccionRequerimientoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = PeliculaPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(PeliculaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "function FetchByID()\n\t{\n\t\tglobal $dal_info;\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\n\t\t$dal_where = \"\";\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\n\t\t\t\n\t\t\tforeach($this->Param as $field => $value)\n\t\t\t{\n\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t$dal_where.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// cleanup\n\t\t$this->Reset();\n\t\t// construct and run SQL\n\t\tif ($dal_where)\n\t\t\t$dal_where = \" where \".substr($dal_where, 0, -5);\n\t\t\t\n\t\t$dalSQL = \"select * from \".$this->_connection->addTableWrappers( $this->m_TableName ).$dal_where;\n\t\treturn $this->_connection->query( $dalSQL );\n\t}", "public function read_by_id(){\n try {\n $userid = $this->id;\n\n // query to get specific users\n $this->_query = \"SELECT * FROM \" . $this->_dbtable . \" WHERE id=:userid\";\n\n\n // preparing query\n $statement = $this->_conn->prepare($this->_query);\n\n //binding params\n $statement->bindParam(\":userid\", $userid, PDO::PARAM_INT);\n\n // executing query\n $statement->execute();\n\n return $statement;\n }\n catch(PDOException $ex){\n echo \"Error\" . $ex->getMessage();\n }\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "function find($table, $id)\n{\n $data = connect()->query(\"SELECT * FROM $table WHERE id='$id'\");\n\n return $data->fetch_object();\n}", "function getRecord( $sql ) {\r\n\t\t\t$result = $this->_connectAndExec( $sql );\r\n\t\t\tocifetchinto( $result, $record, OCI_ASSOC );\r\n\t\t\tOCIFreeStatement( $result );\r\n\t\t\treturn $this->_lowerKeyNames( $record );\r\n\t\t}", "public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = AdvogadoAreaAdvocaciaPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(AdvogadoAreaAdvocaciaPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `TITULO`, `DURACION`, `FECHA_ESTRENO`, `ESTRENO`, `ACTOR1_NOM`, `ACTOR1_APELL`, `ACTOR2_NOM`, `ACTOR2_APELL`, `CATEGORIA_ID`, `ESTADO`, `SINOPSIS`, `IMAGEN` FROM `pelicula` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Pelicula();\n\t\t\t$obj->hydrate($row);\n\t\t\tPeliculaPeer::addInstanceToPool($obj, (string) $key);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function findPk($key, $con = null)\n {\n if ($key === null) {\n return null;\n }\n if ((null !== ($obj = BitacoraAccesoPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n // the object is alredy in the instance pool\n return $obj;\n }\n if ($con === null) {\n $con = Propel::getConnection(BitacoraAccesoPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n }\n $this->basePreSelect($con);\n if ($this->formatter || $this->modelAlias || $this->with || $this->select\n || $this->selectColumns || $this->asColumns || $this->selectModifiers\n || $this->map || $this->having || $this->joins) {\n return $this->findPkComplex($key, $con);\n } else {\n return $this->findPkSimple($key, $con);\n }\n }", "function yy_r142(){ $this->_retvalue = 'primaryKey'; }", "public function find ($key);", "public function record($pk) {\n\n $key = \"_db_:{$this->tableName}:{$pk}\";\n\n $redis = $this->redisServiceRead->get();\n $data = $redis->get($key);\n\n // since false is potentially a valid result being stored in redis, we must check if the key exists\n if ($data === false && ! $redis->exists($key)) {\n //$exception = '\\\\Neoform\\\\' . $self::ENTITY_NAME . '\\\\Exception';\n //throw new $exception('That ' . $self::NAME . ' doesn\\'t exist');\n } else {\n return $data;\n }\n }" ]
[ "0.7450549", "0.7424338", "0.73082805", "0.7199152", "0.7137089", "0.71271104", "0.7049163", "0.7024663", "0.6871166", "0.68028116", "0.6798518", "0.66740185", "0.65853846", "0.65789634", "0.655751", "0.65279734", "0.6527083", "0.6502732", "0.6487509", "0.64787346", "0.64787346", "0.6477555", "0.64727664", "0.64571327", "0.6455828", "0.6445559", "0.6439237", "0.6389162", "0.63853383", "0.63788813", "0.63788813", "0.63788813", "0.637638", "0.63324016", "0.6315213", "0.6268804", "0.6266405", "0.62540185", "0.6245302", "0.62258804", "0.6214354", "0.62074965", "0.6183874", "0.6172816", "0.616389", "0.6157938", "0.6152137", "0.6152137", "0.6152137", "0.6142781", "0.6136904", "0.6135735", "0.6132917", "0.61256343", "0.6109887", "0.60908675", "0.6087904", "0.60793704", "0.6072456", "0.6068275", "0.60589164", "0.60413665", "0.6040561", "0.6038748", "0.6008948", "0.60076106", "0.6001953", "0.5999027", "0.5996948", "0.5996948", "0.5993295", "0.5982798", "0.5980815", "0.5974785", "0.59592617", "0.5940482", "0.59288603", "0.5913338", "0.59081525", "0.5907834", "0.59024644", "0.58928174", "0.58899015", "0.5889271", "0.5888938", "0.58875895", "0.5881852", "0.58770794", "0.58699864", "0.5866638", "0.58598787", "0.58594674", "0.5850965", "0.5845349", "0.58442986", "0.58434993", "0.58418506", "0.5839111", "0.5838545", "0.5832752" ]
0.67697483
11
Find the first record matching the conditions.
public function find_by($query, $params = array()) { return $this->where($query, $params)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_first($conditions = array(), $model = FALSE)\n {\n $results = $this->object->select()->where_and($conditions)->limit(1, 0)->run_query();\n if ($results) {\n return $model ? $this->object->convert_to_model($results[0]) : $results[0];\n } else {\n return NULL;\n }\n }", "public function firstMatch(array $conditions);", "static function first() {\n list($record) = self::collection(null, \"id LIMIT 1\");\n return isset($record) ? $record : null;\n }", "public static function findOne($condition);", "public function findFirst() {\r\n\t\t$aux = $this->fetchAllPg(1);\r\n\t\tif($aux == null)\r\n\t\t\treturn null;\r\n\t\treturn $aux[0];\r\n\t}", "public function findFirst();", "public function findOne()\r\n {\r\n $records = $this->find(1);\r\n \r\n return isset($records[0]) ? $records[0] : null;\r\n }", "public abstract function findFirst(): Optional;", "function get_one_by( $conds = array()) {\n\n\t\t// where clause\n\t\t$this->custom_conds( $conds );\n\n\t\t// query the record\n\t\t$query = $this->db->get( $this->table_name );\n\n\t\tif ( $query->num_rows() == 1 ) {\n\t\t// if there is one row, return the record\n\t\t\treturn $query->row();\n\t\t} else {\n\t\t// if there is no row or more than one, return the empty object\n\t\t\t return $this->get_empty_object( $this->table_name );\n\t\t\t\n\t\t}\n\n\t}", "public function first(){\n $this->execute();\n if(count($this->results) > 0){\n return current($this->results);\n } else {\n return null;\n }\n }", "public function whereFirst($where)\n {\n $where = LambdaUtils::toConditionCallable($where);\n foreach($this as $record)\n {\n if(call_user_func($where, $record))\n {\n return $record;\n }\n }\n throw new \\OutOfBoundsException();\n }", "public static function findOne($condition) {\n $table = static::$table;\n $one = Base::getInstance()->query(\"SELECT * FROM {$table} WHERE {$condition} LIMIT 1\");\n if ($one !== false) {\n return $one->fetchObject();\n } \n return false;\n }", "public function findFirst($parameters = null)\n {\n $this->ensureIsConfigured();\n $classname = $this->getRecordClassname();\n return $classname::findFirst($parameters);\n }", "public function first(){\n return $this->find(1);\n }", "public function findOne(array $conditions);", "public function first() {\n\n\t\treturn $this->search[0];\n\n\t}", "public static function findFirst($parameters=null) {}", "public function first()\n {\n foreach ($this->lists as $list) {\n foreach ($list as $record) {\n return $record;\n }\n }\n return null;\n }", "public function findFirstWhere(string $column, string $operator, $value): ?Model;", "public function getFirst($where, $params)\r {\r $params['limit'] = 1;\r $post = $this->getCollection($where, $params);\r return (!empty($post[0])) ? $post[0] : false;\r }", "public function first(array $conditions = array(), array $orderBy = array())\n\t{\n\t\t$query = $this->select()->where($conditions)->orderBy($orderBy)->limit(1);\n\t\t$rows = $this->query($query->sql(), $query->getParameters());\n\t\tif($rows) {\n\t\t\treturn $rows->first();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function findFirst($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\t$obj = $statement->fetchObject($this->resultClass, array($this));\n\t\treturn $obj;\n\t}", "public function findFirst($req){\n\t\treturn current($this->find($req));\n\t}", "public function whereFirstOrDefault($where, $default=null)\n {\n $where = LambdaUtils::toConditionCallable($where);\n foreach($this as $record)\n {\n if(call_user_func($where, $record))\n {\n return $record;\n }\n }\n return $default;\n }", "public static function findOne($condition)\n {\n return static::find()->one($condition);\n }", "public static function first($condition, $proyection = null){\n $result = self::where($condition, $proyection);\n return count($result) > 0 ? $result[0] : null;\n }", "public function first() {\n\t\treturn $this->execute()->first();\n\t}", "public function first()\n {\n return $this->retrieveOrCreateQueryInstance()->firstOrFail();\n }", "function getFirstRecord() {\n mysql_data_seek( $this->recordSet, 0 );\n return mysql_fetch_array( $this->recordSet ); }", "public static function findFirst($params = array())\n {\n $params['limit'] = 1;\n $results = static::find($params);\n\n return (!empty($results)) ? array_shift($results) : null;\n }", "public static function findFirst($parameters = null);", "public function firstOrFail();", "public static function findOne($filter = NULL){\n \n $results = self::find($filter, 1);\n if(!empty($results)){\n return $results[0];\n }\n \n return NULL;\n }", "private function findRecord()\n {\n /** If the request is a read record request, we need to do this so eager loading occurs. */\n if ($this->jsonApiRequest->isReadResource()) {\n return $this->store->readRecord(\n $this->jsonApiRequest->getResourceType(),\n $this->jsonApiRequest->getResourceId(),\n $this->jsonApiRequest->getParameters()\n );\n }\n\n return $this->store->find($this->jsonApiRequest->getResourceIdentifier());\n }", "public function findOne() {\n $this->buildSql();\n $rows = $this->db->findOne($this->sql);\n return $rows;\n }", "public function firstWhere(array $conditions, array $columns = ['*'])\n {\n return $this->withCriteria([\n new FindWhere($conditions)\n ])->first($columns);\n }", "public function findOne($params = array()) {\n\n\t\t$datas = $this->find($params);\n\n\t\tif ($datas){\n\t\t\treturn $datas[0];\n\t\t}\n\t\treturn FALSE;\n\t}", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "function findOne(\n\t\t$criteria=NULL,$order=NULL,$limit=NULL,$offset=NULL,$ttl=0) {\n\t\tlist($result)=\n\t\t\t$this->find($criteria,$order,$limit,$offset,$ttl)?:array(NULL);\n\t\treturn $result;\n\t}", "public static function findFirst($parameters = null){\n\t\treturn parent::findFirst($parameters);\n\t}", "public function first(string $cql, array $extraParams = []): ?Record\n {\n $recs = new Records($cql, $this, 1, $extraParams);\n return $recs->numberOfRecords() ? $recs->current() : null;\n }", "public function first()\n {\n $result = $this->limit(1)->get();\n\n return $result[0] ?? null;\n }", "public function findOne(string $conditions, FindOptions $options = new FindOptions()): Result\n {\n $data = $this->repository->find(conditions: $conditions, options: $options);\n $data = array_slice(array: $data, offset: 0, length: 1);\n return new Result(data: $data);\n }", "public function findOne(array $where);", "public static function findFirst($parameters=null)\n\t{\n\t\t$key = null;\n\t\tif (isset($parameters[0]) && isset($parameters['bind'])) {\n\t\t\t$key = $parameters[0] . '-' . join('-', $parameters['bind']);\n\t\t} else {\n\t\t\tif (isset($parameters['conditions']) && isset($parameters['bind'])) {\n\t\t\t\t$key = $parameters['conditions'] . '-' . join('-', $parameters['bind']);\n\t\t\t}\n\t\t}\n\t\tif ($key) {\n\t\t\t$key = preg_replace('/[^0-9A-Za-z]/', '-', get_called_class(). '-' . $key);\n\t\t\t$parameters['cache'] = array('key' => $key);\n\t\t}\n\t\treturn parent::findFirst($parameters);\n\t}", "public function findOneBy(array $conditions, array $orderBy = null, array $extras = array());", "public function searchOne(array $cond = array())\n {\n $options = array(\n 'count' => 1,\n 'offset' => 0\n );\n\n $result = $this->search($cond, $options);\n\n if ($result['total'] != 1) {\n throw new NotFoundException($result['total'] . ' matching items found');\n }\n\n return $result->getFirstResult();\n }", "public function findOneBy($conditions = array(), $hydration = self::ML_HYDRATION_MODEL){\n\n $conditions['limit'] = 1;\n\n $res = $this->findBy($conditions, $hydration);\n return $res ? current($res) : null;\n\n }", "public static function findOne($params=''){\n\t\t$activeModel = EntityManager::getEntityInstance(get_called_class());\n\t\t$arguments = func_get_args();\n\t\treturn call_user_func_array(array($activeModel, 'findFirst'), $arguments);\n\t}", "public function first()\n {\n if($this->_results) {\n return $this->_results[0];\n }\n return null;\n }", "final public function first()\n {\n $queryBuilder = $this->createQueryBuilder();\n $queryBuilder->selectAll();\n $queryBuilder->limit(1);\n\n return $this->fetchOne($queryBuilder);\n }", "public function first(){\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function first($select='*', $condition = null){\r\n\t\treturn $this->mask()->getOne($select, $condition, get_class($this));\r\n\t}", "public function findFirstByKey($key);", "public function findFirst()\n {\n }", "public function first()\n\t{\n\t\treturn $this->find()->first();\n\t}", "public function first() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_shift( $result );\n\t}", "public function first(){\n $where_clause = $this->getWhereClause();\n\n $this->sql = \"SELECT * FROM \".$this->table.\" \".$where_clause. $this->order_by;\n\n $result = mysqli_query($this->connection,$this->sql);\n if(mysqli_num_rows($result) > 0){\n return mysqli_fetch_array($result);\n }\n return false;\n\n // $new = array_map(function($param1,$parm1){\n // return\n // },$arr1,$arr2);\n\n\n }", "public static function findFirst($parameters = null) {\n return parent::findFirst($parameters);\n }", "public static function findOne($condition)\n {\n $object = Server::$container->make(get_called_class(), [get_called_class()]);\n $conn = self::getMongoReadConn($object);\n $collection = $conn->selectCollection($object->getDBName(), $object->getCollectionName());\n if (isset($condition[\"_id\"])) {\n if (!is_object($condition[\"_id\"])) {\n $condition[\"_id\"] = new ObjectID($condition[\"_id\"]);\n }\n }\n // var_dump($conn);\n $res = $collection->findOne($condition);\n // var_dump($res);\n return $object;\n }", "public function first()\n {\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function selectFirst()\n {\n return $this->pdoConnection->query('SELECT * FROM ' . $this->table . ' LIMIT 1 ', \\PDO::FETCH_CLASS, $this->className)->fetch();\n }", "function getOne($_sTable, $_mWhere = NULL, $_bConnectWhereArrayWithOrInsteadOfAnd = FALSE) {\n $aTemp = get($_sTable, $_mWhere, $_bConnectWhereArrayWithOrInsteadOfAnd);\n return count($aTemp) > 0 ? $aTemp[0] : NULL;\n}", "public function first()\n {\n if (!$this->_result) {\n $this->limit(1);\n }\n\n return $this->all()->first();\n }", "public function first()\n {\n return $this->execute(\n $this->syntax->selectSyntax(get_object_vars($this->order($this->key, 'ASC')->limit(1)))\n );\n }", "public function find($condition)\n {\n if(!is_array($condition))\n {\n $condition = array($this->getKeyField() => $condition);\n }\n $model = $this->getStorage()->fetchRow($condition);\n if(!$model->isLoaded())\n {\n return null;\n }\n return $model;\n }", "public static function findFirst($parameters = null)\r\n {\r\n return parent::findFirst($parameters);\r\n }", "public static function findFirst($parameters = null)\r\n {\r\n return parent::findFirst($parameters);\r\n }", "public static function findFirst($parameters = null)\r\n {\r\n return parent::findFirst($parameters);\r\n }", "public function getFirst()\n {\n if (is_array($this->rows)) {\n $rows = &$this->rows;\n } else {\n $query = clone $this->query;\n $query->setLimit(1);\n $rows = $query->getResult();\n }\n\n return (isset($rows[0])) ? $rows[0] : null;\n }", "protected function first() {\n if (!$this->query_failed) {\n return $this->results[0] ?? null;\n }\n\n return false;\n }", "public static function findOneBy($params)\n {\n try {\n $query = self::filterParams($params);\n $execute = self::executeQuery($query,$params);\n $result = self::fetchQuery($execute);\n return !empty($result) ? $result[0] : null;\n } catch (\\Throwable $th) {\n print_r($th->getMessage());\n return null;\n }\n }", "public function firstMatch(callable $predicate)\n {\n return $this->filter($predicate)->first();\n }", "public function first(){\n\n //using the above (results) method here\n return $this->results()[0]; //depends on the version of your PHP server\n //return $this->results[0];\n }", "public static function first()\n\t{\n\t\treturn self::new_instance_records()->first();\n\t}", "public function first()\n {\n return $this->results()[0];\n }", "function SearchFirst ( $cFieldExp )\n{\n return $this->Search_Data($this->_SQL_Where_(),$cFieldExp);\n}", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }", "public static function findFirst($parameters = null)\n {\n return parent::findFirst($parameters);\n }" ]
[ "0.7451213", "0.73143", "0.71938497", "0.71010774", "0.7098501", "0.70960367", "0.6982616", "0.6969017", "0.684617", "0.68454236", "0.68443286", "0.6727923", "0.67079586", "0.6688023", "0.6682702", "0.66726476", "0.6651132", "0.6647842", "0.66245604", "0.6621945", "0.6621229", "0.65727806", "0.6570919", "0.65682966", "0.655969", "0.655413", "0.6554124", "0.65532506", "0.6549443", "0.6531566", "0.6520921", "0.6511676", "0.6500501", "0.64652514", "0.64578754", "0.6424342", "0.641962", "0.6383677", "0.6383677", "0.6383677", "0.6383677", "0.6383677", "0.6383677", "0.6383677", "0.6383677", "0.63806313", "0.636706", "0.63574845", "0.6343488", "0.63410777", "0.6333184", "0.6314032", "0.6263621", "0.6259932", "0.6258499", "0.62555814", "0.6255106", "0.6250064", "0.6240291", "0.62368613", "0.6233324", "0.62318665", "0.61921275", "0.61872065", "0.61865056", "0.61689705", "0.6168108", "0.6167453", "0.6165887", "0.616442", "0.6156419", "0.6152952", "0.614274", "0.61368716", "0.61368716", "0.61368716", "0.6135991", "0.6132233", "0.6105884", "0.61047643", "0.6104557", "0.6099161", "0.609879", "0.6075716", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907", "0.6072907" ]
0.0
-1
Alias of "limit" and run the query.
public function first($limit = 1) { $rs = $this->limit($limit); if ($limit == 1) { $this->type = 'select_one'; } return $this->execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function limit($limit);", "public function limit($limit);", "public static function limit($limit);", "public function limit(?int $limit): self;", "public function limit($limit)\n {\n }", "protected function limit(int $limit){\n $this->query .= \"LIMIT \" . $limit . \" \";\n }", "public function limit($limit) {\r\n\t\t$this->query .= \" LIMIT \" . $limit;\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $this;\r\n\t}", "public function limit($limit, $offset = null);", "public function limit(int $limit, int $offset);", "public function limit($limit)\n {\n return $this->query->limit($limit);\n }", "public function limit($limit,$offset);", "public function limit(?int $limit = null) : int;", "public function setQueryLimit($limit) {\n\t\t$this->queryLimit = (integer) $limit;\n\t}", "function q_limit($query, $limit, $off=0)\n{\n\treturn $query .' LIMIT '. $limit .' OFFSET '. $off;\n}", "public function limit($limit)\r\n {\r\n $this->query->limit($limit);\r\n \r\n return $this;\r\n }", "public static function setQueryLimit($limit){\t\t\n\t\t//reset the queryCount\n\t\tself::$queryCount = 0;\n\t\t\n\t\tself::$queryLimit = $limit;\n }", "public function set_limit($limit);", "public function setLimit(int $limit): self;", "public function limit($limit)\n\t{\n\t\t$this->limit = (int) $limit;\n\t}", "public function setLimit($limit) {\n\t$this->parseQuery->setLimit($limit);\n }", "public function limit($limit) {\r\n $this->sqlLimit = $limit;\r\n return $this;\r\n }", "protected function setLimit() {\r\n if( $this->sqlLimit ) {\r\n $this->sql .= ' LIMIT ' . $this->sqlLimit;\r\n }\r\n }", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function limit($limit)\n\t{\n\t\t$this->query->limit = $limit;\n\t\treturn $this;\n\t}", "public function getLimit() {}", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->limit=$row->answersperpage;\n }", "public function limit($limit)\t{\n\t\t$this->limit = array(\"LIMIT $limit\");\n\t\treturn $this;\n\t}", "public function limit($limit)\n {\n return $this->set_limit($limit);\n }", "function allWithLimit() {\n\n }", "private function _limit($numRows) \n\t{\n\t\t$this->_query .= \" LIMIT \" . ( int ) $numRows;\n\t}", "function limit($limit, $offset = 0)\n{\n\t$this->tryModify();\n\t$this->query['limit'] = array((int)$limit, (int)$offset);\n\treturn $this;\n}", "public function get_limit();", "public function limit($limit = 10) {\n $this->limit = $limit;\n return $this;\n }", "public function take($limit = 20);", "public function limit($limit) {\n $this->limit = (int) $limit;\n return $this;\n }", "public function limit($count, $offset);", "function getLimit() ;", "public function limit($offset, $max = null);", "public function setLimit($x) { $this->limit = $x; }", "public function limit($limit)\r\n {\r\n $this->limit = $limit;\r\n return $this;\r\n }", "public function setLimit($limit) {\n\t\t$this->limit = $limit;\n\t}", "public function limit($limit = \"\"){\n\t\t\tif(is_numeric($limit)){\n\t\t\t\t$this->limit = \" LIMIT :limit\";\n\t\t\t\t$this->addParam(\"limit\", $limit);\n\t\t\t}else{\n\t\t\t\t$this->limit = false;\n\t\t\t\tunset($this->parameters[\"limit\"]);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "function selectLimit ($limit, $offset=null)\n {\n return \" LIMIT {$limit}\".($offset? \" OFFSET {$offset}\": null);\n }", "public function setLimit($limit)\n {\n $this->limit = $limit;\n }", "protected function compileLimit(Builder $query, $limit)\n {\n return 'LIMIT '.(int) $limit;\n }", "public function limit($limit) {\n\t\t\t$this->builder->limit($limit);\n\t\t\treturn $this;\n\t\t}", "public function setLimit($value)\n {\n return $this->setParameter('limit', $value);\n }", "public function limit($limit){\n $self = $this;\n $fnApply = static function($values) use ($self, $limit) {\n return $self->apply($values)->limit($limit);\n };\n return new FnSequence($fnApply);\n }", "public function limit($limit)\n {\n $this->limit = $limit;\n return $this;\n }", "public function setLimit($limit) {\n $this->limit = $limit;\n return $this;\n }", "public function limit($limit)\n {\n return self::from(Iterables::limit($this, $limit));\n }", "public function testLimit()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->limit(10));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(10, $elasticQuery['size']);\n\n $this->assertSame($query, $query->limit(20));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(20, $elasticQuery['size']);\n }", "public function limit($limit)\n {\n $this->limit = (int) $limit;\n return $this;\n }", "public function getLimit(): int\n {\n return $this->getQueryPageSize();\n }", "public function setLimit($limit) {\n $this->limit = (int)$limit;\n }", "function limit($count) {\n\t\t$this->appendStmt('limit', \"LIMIT ?\", [$count]);\n\t\treturn $this;\n\t}", "public function dbLimit($limit) {\r\n $this->limit = $limit;\r\n return $this;\r\n }", "protected function compileLimit(Builder $query, int $limit)\n {\n return 'limit ' . (int)$limit;\n }", "public function get( $limit = 10 );", "public function limit($limit, $offset=null)\n\t{\n\t\t\t\t\t$this->_query['limit']=(int)$limit;\n\t\t\t\t\tif($offset!==null)\n\t\t\t\t\t\t\t\t\t$this->offset($offset);\n\t\t\t\t\treturn $this;\n\t}", "public function setLimit($limit)\r\n {\r\n $this->limit = intval($limit);\r\n }", "public function limit( $value )\n {\n if( is_numeric( $value ))\n $this->query('limit', $value);\n }", "public function limit(?int $limit): static\n\t{\n\t\t$this->limit = $limit;\n\t\treturn $this;\n\t}", "public function limit($limit = null)\n {\n if(null === $limit)\n {\n return $this->property('limit');\n }\n return $this->property('limit', (int) $limit);\n }", "public function limit($limit = null)\n {\n if(null === $limit)\n {\n return $this->property('limit');\n }\n return $this->property('limit', (int) $limit);\n }", "public function limit($limit)\n {\n $this->_parts['limit'] = $limit;\n\n return $this;\n }", "private function sql_limit()\n {\n // Get LIMIT statement\n $limit = null;\n\n // RETURN LIMIT statement\n return $limit;\n }", "public function sqlQuery($sqlQuery, $limit = PHP_INT_MAX, $offset = 0);", "function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) \r\n\t {\r\n\t $offsetStr = ($offset >= 0) ? \" OFFSET $offset\" : '';\r\n\t $limitStr = ($nrows >= 0) ? \" LIMIT $nrows\" : '';\r\n\t return $secs2cache ?\r\n\t $this->CacheExecute($secs2cache,$sql.\"$limitStr$offsetStr\",$inputarr,$arg3)\r\n\t :\r\n\t $this->Execute($sql.\"$limitStr$offsetStr\",$inputarr,$arg3);\r\n\t }", "public function limit(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'limit'), func_get_args());\r\n\t\treturn $this;\r\n }", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->questionsPerPage=$row->questionsperpage;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function limit( int $limit )\n {\n $this->limit = $limit;\n return $this;\n }", "public function setLimit($limit)\n {\n //argument 1 must be a string\n Argument::i()->test(1, 'int');\n $this->query['limit'] = $limit;\n \n return $this;\n }", "public function Limit($limit, $offset = 0) {\r\n $this->limit = (int)$limit;\r\n $this->offset = (int)$offset;\r\n }", "public function limit( $limit )\n\t{\n\t\tif ( $limit > 500 ) {\n\t\t\t$limit = 500;\n\t\t}\n\n\t\t$this->parameters['limit'] = $limit;\n\n\t\treturn $this;\n\t}", "public function apply_limit($query, $offset = 0, $limit = 0) {\n\n\t\t\t\n\t\t\t$high_where = '';\n\t\t\t$lower_where = 0;\n if($offset>0 || $limit>0) {\n $high_where = '\"_RN\" <= '.($offset+$limit).' AND ';\n $lower_where = $offset+1;\n }\n $sql = sprintf('SELECT * FROM (SELECT ROWNUM AS \"_RN\", \"_SUB\".* FROM (%s) \"_SUB\") WHERE %s \"_RN\" >= %d',$query, $high_where, $lower_where);\n\t\t\t\n\t\t\treturn $sql;\n\t\t}", "public function limit($limit)\r\n\t{\r\n\t\t$this->model = $this->model->take($limit);\r\n\t\treturn $this;\r\n\t}", "public function set_item_limit($limit = 0)\n {\n }", "public function getLimit() {\n return $this->limit;\n }", "function index_limit($limit, $start = 0) {\n $this->db->order_by($this->id, $this->order);\n $this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }", "function index_limit($limit, $start = 0) {\n $this->db->order_by($this->id, $this->order);\n $this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }", "public function limit($limit)\n {\n if ( $this->driver->type == 'sqlite' ) {\n // throw new Exception('sqlite does not support limit syntax');\n }\n $this->limit = $limit;\n return $this;\n }", "public function limit($limit = null) {\n if ($limit === null) {\n return $this->limit;\n }\n\n $this->limit = (int) $limit;\n\n return $this;\n }", "public function limit($limit)\n {\n $this->limit = (int) $limit;\n\n return $this;\n }", "public function testLimit()\n {\n $obj_query = new \\Search\\Query();\n $this->assertEquals(20, $obj_query->getLimit());\n $obj_query->limit(121);\n $this->assertEquals(121, $obj_query->getLimit());\n $obj_query->limit(-10);\n $this->assertEquals(1, $obj_query->getLimit());\n $obj_query2 = $obj_query->limit(2001);\n $this->assertEquals(1000, $obj_query->getLimit());\n $this->assertSame($obj_query, $obj_query2);\n }", "public function setLimit($var)\n {\n GPBUtil::checkInt32($var);\n $this->limit = $var;\n\n return $this;\n }", "public function setLimit($limit)\n\t{\n\t\t$this->limit = $limit;\n\t\treturn $this;\n\t}", "public function limit( $limit ) {\n\t\t$this->isDirty( true );\n\t\t$this->_limit = $limit;\n\t\treturn $this;\n\t}", "public function getLimit ()\r\n\t{\r\n\t\treturn $this->limit;\r\n\t}", "public function setLimit(int $limit): void\n {\n $this->limit = $limit;\n }", "abstract public function _limit($str, $limit, $offset = false);", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }" ]
[ "0.8140079", "0.8140079", "0.8060663", "0.7872499", "0.78295594", "0.77625316", "0.7613327", "0.7587184", "0.75628823", "0.7556572", "0.75544584", "0.75023776", "0.7398617", "0.7369828", "0.73447543", "0.7344483", "0.72850186", "0.7278947", "0.72545457", "0.72394246", "0.72280806", "0.7224571", "0.7207479", "0.7207479", "0.7207479", "0.7207479", "0.7207479", "0.7173559", "0.71229744", "0.7104031", "0.71002907", "0.70274717", "0.7016644", "0.70087737", "0.7005859", "0.69970727", "0.69938713", "0.69642615", "0.6954299", "0.6908406", "0.6868624", "0.68667376", "0.68647945", "0.6861676", "0.68545455", "0.68365866", "0.68359655", "0.6808487", "0.67784566", "0.6775992", "0.6759978", "0.672254", "0.6714309", "0.67070043", "0.669172", "0.66648775", "0.66629136", "0.6656203", "0.6648003", "0.6633269", "0.66280186", "0.6621953", "0.6606558", "0.66048247", "0.6604797", "0.66024905", "0.66019124", "0.65953976", "0.65953976", "0.6591907", "0.65907335", "0.65887433", "0.65768474", "0.6570294", "0.65618867", "0.65580416", "0.65580416", "0.65564036", "0.65473837", "0.6546203", "0.6530943", "0.6518804", "0.6514849", "0.6506492", "0.65058875", "0.650141", "0.650141", "0.6501317", "0.64976627", "0.6497393", "0.64952564", "0.6493409", "0.64846826", "0.6481108", "0.6470895", "0.6465636", "0.6463601", "0.6452632", "0.6452632", "0.6452632", "0.6452632" ]
0.0
-1
Get a value of first record.
public function value($column) { $rs = (array) $this->first(); return $rs[$column]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function firstValue()\n\t{\n\t\treturn $this->first()->value;\n\t}", "public function first() {\n\t\treturn $this->valueForKey($this->firstKey());\n\t}", "public function first()\n {\n return $this->getData(0);\n }", "static function first() {\n list($record) = self::collection(null, \"id LIMIT 1\");\n return isset($record) ? $record : null;\n }", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "public function getFirst()\n {\n $this->update();\n if (isset($this->data[0])) {\n return $this->updateValueIfNeeded($this->data, 0);\n }\n return null;\n }", "public function first() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function first()\n {\n return $this->results()[0];\n }", "public function first() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_shift( $result );\n\t}", "public function first(){\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function first()\n {\n return $this->results()[0];\n }", "public function First()\n {\n return $this->Results()[0];\n }", "function getFirstRecord() {\n mysql_data_seek( $this->recordSet, 0 );\n return mysql_fetch_array( $this->recordSet ); }", "public function first()\n {\n return \\count($this->data) > 0 ? $this->data[0] : null;\n }", "public function first()\n {\n $result = $this->limit(1)->get();\n\n return $result[0] ?? null;\n }", "public function first()\n {\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function getFirst()\n\t{\t\treturn $this->first;\n\t}", "public function getFirst()\n\t{\n\t\treturn $this->first;\n\t}", "public function getFirst()\n {\n return $this->first;\n }", "public function getFirst()\n {\n return $this->first;\n }", "function first()\n\t{\n\t\treturn array_values($this->_data)[0];\n\t}", "public function first(){\n\n //using the above (results) method here\n return $this->results()[0]; //depends on the version of your PHP server\n //return $this->results[0];\n }", "public function first(){\n $this->execute();\n if(count($this->results) > 0){\n return current($this->results);\n } else {\n return null;\n }\n }", "public function getFirst()\n {\n if (is_array($this->rows)) {\n $rows = &$this->rows;\n } else {\n $query = clone $this->query;\n $query->setLimit(1);\n $rows = $query->getResult();\n }\n\n return (isset($rows[0])) ? $rows[0] : null;\n }", "protected function getOne()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetch($statement);\n }", "public function findFirst() {\r\n\t\t$aux = $this->fetchAllPg(1);\r\n\t\tif($aux == null)\r\n\t\t\treturn null;\r\n\t\treturn $aux[0];\r\n\t}", "public function first(): mixed\n {\n return array_first($this->data);\n }", "public function first()\n {\n $collection = $this->get();\n return count($collection) ? $collection[0] : null;\n }", "public function findOne()\r\n {\r\n $records = $this->find(1);\r\n \r\n return isset($records[0]) ? $records[0] : null;\r\n }", "public function first()\n {\n if($this->_results) {\n return $this->_results[0];\n }\n return null;\n }", "public function first()\n {\n return current($this->_data);\n }", "public function first(){\n return $this->find(1);\n }", "function GetFirstValue( $spr, $lang_id = NULL )\n {\n if (!$lang_id) $lang_id = $this->lang_id;\n $DB_tmp = DBs::getInstance();\n\n $q = \"SELECT * FROM `\".$spr.\"` WHERE `lang_id`='\".$lang_id.\"' ORDER BY `move` asc LIMIT 1\";\n $res = $DB_tmp->db_Query($q);\n //echo '<br>$q='.$q.' $res='.$res.' $DB_tmp->result='.$DB_tmp->result;\n if ( !$res OR !$DB_tmp->result ) return false;\n //$rows = $DB_tmp->db_GetNumRows();\n $row = $DB_tmp->db_FetchAssoc();\n return $row;\n }", "public function fetchOne() {\r\n\t\t$data = $this->fetch();\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $data ? current($data) : null;\r\n\t}", "public function current(): Record\n {\n return $this->data[0];\n }", "public function first()\n {\n return $this->values()->shift();\n }", "public function first() {\n\t\treturn $this->execute()->first();\n\t}", "public function first() {\n\n\t\treturn $this->search[0];\n\n\t}", "public function first() {\n if (sizeof($this) < 1) return null;\n $keys = array_keys($this);\n return $this[$keys[0]];\n }", "public function getFirst()\n {\n return 1;\n }", "public function first() {\n\t\treturn $this->items[0];\n\t}", "public function readone(){\r\t\t\t$query=\"select * from `\".$this->tablename.\"` where `id`='\".$this->id.\"'\";\r\t\t\t$result=mysqli_query($this->conn,$query);\r\t\t\t$value=mysqli_fetch_row($result);\r\t\t\treturn $value;\r\t\t}", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function getValue(BasicRecord $record = null);", "public function first()\n {\n foreach ($this->lists as $list) {\n foreach ($list as $record) {\n return $record;\n }\n }\n return null;\n }", "public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }", "public function first(): mixed;", "public function first(): mixed;", "public function getValue()\n {\n $result = $this->getResult();\n if (is_array($result) && (count($result) > 0)) {\n return $result[0];\n }\n if ($result instanceof \\Iterator) {\n list($key,$value) = each($result);\n $result->rewind();\n return $value;\n }\n return null;\n }", "public function fetch_one()\n {\n if (!$this->limit) $this->limit(1);\n $rows = $this->fetch_all();\n return count($rows) ? array_shift($rows): null;\n }", "public function first() {\n return $this->nth( 0 );\n }", "public function getFirst();", "function first ()\n {\n return $this->A ? $this->A[0] : null;\n }", "public function first()\n {\n return $this->take(1)->get()->first();\n }", "protected function value()\n {\n return $this->row($this->row);\n }", "function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }", "final public function first()\n {\n $queryBuilder = $this->createQueryBuilder();\n $queryBuilder->selectAll();\n $queryBuilder->limit(1);\n\n return $this->fetchOne($queryBuilder);\n }", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "public function first()\n\t{\n\t\treturn parent::first();\n\t}", "protected function _getPrimaryKeyValue(){\n $primaryKey = $this->_getPrimaryKey();\n return $this->{$primaryKey};\n }", "public function getFirstResult();", "public function getFirstResult();", "public function first()\n {\n return (count($this->list) > 0 ?\n $this->list[0] : null\n );\n }", "public function getOne()\n\t{\n\t\tif ($this->count() > 0)\n\t\t{\n\t\t\t$this->seek(0);\n\t\t\treturn $this->current();\n\t\t} else\n\t\t\treturn null;\n\t}", "public function single()\n\t{\n\t\t$this->execute();\n\t\treturn $this->stm->fetch(PDO::FETCH_OBJ);\n\t}", "public function getFirst() {}", "final public function first()\n {\n $items = $this->all();\n if (count($items) === 0) {\n return null;\n }\n return reset($items);\n }", "public function get_row() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->get_rows();\n\t\t}\n\t\t$value = current($this->rows);\n\t\tnext($this->rows);\n\t\treturn $value;\n\t}", "public function get_first_instance($fields, $rows) {\n\n if (empty($rows)) {\n return NULL;\n }\n\n foreach ($rows[0]['#rows'] as $row) {\n $entity = $row['#row']->_entity;\n\n foreach ($fields as $field) {\n if ($entity->hasField($field)) {\n $value = $entity->get($field)->getValue();\n\n if (!empty($value)) {\n return $value;\n }\n }\n }\n }\n return NULL;\n }", "public function first()\n {\n if (!$this->_result) {\n $this->limit(1);\n }\n\n return $this->all()->first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }", "public function first()\n {\n return parent::first();\n }" ]
[ "0.8075541", "0.7760785", "0.7529531", "0.7517378", "0.7494759", "0.7451672", "0.744958", "0.74476665", "0.74277395", "0.7407278", "0.737354", "0.7348386", "0.73371583", "0.73328894", "0.7316069", "0.73034793", "0.72727734", "0.72480655", "0.7223766", "0.7223766", "0.71984303", "0.7189285", "0.7181503", "0.715538", "0.7150813", "0.71149224", "0.7044271", "0.70439845", "0.7032256", "0.7020041", "0.699987", "0.6994531", "0.69749546", "0.6957881", "0.6902632", "0.6895838", "0.6894836", "0.68935716", "0.6875527", "0.6874197", "0.68447787", "0.6830845", "0.6821955", "0.6821955", "0.6821955", "0.6821955", "0.6821955", "0.6821955", "0.6821955", "0.6821955", "0.67980164", "0.67925185", "0.6765991", "0.6760786", "0.6760786", "0.6755172", "0.6752179", "0.67261887", "0.6723824", "0.6692808", "0.66683155", "0.666197", "0.66235226", "0.6613537", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6610529", "0.6586617", "0.65860546", "0.65860546", "0.6585614", "0.6581911", "0.65730494", "0.65694326", "0.6546253", "0.6542688", "0.653863", "0.6534391", "0.65342754", "0.65342754", "0.65342754", "0.65342754", "0.65342754" ]
0.0
-1
Get a values array
public function pluck($column, $key = null, $collapse = false) { $columns = ($key == null) ? array($column) : array($column, $key); if (!$this->columns) { $this->select($columns); } $rs = $this->execute(); $column = $this->column_basename($column); $key = $this->column_basename($key) ?: $key; return array_pluck($rs, $column, $key, $collapse); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValues(): array;", "public function getValues(): array;", "public function values() : array;", "abstract public static function getValues(): array;", "abstract public function values(): array;", "public function getValues();", "public function getValues() {}", "public function getValues() {}", "public function getValues() : array\n {\n return $this->values;\n }", "function getValues(){\n $values = [];\n \n foreach($this as $valor){\n $values[] = $valor;\n }\n \n return $values;\n }", "public function getValues(): array\n {\n return $this->values;\n }", "public function getArray () {\n\n return $this->values;\n\n }", "public function getValues()\n\t{\n\t\t$params = array();\n\n\t\tforeach($this->values as $value)\n\t\t{\n\t\t\tswitch($value[self::TYPE])\n\t\t\t{\n\t\t\t\tcase self::TYPE_RAW:\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::TYPE_IN:\n\n\t\t\t\t\t$params+= $value[self::VALUE];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::TYPE_SCALAR:\n\t\t\t\tdefault:\n\n\t\t\t\t\t$params[] = $value[self::VALUE];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}", "public function getValues(): array\n {\n return array_map(function ($model) {\n return $model->value;\n }, $this->values);\n }", "public function values(): array\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->getVal('value', []);\n }", "public function getValues(): array\n {\n $enumeration = $this->enumeration;\n $values = [];\n foreach ($this->getOrdinals() as $ord) {\n $values[] = $enumeration::byOrdinal($ord)->getValue();\n }\n return $values;\n }", "public function getValues(): array\n {\n return $this->getEntityDao()->getValues();\n }", "public static function getValues(): array\n {\n return array_values(self::getConstants());\n }", "public function toArray()\n\t{\n\t\treturn $this->values;\n\t}", "public function toArray()\n\t{\n\t\treturn $this->values;\n\t}", "public function getValues()\n {\n $values = array();\n\n foreach ($this->items as $item) {\n $values[] = $item['value'];\n }\n\n return $values;\n }", "public function getValues () {\n\n return array_values($this->values);\n\n }", "public function getAsArray();", "public function values();", "public function values();", "public function values();", "public function values();", "public function values();", "public function getResult():array {\n\n # Return value\n return $this->values;\n\n }", "public function getValues()\n {\n return array_values($this->data);\n }", "public static function getValues()\n {\n return array_values(self::getConstants());\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function toArray(): array\n {\n return $this->values;\n }", "public function getValues()\n\t\t{\n\t\t\treturn $this->values;\n\t\t}", "public function getValuesArray()\n {\n return $this->keyValues;\n }", "public function toArray()\n {\n return $this->values;\n }", "public function toArray()\n {\n return $this->values;\n }", "public function getValuesList() {\n return $this->_get(2);\n }", "public function values() {\n\t\treturn array_values($this->_value);\n\t}", "protected function _getValues()\n {\n $values = $this->getColumn()->getValues();\n return $this->_converter->toFlatArray($values);\n }", "public function getAsArray(): array\n {\n return \\GuzzleHttp\\json_decode(\\GuzzleHttp\\json_encode($this->values), true);\n }", "public function values() : array\n {\n return array_values($this->entries);\n }", "public function getValues() {\n return $this->values;\n }", "public function getValues() {\n return $this->values;\n }", "public function getValues()\n\t{\n\t\treturn $this->_values;\n\t}", "public function getValuesList() {\n return $this->_get(3);\n }", "abstract public function values(): Seq;", "public function get_values() {\n\t\t$values = [];\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$values[$field->name] = $field->get_value();\n\t\t}\n\n\t\treturn $values;\n\t}", "public function getValuesList(){\n return $this->_get(1);\n }", "public function getValues()\n {\n return $this->_values;\n }", "public function get_values(){ return $this->values; }", "protected function getValueAsArray()\n {\n if(strpos($this->value, '|') > 1){\n $values = array_filter(explode(\"|\", $this->value));\n } else {\n $values = [$this->value];\n }\n return $values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function toArray ( )\n {\n return (array) $this->_values;\n }", "final public function getValues()\n {\n return $this->values;\n }", "abstract public function getArray();", "public function values(): array\n\t{\n\t\treturn $this->fields()->values()->all();\n\t}", "public function Values()\n {\n return $this->values;\n }", "public function values() {\n\t\treturn array_values($this->toArray());\n\t}", "public function values(): array\n {\n return array_values($this->storage);\n }", "public function getValue(): array {\n\t\t\treturn $this->value;\n\t\t}", "public function get() : array;", "public function values()\n {\n return array_values($this->_data);\n }", "public static function get_values()\n {\n }", "public static function get_values()\n {\n }", "public static function get_values()\n {\n }", "function getArray();", "public function getAllValues();", "public function getValues()\n {\n $values = array();\n \n foreach ($this->_fields as $name => $info) {\n $values[$name] = (isset($info['value'])) ? $info['value'] : null;\n }\n \n return $values;\n }", "public function getValues()\n {\n\n\t\t$record = ProductAttributeValues::whereIn('avid',[1,6])->get();\n\t\t$rec = $record->pluck('pro_att_value');\n\t\treturn $rec;\n }", "public function toArray(): array\n {\n $array = [];\n\n for ($i = 1; $i <= $this->size; $i++) {\n $array[] = $this->elements[$i]['value'];\n }\n\n return $array;\n }", "function getValues()\n {\n return $this->type->getValues();\n }", "public function get(): array;", "public function get(): array;", "public function getToArrayValues()\r\n\t\t{\r\n\t\t\t$obj = \t$this->getObject();\r\n\t\t\t$arrayValues = array();\r\n\t\t\tforeach ($obj as $key => $value) {\r\n\t\t\t\t$arrayValues[\":\".strtoupper($key)] = $value;\r\n\t\t\t}\r\n\t\t\treturn $arrayValues;\r\n\t\t}", "public function getData(): array\n\t{\n\t\treturn $this->valueMap;\n\t}", "protected function _getValues()\n {\n return [\n $this->_getOrderId(),\n $this->_getTotal(),\n $this->_getItemsNames(),\n $this->_getSuccessUrl(),\n $this->_getErrorUrl(),\n $this->_getPaymentReportUrl()\n ];\n }", "public static function values()\n {\n return self::$values;\n }", "public function all(): array\n {\n return $this->values;\n }", "public static function getRequiredValues():array {\n\n # Declare result\n $result = [];\n\n # Return result\n return $result;\n\n }", "public function values(): array\n {\n return array_values($this->items);\n }", "function getDataValues(){\n\t\t$this->getData();\n\t\treturn $this->_dataValues;\n\t}", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "public function getValues()\n {\n if ($this->_values === null) {\n $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : [];\n }\n return $this->_values;\n }", "public function getValues()\n\t{\n\t\t$returnValue = NULL;\n\n\t\treturn $returnValue;\n\t}", "final public function values($is=null):array\n {\n return Base\\Arrs::values($this->arr(),$is);\n }", "private function to_array() {\n\t\t$values = array(\n\t\t\t'id' => $this -> id,\n\t\t\t'name' => $this -> name);\n\t\treturn $values;\n\t}", "public function getArrValores()\n {\n return $this->arrValores;\n }", "public function getValues()\n {\n return array_values($this->elements);\n }", "function getArray() {\n\treturn array('Red', 'Green', 'Blue');\n}", "public function getValues(): array\n {\n $values = [];\n foreach ($this->getInputNames() as $name) {\n $values[$name] = $this->$name;\n }\n return $values;\n }", "function get(){\n $array = array();\n foreach($this as $atributo => $valor){\n $array[$atributo] = $valor;\n }\n return $array;\n }", "public function getRowsAsArray(){\n $fieldNames=$this->getFieldNames();\n $result=[];\n if (!empty($this->valuesRows)){\n foreach($this->valuesRows as $valuesRow){\n $rowArr=[];\n foreach($fieldNames as $i=>$fieldName){\n if (isset($valuesRow[$i])){\n $rowArr[$fieldName]=$valuesRow[$i];\n }\n }\n $result[]=$rowArr;\n }\n }\n return $result;\n }", "public function values() {\n return array_merge(\n array(null),\n $this->primitives(),\n $this->arrays(),\n $this->maps(),\n $this->objects()\n );\n }" ]
[ "0.866853", "0.866853", "0.83870417", "0.8340277", "0.82807076", "0.8213727", "0.7998088", "0.7998088", "0.794177", "0.79040074", "0.7890805", "0.7875188", "0.7841011", "0.7724716", "0.7717584", "0.7684909", "0.76653", "0.76602954", "0.76154643", "0.7597775", "0.7597775", "0.7538412", "0.7526899", "0.7465824", "0.74539626", "0.74539626", "0.74539626", "0.74539626", "0.74539626", "0.74363273", "0.7422062", "0.7411559", "0.7405798", "0.7405798", "0.7405798", "0.7405798", "0.7401527", "0.7398529", "0.739093", "0.73891366", "0.73891366", "0.73859423", "0.73499495", "0.7330358", "0.73096734", "0.7281078", "0.7276519", "0.7276519", "0.72763085", "0.72693944", "0.72671443", "0.72668415", "0.7265104", "0.7244009", "0.72330624", "0.7231418", "0.72257584", "0.72257584", "0.72257584", "0.72257584", "0.72168726", "0.7211924", "0.7198853", "0.7168557", "0.71301955", "0.7106563", "0.70699954", "0.7069869", "0.7055758", "0.7051325", "0.7040281", "0.7040281", "0.7040281", "0.7020972", "0.7020512", "0.70052516", "0.7004108", "0.6996582", "0.6995967", "0.6993546", "0.6993546", "0.6951901", "0.69489044", "0.6932701", "0.69149196", "0.6888746", "0.68850535", "0.6871584", "0.68643486", "0.6863912", "0.6840903", "0.68379676", "0.6824407", "0.6810244", "0.6792663", "0.67892885", "0.67627144", "0.6756865", "0.6751066", "0.6751046", "0.6742293" ]
0.0
-1
HELPERS Get SQL statement into string
public function to_sql() { if ($this->sql == null) { $this->sql = $this->builder->{$this->type}($this); } return $this->sql; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchSqlString();", "public function sql(){\n $str = \"\";\n foreach($this->params as $key => $val){\n if($val != false){\n $str .= \"$key $val \";\n }\n }\n return $str;\n }", "public function getSQL();", "abstract protected function buildSQL(): string;", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "abstract protected function _getSQL(): String;", "abstract function getSQL();", "function to_str() {\n //\n //Test if this sql has an elias \n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n //\n //the update statement \n $smt=\"\"\n //This is an update statement \n .\"UPDATE \\n\"\n //\n //Get the root from expression as the source table of this update \n //statement \n . \"{$this->root->fromexp()} \\n\"\n . \"SET \\n\"\n //\n //get the values as key values pairs \n .\"{$this->str_values()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\"\n //\n //include an ellias if any \n .\"$alias\";\n //\n //Return the sql statement\n return $smt;\n }", "public function toSql()\n {\n if (0 === count($this->getParams())) {\n return 'SELECT *';\n } else {\n return 'SELECT ' . implode(', ', $this->getParams());\n }\n }", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "public function sql(): string\n {\n $columnsNames = array();\n $columnsValues = array();\n\n foreach ($this->parameters as $key => $val) {\n $arg = $this->getArgName($key);\n $columnsNames[] = $this->escape($key); \n $columnsValues[] = ':' . $arg;\n } \n return trim(sprintf(\n 'INSERT INTO %s (%s) VALUES (%s)',\n $this->escape($this->tableName),\n implode(', ', $columnsNames),\n implode(', ', $columnsValues)\n ));\n }", "public function fetchSqlString()\n\t{\n\t\treturn $this->cur_query;\n\t}", "public function sql(): string;", "protected function sqlToString()\n {\n return implode(' ', $this->query);\n }", "public function getSQL(): string\n {\n return $this->getQuery()->getSQL();\n }", "public function getSql() : string {\n return $this->sql;\n }", "public function getSql();", "public function getSql();", "public function GetSQL()\n\t{\n\t\treturn db_get_select_sql($this->fields, $this->tables, $this->groupby, $this->filters, $this->sortfields, $this->limit);\n\t}", "public function getSQL(): string\n {\n if ($this->query === null) {\n throw new Exception('Query wasn\\'t set');\n }\n\n if (is_object($this->query)) {\n if (method_exists($this->query, '__toString')) {\n return $this->query->__toString();\n }\n } else {\n return trim($this->query);\n }\n\n $className = get_class($this->query);\n throw new Exception(\"Can not use class={$className} as database query because it can't be used as string\");\n }", "public function getSQL()\n {\n if ($this->_sql !== null && $this->_state === self::STATE_CLEAN) {\n return $this->_sql;\n }\n\n $sql = '';\n\n switch ($this->_type) {\n case self::DELETE:\n $sql = $this->getSQLForDelete();\n break;\n\n case self::UPDATE:\n $sql = $this->getSQLForUpdate();\n break;\n\n case self::SELECT:\n default:\n $sql = $this->getSQLForSelect();\n break;\n }\n\n $this->_state = self::STATE_CLEAN;\n $this->_sql = $sql;\n\n return $sql;\n }", "public function getSQL() {\n return $this->_connection->processQuery($this, true);\n }", "function str()\n\t{\n return\n \"SELECT $this->select\" .\n \" FROM $this->from \" .\n \" WHERE $this->where \" .\n ($this->group_by ? \" GROUP BY $this->group_by\": '') .\n ($this->having ? \" HAVING $this->having\" : '') .\n ($this->order_by ? \" ORDER BY $this->order_by\": '') .\n ($this->limit ? \" LIMIT $this->limit\": '');\t\t\t\n }", "public function to_str() {\n //\n //Construct the sql (select) statement\n $stmt = \n \"select \\n\"\n //\n //Field selection \n . \"{$this->fields->to_str()} \\n\"\n . \"from \\n\"\n //\n //For now the root is simply the name of a table or a bracketed \n //enclose sql \n . \"{$this->root->fromexp()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //The where clause, if necessary \n .\"{$this->wheres->to_str()}\";\n return $stmt;\n \n }", "public function formatQuery($sql) {\r\n\t\t//regex work with a lookahead to avoid splitting things inside single quotes\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(WHERE|FROM|GROUP BY|HAVING|ORDER BY|LIMIT|OFFSET|UNION|DUPLICATE KEY)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n$0\", $sql\r\n\t\t);\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(INNER|LEFT|RIGHT|CASE|WHEN|END|ELSE|AND)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n $0\", $sql);\r\n\t\treturn $sql;\r\n\t}", "protected abstract function getSqlStatement();", "protected function buildSQL(): string\n {\n $sql = 'INSERT' . PHP_EOL;\n\n $sql .= $this->buildTable();\n $sql .= $this->buildFields();\n $this->buildBindings();\n $sql .= $this->buildValues();\n $sql .= $this->buildValuesFromSelect();\n $sql .= $this->buildReturning();\n\n\n return $sql;\n }", "static function custom_get_sql() {\n # this is the default functionality\n $table = static::get_tablename();\n return \"select * from $table\";\n }", "function get_sql(){\r\n\r\n\t\treturn $this->get_sql_select().$this->get_sql_where().$this->get_sql_order().$this->get_sql_limit();\r\n\r\n\t}", "final protected function getSQL()\n {\n return $this->sql;\n }", "public function get_sql()\n\t{\n\t\treturn $this->sql;\n\t}", "public function prettySql() {\n\t\t$sql = $this->sql();\n\t\t$sql = preg_replace(\"#([\\w_\\(\\)]+)([ \\t]+)([\\w_\\(\\)]+)#s\", \"$1 $3\", $sql);\n\t\t$sql = str_replace(\" \", \" \", $sql);\n\t\treturn $sql;\n\t}", "public function get_sql() {\n return $this->sql;\n }", "public function get_sql()\n {\n }", "protected function toBaseSQL() {\r\n\t\t$sql=' FROM '.$this->resolveTable();\r\n\r\n\t\t$sql.=$this->buildJoinClause();\r\n\t\t$sql.=$this->buildWhereClause();\r\n\r\n\t\t$sql.=$this->buildGroupClause();\r\n\r\n\t\treturn $sql;\r\n\t}", "public function getQuery(){\n $sql = \"select %s from %s %s %s %s %s %s\";\n\n return sprintf($sql, $this->param, $this->table,\n empty($this->join) ? '' : implode($this->join),\n empty($this->where) ? '' : 'where '. $this->where,\n empty($this->having)? '' : 'having '. $this->having,\n empty($this->order) ? '' : 'order by '. $this->order,\n empty($this->setOperations) ? '' : implode($this->setOperations)\n );\n }", "protected function getAdditionalSql()\n\t{\n\n\t\t$parts = [];\n\n\t\tif($this->isNullable()){\n\t\t\t$parts[] = 'NOT NULL';\n\t\t}\n\n\t\tif(!is_null($this->getDefault())){\n\t\t\t$default = $this->getDefault();\n\t\t\tif(is_int($this->getDefault())){\n\t\t\t\t$parts[] = sprintf('DEFAULT %d', $default);\n\t\t\t}else{\n\t\t\t\t$parts[] = sprintf(\"DEFAULT '%s'\", $default);\n\t\t\t}\n\n\t\t}\n\n\t\tif($this->isUnique()){\n\t\t\t$parts[] = sprintf('UNIQUE');\n\t\t}\n\n\t\tif($this->isPrimary()){\n\t\t\t$parts[] = 'AUTO_INCREMENT';\n\t\t}\n\n\t\treturn implode(' ', $parts);\n\t}", "public function getSQL() {\n\t\t$o = $this->obj;\n\t\t$sql = \"SELECT\";\n\t\tif ($this->distinct) {\n\t\t\t$sql .= \" DISTINCT\";\n\t\t}\n\t\t$s = $this->getSelects();\n\t\tif ($s == \"\") {\n\t\t\t$sql .= \" \".$this->getTable().\".*\";\n\t\t} else {\n\t\t\t$sql .= \" \".$s;\n\t\t}\n\t\t$sql .= \" FROM \".$this->getFrom();\n\t\t$sql .= $this->getJoins();\n\t\t$where = $this->getFilters()->getSQL();\n\t\tif ($where != \"\") {\n\t\t\t$sql .= \" WHERE \".$where;\n\t\t}\n\n\n\n\t\tif ($this->group !== false) {\n\t\t\tif ($this->group[1] == false) {\n\t\t\t\t$sql .= \" GROUP BY \".$this->getTable().\".`\".$this->db->escape_string($this->group[0]).\"`\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" GROUP BY \".$this->group[0];\n\t\t\t}\n\t\t}\n\t\t//if ($this->filter) {\n\t\t//\t$sql .= \" WHERE \".$this->filter->getSQL();\n\t\t//}\n\t\tif (count($this->order) > 0) {\n\t\t\tif ($this->order[0][0] === false) {\n\t\t\t\t$sql .= \" ORDER BY RAND()\";\n\t\t\t} elseif (isset($this->order[0][0])) {\n\t\t\t\t$sql .= \" ORDER BY \";\n\t\t\t\tforeach ($this->order as $cols) {\n\t\t\t\t\t$sql .= \"`\".$this->db->escape_string($cols[0]).\"`\";\n\t\t\t\t\tif ($this->orderAsc) {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= \", \";\n\t\t\t\t}\n\t\t\t\t$sql = substr($sql, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->start !== false) {\n\t\t\t$sql .= \" LIMIT {$this->start}\";\n\t\t\tif ($this->end !== false) {\n\t\t\t\t$sql .= \",{$this->end}\";\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "public function getSql()\n {\n return $this->sql;\n }", "function _getSQL(){\n\t\tif ( !isset($this->sql) ){\n\t\t\t$compiler =& $this->_getCompiler();\n\t\t\t$this->sql = $compiler->compile($this->sql_data);\n\t\t}\n\t\treturn $this->sql;\n\t}", "function getSQL() {\n\t\treturn $this->sql;\n\t}", "public function getQuerySql() {\n $sql = parent::getQuerySql();\n $connection = $this->model->getMeta()->getConnection();\n\n return $this->parseVariablesIntoSql($sql, $connection);\n }", "public function getSql() { \n return $this->sql;\n }", "public function getSQL(){\n $sqlString = \"select \";\n $campos = $this->getCampos();\n //var_dump($campos);\n if (is_array($campos) && empty($campos)) {\n $sqlString .= \" * \";\n } else {\n $campos = \"\";\n foreach ($this->getCampos() as $key => $value) {\n if (!$campos == \"\") { \n $campos.=\" ,\"; \n };\n $campos.=\" \".$value.\" as \".$key.\" \";\n }\n $sqlString .= $campos;\n }\n $sqlString .= \" from \" . $this->getTabla();\n if ( $this->getSQLFilter() != \"\" ) {\n $sqlString .= \" where \" . $this->getSQLFilter();\n }\n \n $sqlString .= $this->getSQLGroupBy();\n $sqlString .= $this->getSQLOrderBy();\n //echo $sqlString.\"\\n\";\n return $sqlString; \n }", "function to_str() {\n $smt=\"INSERT \\n\"\n //\n //Get the root of the sql \n . \"INTO {$this->root->fromexp()}\\n\"\n //The values\n . \"{$this->str_values()}\\n\"\n //\n //The joins if any because some insert may have sqls as their root\n .\"{$this->joins->to_str()}\" \n \n \n ;\n //\n //Return the sql statement that inserts \n return $smt;\n }", "public function buildSqlString()\n {\n $param = array();\n\n $join = '';\n $filter = '';\n $order = '';\n $limit = '';\n\n // Create the fieldprefix. If given as alias use this, otherwise we use the tablename\n $field_prefifx = !empty($this->alias) ? $this->alias : '{db_prefix}' . $this->tbl;\n\n // Biuld joins\n if (!empty($this->join))\n {\n $tmp = array();\n\n foreach ( $this->join as $def )\n $tmp[] = ' ' . $def['by'] . ' JOIN ' . '{db_prefix}' . (isset($def['as']) ? $def['tbl'] . ' AS ' . $def['as'] : $def['join']) . ' ON (' . $def['cond'] . ')';\n }\n\n $join = isset($tmp) ? implode(' ', $tmp) : '';\n\n // Create fieldlist\n if (!empty($this->fields))\n {\n // Add `` to some field names as reaction to those stupid developers who chose systemnames as fieldnames\n foreach ( $this->fields as $key_field => $field )\n {\n if (in_array($field, array('date', 'time')))\n $field = '`' . $field . '`';\n\n // Extend fieldname either by table alias or name when no dot as alias/table indicator is found.\n #if (strpos($field, '.') === false)\n # $field .= (!empty($this->alias) ? $this->alias : $this->tbl) . '.' . $field;\n\n $this->fields[$key_field] = $field;\n }\n\n $fieldlist = implode(', ', $this->fields);\n } else\n {\n $fieldlist = '*';\n }\n\n // Create filterstatement\n $filter = !empty($this->filter) ? ' WHERE ' . $this->filter : null;\n\n // Create group by statement\n $group_by = !empty($this->group_by) ? ' GROUP BY ' . $this->group_by : null;\n\n // Create having statement\n $having = !empty($this->having) ? ' HAVING ' . $this->having : null;\n\n // Create order statement\n $order = !empty($this->order) ? ' ORDER BY ' . $this->order : null;\n\n // Create limit statement\n if (!empty($this->limit))\n {\n $limit = ' LIMIT ';\n\n if (isset($this->limit['lower']))\n $limit .= $this->limit['lower'];\n\n if (isset($this->limit['lower']) && isset($this->limit['upper']))\n $limit .= ',' . $this->limit['upper'];\n }\n\n // We need a string for the table. if there is an alias, we have to set it\n $tbl = !empty($this->alias) ? $this->tbl . ' AS ' . $this->alias : $this->tbl;\n\n // Is this an distinct query?\n $distinct = $this->distinct ? 'DISTINCT ' : '';\n\n // Create sql statement by joining all parts from above\n $this->sql = 'SELECT ' . $distinct . $fieldlist . ' FROM {db_prefix}' . $tbl . $join . $filter . $group_by . $having . $order . $limit;\n\n return $this->sql;\n }", "function getSelectSql()\n {\n $str = \"SELECT * FROM \";\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }", "public function sql () {\n\n return $this->_sql;\n }", "function get_sql_select(){\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false)\r\n\t\t\t$select_str=substr($this->sql_query,0,stripos($this->sql_query,' WHERE '));\r\n\t\telse\r\n\t\t\t$select_str=$this->sql_query;\r\n\r\n\t\treturn $select_str;\r\n\r\n\t}", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "public function formatSql($sql)\n {\n // Replace disturbing selected fields by an *\n $sql = preg_replace('/SELECT (.*) FROM/', 'SELECT <span style=\"display: none;\" class=\"select\">$1</span> FROM', $sql);\n\n // Add colors\n $sql = preg_replace('/\\b(SELECT|LIMIT|ASC|COUNT|DESC|IN|LIKE|DISTINCT)\\b/', '<span class=\"sfWebDebugLogInfo\">\\\\1</span>', $sql);\n\n // Add colors and line breaks\n $sql = preg_replace('/\\b(UPDATE|SET|FROM|WHERE|LEFT JOIN|INNER JOIN|RIGHT JOIN|ORDER BY|GROUP BY|DELETE|INSERT|INTO|VALUES)\\b/', '<br/><span class=\"sfWebDebugLogInfo\">\\\\1</span>', $sql);\n \n return $sql;\n }", "public function getSql() {\n\t\t$val = $this->myQuery;\n\t\t$this->myQuery = array();\n\t\treturn $val;\n\t}", "public function __toString()\n {\n $query = '';\n\n switch ($this->type) {\n case 'insert':\n $query .= (string) $this->insert;\n\n // Set method\n if ($this->set) {\n $query .= (string) $this->set;\n }\n // Columns-Values method\n elseif ($this->values) {\n if ($this->columns) {\n $query .= (string) $this->columns;\n }\n\n $elements = $this->insert->getElements();\n $tableName = array_shift($elements);\n\n $query .= 'VALUES ';\n $query .= (string) $this->values;\n\n if ($this->autoIncrementField) {\n $query = 'SET IDENTITY_INSERT ' . $tableName . ' ON;' . $query . 'SET IDENTITY_INSERT ' . $tableName . ' OFF;';\n }\n\n if ($this->where) {\n $query .= (string) $this->where;\n }\n }\n\n break;\n\n default:\n $query = parent::__toString();\n break;\n }\n\n return $query;\n }", "public function get_sql() {\n\t\treturn $this->SQL1;\n\t}", "public function buildSqlexp()\n {\n return $this->formatLine($this->_buildSqlExp());\n }", "public function __toString(){\n\t\t$output = '';\n\t\tforeach ($this->_queries as $query){\n\t\t\tif (isset($query['sql'])){\n\t\t\t\t$output .= $query['sql'] . PHP_EOL . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "protected function buildSql() {\r\n if( !$this->sql ) {\r\n $this->sql = $this->sqlAction;\r\n if( count($this->sqlFields) === 0 ) {\r\n $this->sqlFields[] = '*';\r\n }\r\n $this->sqlStrTables = join(', ', $this->sqlTables);\r\n $this->sqlStrFields = join(', ', $this->sqlFields);\r\n $this->sqlStrConditions = join(' ', $this->sqlConditions);\r\n switch ($this->sqlAction) {\r\n case 'SELECT': $this->buildSelectSql();\r\n break;\r\n case 'UPDATE': $this->buildUpdateSql();\r\n break;\r\n case 'INSERT': $this->buildInsertSql();\r\n break;\r\n case 'DELETE': $this->buildDeleteSql();\r\n break;\r\n }\r\n }\r\n }", "function to_str(){\n //\n $op1 = $this->operand1->to_str();\n $op2 = $this->operand2->to_str();\n \n //return a valid where clause\n return \"$op1 $this->operator $op2\";\n }", "final public function generateSQL()\n {\n return implode(self::STATEMENTS_DELIMITER, array_map(function ($part) {\n return current($part);\n }, $this->generateOrderedSQLParts()));\n }", "private function getSql(\\PDOStatement $stmt, array $parameters)\n {\n return sprintf('%s %s', $stmt->queryString, json_encode(array_values($parameters)));\n }", "protected function formatSql($sql)\n {\n return trim(preg_replace(\"/\\s*\\n\\s*/\", \"\\n\", $sql));\n }", "function to_str() {\n return \n //\n //For now we are deleting everything in that record\n \"DELETE {$this->str_values()}\"\n //\n //Get the from expression of the root\n . \"FROM {$this->root->fromexp()}\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\";\n }", "public function toString()\n {\n return \"is equivalent to the SQL query \". \\PHPUnit_Util_Type::toString($this->sql);\n }", "public function getSql()\n\t{\n\t\t$sql = '';\n\t\tforeach ($this->_scripts as $script) {\n\t\t\t$sql .= $script->getSql();\n\t\t}\n\t\treturn $sql;\n\t}", "public function __toString() {\n\t\treturn $this->sql;\n\t}", "public function toSql()\n {\n if ($this->isEmpty()) {\n return '';\n }\n\n $params = $this->getParams();\n\n $sql = array('SET');\n $set = array();\n\n foreach ($params as $column => $value) {\n $set[] = implode(' = ', array(\n $column, $this->getBuilder()->getHelper()->toDbValue($value)\n ));\n }\n\n $sql[] = implode(', ', $set);\n\n return implode(' ', $sql);\n }", "function SQLFormat ($query)\r{\r\t$lowercase = array ('select ', ' max', ' min', ' count', ' avg', ' sum',\r\t\t\t\t\t\t'from ', ' as ',\r\t\t\t\t\t\t'join ', \"left \\nJOIN \", \"right \\nJOIN \", \"inner \\nJOIN \", \"outer \\nJOIN \", ' on ',\r\t\t\t\t\t\t'where ', ' like ', ' and ', ' or ',\r\t\t\t\t\t\t'group by ',\r\t\t\t\t\t\t'order by ', ' asc', ' desc', 'ASC, ', 'DESC, ',\r\t\t\t\t\t\t'limit ',\r\t\t\t\t\t\t\"\\n\\n\");\r\t$uppercase = array ('SELECT ', ' MAX', ' MIN', ' COUNT', ' AVG', ' SUM',\r\t\t\t\t\t\t\"\\nFROM \", ' AS ',\r\t\t\t\t\t\t\"\\nJOIN \", \"\\nLEFT JOIN \", \"\\nRIGHT JOIN \", \"\\nINNER JOIN\", \"OUTER JOIN\", \"\\n\\tON \",\r\t\t\t\t\t\t\"\\nWHERE \", ' LIKE ', ' AND ', ' OR ',\r\t\t\t\t\t\t\"\\nGROUP BY \",\r\t\t\t\t\t\t\"\\nORDER BY\\n\\t\", ' ASC', ' DESC', \"ASC,\\n\\t\", \"DESC,\\n\\t\",\r\t\t\t\t\t\t\"\\nLIMIT \",\r\t\t\t\t\t\t\"\\n\");\r\r\treturn str_replace ($lowercase, $uppercase, $query);;\r}", "public function sql() {\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/select/query.twig.sql\");\n\t\treturn $sqlT->render([\"query\" => $this]);\n\t}", "public static function getOneSql()\n {\n return 'SELECT * FROM messages where id = :id';\n }", "public function __toString()\n {\n return $this->builder->getSql();\n }", "public final function getQueryDebug()\n {\n $sql = $this->buildSqlString();\n\n $out = '\n\t\t<div class=\"debug\">\n\t\t\t<h3>SQL</h3>\n\t\t\t<p>' . $sql . '</p>\n\t\t\t<h3>Params</h3>\n\t\t\t' . $this->debug($this->param) . '\n\t\t\t<h3>Full query</h3>\n\t\t\t' . $this->db->quote($sql, $this->param) . '\n\t\t</div>';\n\n return $out;\n }", "public function make_sql_string(){\n\t\t$argumentos=[];\n\t\tforeach($this->arguments as $arg){\n\t\t\tif($arg instanceof resolve_to_sql){\n\t\t\t\t$argumentos[]=$arg->make_sql_string();\n\t\t\t}else{\n\t\t\t\tif(is_object($arg)){\n\t\t\t\t\tthrow new \\Exception('Argumento erroneo ('.get_class($arg).') en el grupo al construir');\n\t\t\t\t}else{\n\t\t\t\t\tthrow new \\Exception(\"Argumento erroneo ($arg) en el grupo al construir\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn '('.implode($this->get_union(),$argumentos).')';\n\t}", "public function __toString()\n {\n return $this->sql;\n }", "public function __toString()\n {\n return $this->sql;\n }", "public function __toString(): string\n {\n return sprintf(\n 'SELECT %s FROM %s WHERE %s',\n implode(', ', $this->fields),\n implode(', ', $this->table),\n implode(', ', $this->condition)\n );\n }", "function compile_sql_query(string $sql, array $bindings = []): string\n {\n $string = function ($string) {\n return '\"'.str_replace('\\\\', '\\\\\\\\\\\\', (string) $string).'\"';\n };\n\n foreach ($bindings as $binding) {\n // TODO: need to review all cases.\n switch (gettype($binding)) {\n case 'boolean':\n case 'integer':\n $binding = (int) $binding;\n break;\n case 'float':\n case 'double':\n $binding = (double) $binding;\n break;\n case 'array':\n foreach ($binding as $key => $value) {\n $binding[$key] = $string($value);\n }\n $binding = implode(',', $binding);\n break;\n case 'NULL':\n break;\n case 'string':\n default:\n $binding = $string($binding);\n break;\n }\n $sql = preg_replace('/\\?/', $binding, $sql, 1);\n }\n\n return $sql;\n }", "public function getStatement()\n {\n $myStatement = \"\";\n if ((filter_var($this->ip, FILTER_VALIDATE_IP))) {\n $myStatement = $this->ip . \" är av typ \" . $this->getIpType() . \". Plats \" . $this->getLatitude() . \", \" . $this->getLongitude() . \" \" . $this->getCity() . \", \" .$this->getCountry();\n } else {\n $myStatement = $this->ip . \" är inte giltig och har ingen plats.\";\n }\n return $myStatement;\n }", "public function __toString()\n\t{\n\t\treturn $this->sql;\n\t}", "public function __toString()\n {\n return $this->getSQL();\n }", "public function getQuery(): string {\n\t\t// Store previous output before changing to temp\n\t\t$output = $this->get('output');\n\t\t\n\t\ttry {\n\t\t\t$this->set('output', SqlAdapter::SQL_QUERY);\n\t\t\t$result = $this->run();\n\t\t} finally {\n\t\t\t$this->set('output', $output);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "public function getStatement(): string\n {\n return $this->statement;\n }", "public function getStatement(): string\n {\n return $this->statement;\n }", "function mkSQL() {\n $n = func_num_args();\n if ($n < 1) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $i = 1;\n $SQL = \"\";\n $fmt = func_get_arg(0);\n while (strlen($fmt)) {\n $p = strpos($fmt, \"%\");\n if ($p === false) {\n $SQL .= $fmt;\n break;\n }\n $SQL .= substr($fmt, 0, $p);\n if (strlen($fmt) < $p+2) {\n Fatal::internalError('Bad mkSQL() format string.');\n }\n if ($fmt{$p+1} == '%') {\n $SQL .= \"%\";\n } else {\n if ($i >= $n) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $arg = func_get_arg($i++);\n switch ($fmt{$p+1}) {\n case '!':\n /* very dangerous, but sometimes very useful -- be careful */\n $SQL .= $arg;\n break;\n case 'B':\n if ($arg) {\n $SQL .= \"'Y'\";\n } else {\n $SQL .= \"'N'\";\n }\n break;\n case 'C':\n $a = array();\n foreach (explode('.', $arg) as $ident) {\n array_push($a, '`'.$this->_ident($ident).'`');\n }\n $SQL .= implode('.', $a);\n break;\n case 'I':\n $SQL .= '`'.$this->_ident($arg).'`';\n break;\n case 'i':\n $SQL .= $this->_ident($arg);\n break;\n case 'N':\n $SQL .= $this->_numstr($arg);\n break;\n case 'Q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n case 'q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n default:\n Fatal::internalError('Bad mkSQL() format string.');\n }\n }\n $fmt = substr($fmt, $p+2);\n }\n if ($i != $n) {\n Fatal::internalError('Too many arguments to mkSQL().');\n }\n return $SQL;\n }", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "protected function buildValuesFromSelect(): string\n {\n $sql = '';\n\n // Check for a SELECT statement and append if available\n if ( isset($this->select) )\n {\n $sql .= $this->indentStatement($this->select, 1);\n\n $this->mergeBindings($this->select);\n }\n\n return $sql;\n }", "function Sql_DBs_Get_Query()\n {\n $type=$this->DB_Dialect();\n\n $query=\"\";\n if ($type==\"mysql\")\n {\n $query=\n \"SHOW DATABASES\";\n }\n elseif ($type==\"pgsql\")\n {\n $query=\n \"SELECT datname FROM pg_database WHERE datistemplate = false;\";\n }\n\n return $query;\n }", "function to_str(){\n //\n //Get the name of the entity \n $ename= $this->entity->name;\n //\n //The type of the join eg inner join, outer join\n $join_str=\"$this->type\"\n //\n //The on clause\n . \"\\t `$ename` \\tON \\t{$this->get_ons()}\";\n return $join_str;\n }", "public function buildQuery() {\n\t\t// Build INSERT INTO table\n\t\t$queryString = [\n\t\t\t'INSERT INTO',\n\t\t\t$this->table,\n\t\t\t'(' . implode(', ', $this->columns) . ')', // Add column definition\n\t\t\t'VALUES'\n\t\t];\n\n\t\t// Add multiple value rows\n\t\t$values = [];\n\t\tforeach ($this->values as $valueRow) {\n\t\t\t$values[] = '(' . implode(', ', $valueRow) . ')';\n\t\t}\n\t\t$queryString[] = implode(',', $values);\n\n\t\tif ($this->ignoreConflictFields) {\n\t\t\t$conflictFields = implode(',', $this->ignoreConflictFields);\n\t\t\t$queryString[] = \"ON CONFLICT ($conflictFields) DO NOTHING\";\n\t\t}\n\n\t\treturn implode(' ', $queryString) . ';';\n\t}", "public function toAql(): string\n {\n $query = $this->query;\n\n foreach ($this->queryParameters as $parameter) {\n if (!$this->container->has($parameter)) {\n throw new StatementException(\"Parameter ($parameter) was not defined for this statement\");\n }\n\n $query = str_replace($parameter, $this->output($parameter), $query);\n }\n\n return utf8_encode($query);\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "public function toSQL()\n {\n $sql = '`' . $this->fieldName . '` ' . $this->getOperator() . ' ' . $this->getSearchValue();\n if (null != $this->tableName) {\n $sql = '`' . $this->tableName . '`.' . $sql;\n }\n \n return $sql;\n }", "public function getStatement();", "public function getStatement();", "public function getStatement();", "public function __toString() {\n // to do it. This allows constructs like \"(string) $query\" to work. When\n // the query will be executed, it will be recompiled using the proper\n // placeholder generator anyway.\n if (!$this->compiled()) {\n $this->compile($this->connection, $this);\n }\n\n // Create a sanitized comment string to prepend to the query.\n $comments = $this->connection->makeComment($this->comments);\n\n // SELECT\n $query = $comments . 'SELECT ';\n if ($this->distinct) {\n $query .= 'DISTINCT ';\n }\n\n // FIELDS and EXPRESSIONS\n $fields = array();\n foreach ($this->tables as $alias => $table) {\n if (!empty($table['all_fields'])) {\n $fields[] = $this->connection->escapeTable($alias) . '.*';\n }\n }\n foreach ($this->fields as $alias => $field) {\n // Always use the AS keyword for field aliases, as some\n // databases require it (e.g., PostgreSQL).\n $fields[] = (isset($field['table']) ? $this->connection->escapeTable($field['table']) . '.' : '') . $this->connection->escapeField($field['field']) . ' AS ' . $this->connection->escapeAlias($field['alias']);\n }\n foreach ($this->expressions as $alias => $expression) {\n $fields[] = $expression['expression'] . ' AS ' . $this->connection->escapeAlias($expression['alias']);\n }\n $query .= implode(', ', $fields);\n\n\n // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway.\n $query .= \"\\nFROM \";\n foreach ($this->tables as $alias => $table) {\n $query .= \"\\n\";\n if (isset($table['join type'])) {\n $query .= $table['join type'] . ' JOIN ';\n }\n\n // If the table is a subquery, compile it and integrate it into this query.\n if ($table['table'] instanceof SelectQueryInterface) {\n // Run preparation steps on this sub-query before converting to string.\n $subquery = $table['table'];\n $subquery->preExecute();\n $table_string = '(' . (string) $subquery . ')';\n }\n else {\n $table_string = '{' . $this->connection->escapeTable($table['table']) . '}';\n }\n\n // Don't use the AS keyword for table aliases, as some\n // databases don't support it (e.g., Oracle).\n $query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']);\n\n if (!empty($table['condition'])) {\n $query .= ' ON ' . $table['condition'];\n }\n }\n\n // WHERE\n if (count($this->where)) {\n // There is an implicit string cast on $this->condition.\n $query .= \"\\nWHERE \" . $this->where;\n }\n\n // GROUP BY\n if ($this->group) {\n $query .= \"\\nGROUP BY \" . implode(', ', $this->group);\n }\n\n // HAVING\n if (count($this->having)) {\n // There is an implicit string cast on $this->having.\n $query .= \"\\nHAVING \" . $this->having;\n }\n\n // ORDER BY\n if ($this->order) {\n $query .= \"\\nORDER BY \";\n $fields = array();\n foreach ($this->order as $field => $direction) {\n $fields[] = $field . ' ' . $direction;\n }\n $query .= implode(', ', $fields);\n }\n\n // RANGE\n // There is no universal SQL standard for handling range or limit clauses.\n // Fortunately, all core-supported databases use the same range syntax.\n // Databases that need a different syntax can override this method and\n // do whatever alternate logic they need to.\n if (!empty($this->range)) {\n if($this->range['start']) {\n $query .= \"\\nROWS \" . (int) $this->range['length'] . \" TO \" . (int) $this->range['start'] + (int) $this->range['length'];\n } else {\n $query .= \"\\nROWS \" . (int) $this->range['length']; \n }\n }\n\n // UNION is a little odd, as the select queries to combine are passed into\n // this query, but syntactically they all end up on the same level.\n if ($this->union) {\n foreach ($this->union as $union) {\n $query .= ' ' . $union['type'] . ' ' . (string) $union['query'];\n }\n }\n\n if ($this->forUpdate) {\n $query .= ' FOR UPDATE';\n }\n\n return $query;\n }", "function __toString(): string {\n return $this->getSQL(null);\n }", "public function getSql(){\n $val = $this->myQuery;\n $this->myQuery = array();\n return $val;\n }", "public function make_sql()\n\t{\n\t\ttry{\n\t\t\t$metot = $this->metot;\n\t\t\t$metot = strtolower($metot);\n\t\t\t\n\t\t\tif($metot == \"select\") /* Select için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif ((count($this->tables))== 1)\n\t\t\t\t{\n\t\t\t\t\tfor ($c=1;$c<=(count($this->tables[0])-1);$c++){\n\t\t\t\t\t$col .= $this->tables[0][$c].\", \";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr(\"$col\", 0, -1);\n\t\t\t\t\t$table = $this->tables[0][0]; \n\t\t\t\t\t/*\n\t\t\t\t\t\tvar_dump($col);\n\t\t\t\t\t\tvar_dump($table);\n\t\t\t\t\t\tstring 'id, adsoyad' (length=12)\n\t\t\t\t\t\tstring 'email' (length=5)\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tforeach ($this->tables AS $row){\n\t\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t\tfor($c=1; $c<=(count($row)-1);$c++){\n\t\t\t\t\t\t\t$var = trim($row[$c]);\n\t\t\t\t\t\t\t$col .= \"{$table}.{$var}, \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$table = $this->tables[0][0]; \n\t\t\t\t\t/*\n\t\t\t\t\t\tvar_dump($col);\n\t\t\t\t\t\tvar_dump($table);\n\t\t\t\t\t\tstring 'email.id, email.adsoyad, blog.id, blog.title' (length=44)\n\t\t\t\t\t\tstring 'email' (length=5)\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!is_null($this->join)){\n\t\t\t\t\tforeach($this->join AS $row) {$join .=\" $row \";}\n\t\t\t\t}\n\t\t\t\telse $join = \"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->order)) $order = $this->order;\n\t\t\t\telse $order =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->group)) $group = $this->group;\n\t\t\t\telse $group =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->limit)) $limit = $this->limit;\n\t\t\t\telse $limit =\"\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->sql = $this->metot.\" \". $col.\" FROM \".$table.\" \".$join.\" \".$where.\" \".$group.\" \".$order.\" \".$limit;\n\t\t\t\t/*var_dump($this->sql); string 'SELECT id, adsoyad FROM email WHERE email.id=35 ' (length=53)*/\n\t\t\t} /*if($metot == \"select\")*/\n\t\t\t\n\t\t\tif($metot == \"insert\") /* Insert için sql oluşturma*/\n\t\t\t{\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$col \t.= strstr($row[$c], \"=\", true).\", \";\n\t\t\t\t\t\t$colVal .= substr((strstr($row[$c], \"=\")), 1).\", \";\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$colVal = trim($colVal);\n\t\t\t\t\t$colVal = substr($colVal, 0, -1);\n\t\t\t\t\t\n\t\t\t\t\t$sql[] = \"INSERT INTO {$table} ($col) VALUES ($colVal) \";\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if($metot == \"insert\")*/\n\t\t\t\n\t\t\tif ($metot == \"update\") /* Update için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$col \t.= $row[$c].\", \";\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$sql[] = \"UPDATE {$table} SET {$col} {$where}\";\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if ($metot == \"update\")*/\n\t\t\t\n\t\t\tif ($metot == \"delete\") /* Delete için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t\t$col = \"\";\n\t\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$col \t.= strstr($row[$c], \"=\", true).\", \";\n\t\t\t\t\t\t\t$colVal .= substr((strstr($row[$c], \"=\")), 1).\", \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t\t$colVal = trim($colVal);\n\t\t\t\t\t\t$colVal = substr($colVal, 0, -1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql[] = \"DELETE FROM {$table} WHERE ($col) = ($colVal) \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if ($metot == \"delete\")*/\n\t\t\t\n\t\t\t$this->run();\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\techo \"Error : \".$e->getMessage() .\"<br/>\".\"File : \".$e->getFile() . \"<br/>\".\"Line : \".$e->getLine() . \"<br/>\";\n\t\t}\n\t}", "function getInsertSql()\n {\n $str1 = '';\n $str2 = '';\n $n = 0;\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (!in_array($k, $this->tblIndex) && $k != 'tblName' && $k != 'schema' && $k != 'tblIndex' && $k != 'exists' && isset($this->$k)) {\n if ($n++ > 0) {\n $str1 .= ',';\n $str2 .= ',';\n }\n\n\n $str1 .= $k . \" \";\n $str2 .= $this->prepareForQuery($this->$k) . \" \";\n\n\n }\n }\n $str = 'INSERT INTO ';\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n $str = $str . $this->tblName . ' ( ';\n $str .= $str1;\n $str .= ') VALUES (';\n $str .= $str2;\n $str .= ');';\n return $str;\n }" ]
[ "0.7877917", "0.75786775", "0.7524198", "0.7522786", "0.7492652", "0.74898386", "0.74400896", "0.74330056", "0.7409502", "0.7368995", "0.7352214", "0.7350472", "0.7348841", "0.73419106", "0.7336938", "0.72628784", "0.72617155", "0.724627", "0.724627", "0.72174025", "0.72071564", "0.7184404", "0.7153454", "0.7116174", "0.7112161", "0.71014047", "0.7074348", "0.7060327", "0.70536876", "0.70409024", "0.7006338", "0.7002463", "0.69633126", "0.6952105", "0.6949997", "0.6946087", "0.69413805", "0.69322485", "0.6923775", "0.6921497", "0.6908451", "0.6847816", "0.68413705", "0.6835334", "0.68223137", "0.68192446", "0.67842066", "0.6780116", "0.6752471", "0.67448395", "0.6734793", "0.6733283", "0.6731667", "0.6721258", "0.6709951", "0.67097455", "0.6708559", "0.6708408", "0.67031676", "0.67008805", "0.6693743", "0.66900605", "0.66810864", "0.66605985", "0.66511625", "0.6627288", "0.6625956", "0.6625581", "0.6607948", "0.66077024", "0.6595085", "0.6579651", "0.6558071", "0.65568507", "0.65568507", "0.655669", "0.6552361", "0.6551646", "0.65450794", "0.65403724", "0.6536727", "0.6532742", "0.6532627", "0.6532627", "0.6524269", "0.6518703", "0.6510359", "0.6506338", "0.65044576", "0.6504066", "0.64969695", "0.6477665", "0.6477176", "0.6473822", "0.6473822", "0.6473822", "0.64585143", "0.6455506", "0.64393276", "0.643002", "0.64260983" ]
0.0
-1
Get column names from table
public function get_column_names() { if (array_get(static::$tables, $this->from)) { return static::$tables[$this->from]['columns']; } $database = $this->db->get_connection()->get_database(); $table = $this->from; $query = new Query(); return $query->from('INFORMATION_SCHEMA.COLUMNS') ->where(array( 'table_schema' => $database, 'table_name' => $table )) ->pluck('column_name'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getColNames();", "public function getColumnNames();", "public function getColumnNames()\n {\n return array_keys($this->columns);\n }", "private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }", "function getColumns($table){\n $sql = 'SHOW COLUMNS FROM ' . $table;\n $names = array();\n $db = $this->prepare($sql);\n\n try {\n if($db->execute()){\n $raw_column_data = $db->fetchAll();\n\n foreach($raw_column_data as $outer_key => $array){\n foreach($array as $inner_key => $value){\n\n if ($inner_key === 'Field'){\n if (!(int)$inner_key){\n $names[] = $value;\n }\n }\n }\n }\n }\n return $names;\n } catch (Exception $e){\n return $e->getMessage(); //return exception\n }\n }", "public abstract function get_columns($table);", "public function getColumnsFromTable()\n {\n return Zend_Db_Table::getDefaultAdapter()->describeTable($this->_tableName);\n }", "public function getColumnNames(): array\r\n {\r\n return array_keys($this->columns);\r\n }", "public function getColumnNames()\r\n\t\t{\r\n\t\t\t$nameColumns = $this->getColumnsArray();\r\n\t\t\treturn implode(\",\", $nameColumns);//Retornando uma lista de colunas separadas por vígula\r\n\t\t}", "public function getColnames()\n {\n $res = [];\n foreach($this->columns as $colname => $col) $res[] = $colname;\n return $res;\n }", "public function get_columns($table){\n return $this->query(\"SHOW COLUMNS FROM {$table}\")->results();\n }", "public function getColumnNames($table)\r\n\t\t{\r\n\t\t\t$colNames = array();\r\n\t\t\t$schemaArray = array();\r\n\r\n\t\t\t//let the server prepare, execute and check for errors\r\n\t\t\t$this->_query = $this->_prepare(\"SELECT * FROM `{$this->_prefix}{$table}`\");\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\r\n\t\t\t$totalCols = $this->_query->columnCount();\r\n\t\t\tfor($n = 0; $n < $totalCols; $n++){\r\n\t\t\t\t$columnSchema = $this->_query->getColumnMeta($n);\r\n\t\t\t\t$colNames[] = $columnSchema['name'];\r\n\t\t\t}\r\n\t\t\t$this->close(false);\r\n\r\n\t\t\treturn $colNames;\r\n\t\t}", "protected function get_table_columns($table) {\n\n\t\t$conn_str = 'pgsql:host='.$this->_database['host'];\n\t\t$conn_str.= ';dbname='.$this->_database['database'];\n\t\t$conn = new \\PDO($conn_str, $this->_database['username'], $this->_database['password']);\n\t\t$conn->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n\t\t$sql = \t\"SELECT column_name \n \t\t\t\tFROM information_schema.columns \n\t\t\t\t\tWHERE table_name = :table;\";\n\n $stmt = $conn->prepare($sql);\n $stmt->execute(array('table' => $table));\n\n $struttura = array();\n\n while($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n\t $struttura[] = $row['column_name'];\n\t }\n\n\t return $struttura;\n\t}", "function sql_getTableColumnNames($tablename)\n {\n global $SQL_DBH;\n if (!$SQL_DBH) return array();\n\n $drivername = $SQL_DBH->getAttribute(PDO::ATTR_DRIVER_NAME);\n if ($drivername == 'sqlite')\n {\n $sql = sprintf('PRAGMA TABLE_INFO(`%s`)', $tablename);\n $target = 'name';\n }\n else\n {\n // mysql\n $sql = sprintf('SHOW COLUMNS FROM `%s` ', $tablename);\n $target = 'Field';\n }\n\n $items = array();\n $res = array();\n $stmt = $SQL_DBH->prepare($sql);\n if ( $stmt && $stmt->execute() )\n $res = $stmt->fetchAll();\n\n foreach($res as $row)\n if (isset($row[$target]))\n $items[] = $row[$target];\n if (count($items)>0)\n {\n sort($items);\n }\n return $items;\n }", "function listColumns($tablename);", "public function getAllColumnsNames()\n {\n switch (DB::connection()->getConfig('driver')) {\n case 'pgsql':\n $query = \"SELECT column_name FROM information_schema.columns WHERE table_name = '\".$this->table.\"'\";\n $column_name = 'column_name';\n $reverse = true;\n break;\n\n case 'mysql':\n $query = 'SHOW COLUMNS FROM '.$this->table;\n $column_name = 'Field';\n $reverse = false;\n break;\n\n case 'sqlsrv':\n $parts = explode('.', $this->table);\n $num = (count($parts) - 1);\n $table = $parts[$num];\n $query = \"SELECT column_name FROM \".DB::connection()->getConfig('database').\".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'\".$table.\"'\";\n $column_name = 'column_name';\n $reverse = false;\n break;\n\n default: \n $error = 'Database driver not supported: '.DB::connection()->getConfig('driver');\n throw new Exception($error);\n break;\n }\n\n $columns = array();\n\n foreach(DB::select($query) as $column)\n {\n $columns[] = $column->$column_name;\n }\n\n if($reverse)\n {\n $columns = array_reverse($columns);\n }\n\n return $columns;\n }", "function columns($table)\n{\n\treturn $this->drv->columns($table);\n}", "public function getColumns($table){\n\n\t\t$query = $this->db->prepare(\"DESCRIBE $table\");\n\t\t$query->execute();\n\n\t\t//Returns associative array of column names.\t\n\t\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n\t}", "public function getTableColumns() {\n return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n }", "public function getTableColumns() { return $this->table->getColumns(); }", "public function extractColumnNames ($table){\n $functions = get_class_methods($table);\n $columns = array();\n foreach ($functions as $function){\n if (\n strpos($function, \"get\") !== FALSE &&\n strpos($function, \"getEntity\") === FALSE &&\n $function != \"getDbTableName\"\n ){\n $key = strtolower (str_replace (\"get\", \"\", $function));\n array_push($columns, $key);\n }\n }\n \n return $columns;\n }", "public function columns($table_name);", "public function getAllColumnsNames()\n {\n switch (DB::connection()->getConfig('driver')) {\n case 'pgsql':\n $query = \"SELECT column_name FROM information_schema.columns WHERE table_name = '\".$this->getTable().\"'\";\n $column_name = 'column_name';\n $reverse = true;\n break;\n\n case 'mysql':\n $query = 'SHOW COLUMNS FROM '.$this->getTable();\n $column_name = 'Field';\n $reverse = false;\n break;\n\n case 'sqlsrv':\n $parts = explode('.', $this->getTable());\n $num = (count($parts) - 1);\n $table = $parts[$num];\n $query = \"SELECT column_name FROM \".DB::connection()->getConfig('database').\".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'\".$table.\"'\";\n $column_name = 'column_name';\n $reverse = false;\n break;\n\n default:\n $error = 'Database driver not supported: '.DB::connection()->getConfig('driver');\n throw new \\Exception($error);\n break;\n }\n\n $columns = array();\n\n foreach(DB::select($query) as $column)\n {\n array_push($columns, $column->$column_name);\n }\n\n if($reverse)\n {\n $columns = array_reverse($columns);\n }\n\n return $columns;\n }", "public function get_columns($table)\n\t{\n\t\treturn $this->driver_query($this->sql->column_list($this->prefix_table($table)), FALSE);\n\t}", "public function getTableColumns()\n {\n $tableColumns = $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n return $tableColumns;\n }", "protected function getColumns() {\n $driver = $this->connection->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n // Calculate the driver class. Why don't they do this for us?\n $class = '\\\\Aura\\\\SqlSchema\\\\' . ucfirst($driver) . 'Schema';\n $schema = new $class($this->connection, new ColumnFactory());\n return array_keys($schema->fetchTableCols($this->table));\n }", "public function getFieldNames() {\n\t\treturn array_keys($this->tca['columns']);\n\t}", "function getColumns($table) {\n return mysql_query(sprintf('SHOW COLUMNS FROM %s', $table), $this->db);\n }", "public static function getColumnNames()\n {\n $class = new static([ ]);\n $result = database()->run('DESCRIBE ' . $class->table);\n\n $columns = [ ];\n foreach ($result->fetchAll(PDO::FETCH_COLUMN) as $column):\n if (in_array($column, $class->hidden)) continue;\n\n $columns[] = $column;\n endforeach;\n\n foreach ($class->functionsToShow as $function)\n $columns[] = $function;\n \n unset($class);\n return $columns;\n }", "public abstract function getColumns($table);", "static public function getTableColumns($table='services') {\n return DB::getSchemaBuilder()->getColumnListing($table);\n }", "public static function getColumns($table){\n\t\t// get all the column into the table\n\t\t$query = DB::select('column_name')->from('information_schema.columns')->where_open()\n\t\t->where('table_schema', 'fuel_dev')\n\t\t->and_where('table_name', $table)\n\t\t->where_close()\n\t\t->execute()->as_array();\n\n\t\tforeach($query as $k=>$v)\n\t\t\t$columns[$k] = $v['column_name'];\n\t\treturn $columns;\n\t}", "public function getColumnNames() {\n $columns = array();\n\n foreach ($this->columnNames as $columnIndex => $columnName) {\n $columns[$columnName] = $columnName;\n }\n\n return $columns;\n }", "public static function getColumnTitles()\n {\n return array_keys(self::$columns);\n }", "private function getTableColumnNames($table)\n {\n global $wpdb;\n try {\n $result_array = $wpdb->get_results(\"SELECT `COLUMN_NAME` \" .\n \" FROM INFORMATION_SCHEMA.COLUMNS\" .\n \" WHERE `TABLE_SCHEMA`='\" . DB_NAME .\n \"' AND TABLE_NAME = '\" . $this->getTableName() . \"'\", ARRAY_A);\n $keys = array();\n foreach ($result_array as $idx => $row) {\n $keys[$idx] = $row['COLUMN_NAME'];\n }\n return $keys;\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->last_error = $exc->getMessage();\n return false;\n }\n }", "public function list_columns($table)\n\t{\n\t\t$columns = array();\n\t\tif ($this->db_type == 'mysql')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"DESCRIBE `$table`\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->Field;\n\t\t\t}\n\t\t}\n\t\tif ($this->db_type == 'pgsql')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"select column_name from information_schema.columns where table_name = '{$table}' and table_catalog=current_database();\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->column_name;\n\t\t\t}\n\t\t}\n\t\tif ($this->db_type == 'sqlite')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"PRAGMA table_info('$table')\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->name;\n\t\t\t}\n\t\t}\n\t\treturn $columns;\n\t}", "public function table_attributes() {\n return static::find_by_sql(\"SHOW COLUMNS FROM \".static::$table_name);\n }", "abstract public function tableColumns();", "public function getTableColumns(){\n\n $show_columns_statement = $this->grammer->compileShowColumns($this);\n return $this->connection->getTableColumns($show_columns_statement);\n\n }", "public function getColumns()\n\t{\n\t\t\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL COLUMNS FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "function getTableFields($table_name)\n\t{\n\t\t$query = \"SHOW COLUMNS FROM $table_name\";\n\t\t$rs = $this->db->query($query);\n\t\treturn $rs->result_array();\n\t}", "function getTableFields($table_name)\n\t{\n\t\t$query = \"SHOW COLUMNS FROM $table_name\";\n\t\t$rs = $this->db->query($query);\n\t\treturn $rs->result_array();\n\t}", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'id' \t\t => '%d',\n\t\t\t'name' \t\t => '%s',\n\t\t\t'date_created' \t=> '%s',\n\t\t\t'date_modified' => '%s',\n\t\t\t'status'\t\t=> '%s',\n\t\t\t'ical_hash'\t\t=> '%s'\n\t\t);\n\n\t}", "abstract protected function _getColumnNames($rs);", "public function getTableColumns()\n\t{\n\t}", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "public function getColumnName();", "function getAllColumns($table){\n\t\t$types=sqlite_fetch_column_types($table,$this->id,SQLITE_ASSOC);\n\t\t$columns=array();\n\t\tforeach($types as $column=>$type){\n\t\t\t$columns[$column]=array(\n\t\t\t\t\"name\"=>$column,\n\t\t\t\t\"key\"=>&$row['Key'],\n\t\t\t\t\"type\"=>&$types[$column],\n\t\t\t\t\"default\"=>&$row['Default'],\n\t\t\t\t\"comment\"=>&$row['Comment']\n\t\t\t\t);\n\t\t}\n\t\treturn $columns;\n\t}", "public function getFieldNames( $table );", "public function getColumns() {\n\t\treturn( $this->getTable()->getColumns() );\n\t}", "public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }", "public function fields_names(){\n $table_meta = array();\n // get fields in the database table\n\n foreach ($this->_meta() as $meta) {\n array_push($table_meta, $meta->name);\n }\n\n return $table_meta;\n }", "public function getColumns(string $table)\n {\n return $this->callSql(\"EXEC sp_columns $table\");\n }", "public function GetColumnNames( $table = '' )\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\tif(empty( $table ) )\r\n\t\t{\r\n\t\t\t$columnCount = mysql_num_fields( $this->last_result );\r\n\t\t\tif( !$columnCount )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError();\r\n\t\t\t\t$columns = false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfor( $column = 0; $column < $columnCount; $column++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t$columns[] = mysql_field_name( $this->last_result, $column );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$result = mysql_query( 'SHOW COLUMNS FROM ' . $table );\r\n\t\t\tif( !$result )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError();\r\n\t\t\t\t$columns = false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\twhile( $array_data = mysql_fetch_array( $result ) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$columns[] = $array_data[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Returns the array\r\n\t\treturn $columns;\r\n\t}", "public function get_columns() {\n\t\treturn array(\n\t\t\t'id' => '%d',\n\t\t\t'user_id' => '%d',\n\t\t\t'username' => '%s',\n\t\t\t'name' => '%s',\n\t\t\t'email' => '%s',\n\t\t\t'product_count' => '%d',\n\t\t\t'sales_count'\t => '%d',\n\t\t\t'sales_value'\t => '%f',\n\t\t\t'status'\t\t => '%s',\n\t\t\t'notes' => '%s',\n\t\t\t'date_created' => '%s',\n\t\t);\n\t}", "public function columns($table_name, $dbname = null)\n {\n $dbname = empty($dbname) ? $this->database :$dbname;\n return $this->query(\"SELECT column_name FROM INFORMATION_SCHEMA.columns WHERE table_schema = ? and table_name = ?\", array($dbname, $table_name))->fetchAll(PDO::FETCH_COLUMN);\n }", "public function getColumns ($table) {\n\n\t// get columns\n\t$sql = \"SHOW COLUMNS FROM \".mysql_real_escape_string($table).\";\";\n\t$result = $this->_sendQuery($sql);\n\tif (!$result) return false;\n\n\t// put return in array\n\t$columns = array();\n\twhile ($arr = mysql_fetch_assoc($result)) $columns[] = $arr['Field'];\n\n\treturn $columns;\n }", "function get_movie_table_columns()\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"DESCRIBE movie\");\n\t$stmt->execute();\n\t$columns = $stmt->fetchAll(PDO::FETCH_COLUMN);\n close_database_connection($db);\n return $columns;\n}", "public function table_columns($table)\n\t{\n\t\tif ($table instanceof Database_Identifier)\n\t\t{\n\t\t\t$schema = $table->namespace;\n\t\t\t$table = $table->name;\n\t\t}\n\t\telseif (is_array($table))\n\t\t{\n\t\t\t$schema = $table;\n\t\t\t$table = array_pop($schema);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$schema = explode('.', $table);\n\t\t\t$table = array_pop($schema);\n\t\t}\n\n\t\tif (empty($schema))\n\t\t{\n\t\t\t$schema = $this->_config['connection']['database'];\n\t\t}\n\n\t\t$result =\n\t\t\t'SELECT column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, numeric_precision, numeric_scale, collation_name,'\n\t\t\t.' column_type, column_key, extra, privileges, column_comment'\n\t\t\t.' FROM information_schema.columns'\n\t\t\t.' WHERE table_schema = '.$this->quote_literal($schema).' AND table_name = '.$this->quote_literal($this->table_prefix().$table);\n\n\t\t$result = $this->execute_query($result)->as_array('column_name');\n\n\t\tforeach ($result as & $column)\n\t\t{\n\t\t\tif ($column['data_type'] === 'enum' OR $column['data_type'] === 'set')\n\t\t\t{\n\t\t\t\t$open = strpos($column['column_type'], '(');\n\t\t\t\t$close = strpos($column['column_type'], ')', $open);\n\n\t\t\t\t// Text between parentheses without single quotes\n\t\t\t\t$column['options'] = explode(\"','\", substr($column['column_type'], $open + 2, $close - 3 - $open));\n\t\t\t}\n\t\t\telseif (strlen($column['column_type']) > 8)\n\t\t\t{\n\t\t\t\t// Test for UNSIGNED or UNSIGNED ZEROFILL\n\t\t\t\tif (substr_compare($column['column_type'], 'unsigned', -8) === 0\n\t\t\t\t\tOR substr_compare($column['column_type'], 'unsigned', -17, 8) === 0)\n\t\t\t\t{\n\t\t\t\t\t$column['data_type'] .= ' unsigned';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "static function columns($instancia = null) {\n if ($instancia) {\n return fields_of($instancia->_tablename());\n } else {\n return fields_of(self::getInstance()->_tablename());\n }\n }", "function queryTableColumnNames($table, $schema = null)\n {\n $table_array = explode('.',$table);\n $table = array_pop($table_array);\n $schema = ($schema)? $schema:((count($table_array)===1)? array_pop($table_array):$schema);// todo XXX current\n $result = $this->queryList(\"SELECT column_name FROM information_schema.columns WHERE TABLE_NAME = '$table' and TABLE_SCHEMA = '$schema'\");\n return $result;\n }", "public function getColumnDetails( $tablename, $columnname );", "public function getProductColumnNames() {\n\t\t$stmt = $this->pdo->prepare(\"DESCRIBE product\");\n\t\t$stmt->execute();\n\t\t$product_columns = $stmt->fetchAll(PDO::FETCH_COLUMN);\n\n\t\t$results['product_columns'] = $product_columns;\n\n\t\treturn $results; \n\t}", "final public function getColumns() {\n return implode(\",\", array_keys($this->_columns));\n }", "function get_columns_name($name_table){\n \t$sql=\" SHOW FULL COLUMNS FROM \" . $name_table . \";\";\n\t $query = $this->db->query($sql);\n\t $result = $query->num_rows() >= 1 ? $query->result() : false;\n\t return $result;\n }", "function show_columns ($table_name) {\n\tglobal $cxn;\n\t$columns_arr = NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"SHOW COLUMNS FROM \" . $cxn->real_escape_string($table_name) ;\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->execute();\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$columns_arr[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error showing columns from table: \" . $table_name;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $columns_arr);\n}", "public function getColumnNamesOutKey()\r\n\t\t{\r\n\t\t\t$nameColumns = $this->getColumnsArray();\r\n\t\t\t$key = array_search($this->getTableKeyName(), $nameColumns);// Buscando a chave do ID\r\n\t\t\tunset($nameColumns[$key]); // Excluindo o ID do array\r\n\r\n\t\t\treturn implode(\",\", $nameColumns);// Retornando uma lista de colunas separadas por vígula sem o ID\t\t\r\n\t\t}", "function getcolumnNames($tableName) {\n\n //Gets column names from the database\n $conn = connect();\n $sql = \"SHOW COLUMNS FROM \" . $tableName;\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $colArray = array();\n if ($result->num_rows > 0) {\n $i = 0;\n\n //writes names 1 by 1 into the variable $colarray\n while($row = $result->fetch_assoc()) {\n $colArray[$i] = $row['Field'];\n $i++;\n }\n\n $conn->close();\n return $colArray;\n }\n}", "public function getColumns( $table ) {\n\t\t$table = $this->safeTable($table, true);\n\t\t$columnsRaw = $this->adapter->get(\"PRAGMA table_info('$table')\");\n\t\t$columns = array();\n\t\tforeach($columnsRaw as $r) {\n\t\t\t$columns[$r[\"name\"]]=$r[\"type\"];\n\t\t}\n\t\treturn $columns;\n\t}", "public function getColumns()\n {\n if (! is_null($this->columns)) {\n return collect($this->columns);\n }\n\n return $this->columns = collect($this->rows->first())\n ->except(['created_at', 'updated_at', 'deleted_at', 'id'])\n ->keys();\n }", "public function getColumns() {\n $columns = array();\n foreach($this->mapping as $key => $value) {\n array_push($columns, $value);\n }\n return $columns;\n }", "public function showColumns($table) {\n $result = $this->select(\"SHOW COLUMNS FROM {$table}\", array(), PDO::FETCH_ASSOC);\n\n $output = array();\n foreach ($result as $key => $value) {\n\n if ($value['Key'] == 'PRI')\n $output['primary'] = $value['Field'];\n\n $output['column'][$value['Field']] = $value['Type'];\n }\n\n return $output;\n }", "function tableColumns($sSchema, $sTable) {\r\n require_once \"Column.class.inc\";\r\n $aColumn = [];\r\n\r\n $sSql = $this->aSql[$this->aValues['sgbd']]['getTableColumns'];\r\n $aSQLParams = array(\r\n 'sSchema' => array('value' => $sSchema, 'type' => 'column_name'),\r\n 'sTable' => array('value' => $sTable, 'type' => 'column_name')\r\n );\r\n\r\n $oResult = $this->oBd->executeWithParams($sSql, $aSQLParams);\r\n if (!empty($oResult)) {\r\n while ($aObject = $this->oBd->ligneSuivante($oResult)) {\r\n if ($aObject['data_type'] != 'SDO_GEOMETRY' && $aObject['data_type'] != 'geometry') {\r\n array_push($aColumn, $aObject['column_name']);\r\n }\r\n }\r\n foreach ($this->aSelectedFields as $fields) {\r\n if (strpos($fields, \"(\") != FALSE && strpos($fields, \")\") != FALSE && strpos(strtolower($fields), \" as \") != FALSE) {\r\n array_push($aColumn, $fields);\r\n }\r\n }\r\n }\r\n $oResult = $this->oBd->fermeResultat();\r\n return $aColumn;\r\n }", "static function tableColumns(string $table, ?string $schema=null): ?array {\n /*PhpDoc: methods\n name: tableColumns\n title: \"static function tableColumns(string $table, ?string $schema=null): ?array\"\n doc: |\n Retourne la liste des colonnes d'une table structuré comme:\n [ [\n 'ordinal_position'=> ordinal_position,\n 'column_name'=> column_name,\n 'data_type'=> data_type,\n 'character_maximum_length'=> character_maximum_length,\n 'udt_name'=> udt_name,\n 'constraint_name'=> constraint_name,\n ] ]\n Les 5 premiers champs proviennent de la table INFORMATION_SCHEMA.columns et le dernier d'une jointure gauche\n avec INFORMATION_SCHEMA.key_column_usage\n */\n $base = self::$database;\n if (!$schema)\n $schema = self::$schema;\n $sql = \"select c.ordinal_position, c.column_name, c.data_type, c.character_maximum_length, c.udt_name, \n k.constraint_name\n -- select c.*\n from INFORMATION_SCHEMA.columns c\n left join INFORMATION_SCHEMA.key_column_usage k\n on k.table_catalog=c.table_catalog and k.table_schema=c.table_schema\n and k.table_name=c.table_name and k.column_name=c.column_name\n where c.table_catalog='$base' and c.table_schema='$schema' and c.table_name='$table'\";\n $columns = [];\n foreach(PgSql::query($sql) as $tuple) {\n //print_r($tuple);\n $columns[$tuple['column_name']] = $tuple;\n }\n return $columns;\n }", "public function showColumns($table)\n {\n $result = $this->select(\"SHOW COLUMNS FROM `$table`\", array(), PDO::FETCH_ASSOC);\n \n $output = array();\n foreach ($result as $key => $value)\n {\n if ($value['Key'] == 'PRI')\n $output['primary'] = $value['Field'];\n \n $output['column'][$value['Field']] = $value['Type'];\n }\n \n return $output;\n }", "public function columns(string $table): array\n {\n return [\n 'query' => 'PRAGMA table_info(' . $this->tableName($table) . ')',\n 'bindings' => [],\n ];\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function getColumns( $table ) {\n\t\t$columns = array();\n\t\t$table = $this->safeTable($table);\n\t\t$columnsRaw = $this->adapter->get(\"SHOW COLUMNS FROM $table\");\n\t\tforeach($columnsRaw as $r) {\n\t\t\t$columns[$r['Field']]=$r['Type'];\n\t\t}\n\t\treturn $columns;\n\t}", "public static function getColumns($table)\n {\n $pdo = ConnMysql::getConn();\n \n $sth = $pdo->prepare(\"SHOW FULL COLUMNS FROM \" . $table);\n $sth->execute();\n /**\n * [x] => Array\n * [Field] => name\n [Type] => varchar | int | etc.\n [Collation] => utf8_general_ci\n [Null] => YES\n [Key] => PRIM ! MUL |\n [Default] => \n [Extra] => \n [Privileges] => select,insert,update,references\n [Comment] => \n */\n $columns = $sth->fetchAll(\\PDO::FETCH_ASSOC);\n foreach($columns as $k=>$field){\n $columns[$k]['Kind'] = $field['Type'];\n $columns[$k]['Size'] = 0;\n $type = $field['Type'];\n $columns[$k]['Key'] = $field['Key'];\n /*\n * Determine string for index Kind that resume Type literaly\n * (varchar, int, datetime)\n * Determine Size field\n */\n $limit = strstr($type, '(');\n if($limit != false){\n $columns[$k]['Kind'] = str_replace($limit, '', $field['Type']);\n $columns[$k]['Size'] = str_replace(['(',')'], '', $limit);\n } elseif ($field['Type'] == 'date' \n || $field['Type'] == 'time' \n || $field['Type'] == 'datetime' \n || $field['Type'] == 'year') {\n $columns[$k]['Kind'] = 'datetime';\n }\n \n }\n return $columns;\n }", "public function getMergedColumns()\n {\n $columns = [];\n foreach($this->columnNames as $table=>$cols){\n foreach($cols as $col){\n $columns[] = $table . '.' . $col;\n }\n }\n return $columns;\n }", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns()\n\t\t{\n\t\t\tstatic $columns = array(\n\t\t\t\t'date_modified', 'date_created', 'cfe_event_id', 'name','short_name'\n\t\t\t);\n\t\t\treturn $columns;\n\t\t}", "function wrapper_field_names($table) {\n\n\t\t$rowdata = $this->query_return(\"SELECT TOP 1 * FROM $table\");\n\t\t$fields = array();\n\n\t\tforeach ($rowdata as $f => $x) {\n\t\t\t$fields[] = $f;\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function listColumns(string $table)\n {\n static $columns = [];\n\n if (isset($columns[$table])) {\n return $columns[$table];\n }\n\n $schema = $this->fetchDatabase();\n $result = $this->originConn->fetchAll(\"SELECT table_name, column_name, column_default\n FROM information_schema.columns\n WHERE table_schema = '{$schema}'\n AND table_name = '{$table}'\n \");\n\n foreach ($result as $column) {\n $columns[$column['table_name']][] = $column['column_name'];\n }\n\n return $columns[$table];\n }", "abstract protected function getCompositeColumnsNames();", "public function getColumnString()\n\t{\n\t\t$columns = '';\n\n\t\tfor($i = 0, $len = count($this->column); $i < $len; $i++)\n\t\t{\n\t\t\t$columns .= $this->column[$i]->getName();\n\n\t\t\tif($i != $len-1)\n\t\t\t{\n\t\t\t\t$columns .= \", \";\n\t\t\t}\n\t\t}\n\n\t\treturn $columns;\n\t}", "private function getTableColumns() : ?array {\n\t\t$query = 'SELECT column_name, data_type, column_type FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N\\'' . $this->tableNamePrefixed . '\\'';\n\t\t$columns = $this->database->query($query);\n\n\t\t$columnsArr = array();\n\t\tforeach ($columns as $column) {\n\t\t if (property_exists($column, 'COLUMN_NAME')) {\n $columnsArr[$column->COLUMN_NAME] = $column;\n }\n if (property_exists($column, 'column_name')) {\n $column->COLUMN_NAME = $column->column_name;\n $columnsArr[$column->COLUMN_NAME] = $column;\n }\n\t\t}\n\n\t\treturn !empty($columnsArr) ? $columnsArr : null;\n\t}", "public function tableColumns($table,$column);", "public function get_columns() {\n\t\treturn array(\n\t\t\t'payment' => 'Payment',\n\t\t\t'status' => 'Status',\n\t\t\t'category' => 'Category',\n\t\t\t'due' => 'Due',\n\t\t\t'amount' => 'Amount',\n\t\t\t'method' => 'Method',\n\t\t\t// 'vendor' => 'Vendor',\n\t\t\t'attachments' => 'Attachments',\n\t\t\t'event' => 'Event',\n\t\t);\n\t}" ]
[ "0.8288905", "0.8272514", "0.8063845", "0.8010804", "0.7961725", "0.79495484", "0.7893192", "0.78912973", "0.7884319", "0.7883697", "0.78762573", "0.7831378", "0.7812662", "0.7806508", "0.7779055", "0.77544045", "0.7749659", "0.7735751", "0.77011204", "0.7693744", "0.7656974", "0.76477426", "0.76474243", "0.7621926", "0.7618104", "0.7591739", "0.7589239", "0.75557643", "0.75318116", "0.7522028", "0.7519046", "0.75088525", "0.7506854", "0.7502675", "0.7501102", "0.74746406", "0.7465474", "0.74597824", "0.74541134", "0.7430503", "0.73950666", "0.73950666", "0.7393214", "0.7380889", "0.73440325", "0.73185366", "0.7306452", "0.7302941", "0.7295953", "0.7273146", "0.72714585", "0.72651345", "0.7249046", "0.72410256", "0.7236029", "0.72328293", "0.72246534", "0.720087", "0.72004044", "0.7198152", "0.71794647", "0.71717376", "0.7167366", "0.71474814", "0.7133458", "0.71323895", "0.7130886", "0.71155983", "0.71033", "0.71017915", "0.7095602", "0.70838225", "0.70519185", "0.7046099", "0.70426124", "0.7039883", "0.7033322", "0.7033322", "0.7033322", "0.7033322", "0.7030259", "0.7030259", "0.7013237", "0.7009328", "0.7008623", "0.7008028", "0.7008028", "0.7008028", "0.7008028", "0.7008028", "0.7008028", "0.7008028", "0.70068514", "0.70037615", "0.6989828", "0.69881195", "0.6976562", "0.6966948", "0.6954894", "0.69522095" ]
0.81451094
2
Get column base name.
public function column_basename($column) { $name = explode('.', $column); return end($name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBaseIdentifier()\n {\n return $this->getDriver()->getColumnBaseIdentifier($this);\n }", "abstract public static function get_column_name(): string;", "private function getBaseColumnName($column_name, $relation = false)\n {\n\n if (isset($this->urlData->settings['has_aggregation']) && $this->urlData->settings['has_aggregation'] == true) {\n if ($relation) {\n $column_name = with(new $this->urlData->params['model'])->$relation()->getRelated()->getTable() . '.' . $column_name;\n } else {\n $column_name = with(new $this->urlData->params['model'])->getTable() . '.' . $column_name;\n }\n }\n\n return $column_name;\n }", "protected static function column_name(): mixed\n\t{\n\t\treturn self::$query->column_name;\n\t}", "private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }", "public function getColumnName();", "protected function get_primary_column_name()\n {\n }", "public function getName()\n {\n return $this['column_name'];\n }", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }", "public function getConstantColumnName()\n { if ($this->getPeerName()) {\n return strtoupper($this->getPeerName());\n }\n\n return strtoupper($this->getName());\n }", "public function getColumn(): string\n {\n return $this->column;\n }", "public function getFieldNameByBaseType($base_type)\n {\n $this->getTableInfo();\n $field = null;\n if (isset($this['fields'])) {\n if (isset($this['fields'][$base_type])) {\n $field = $base_type;\n }\n foreach ($this['fields'] as $v) {\n if (isset($v['base_type']) && $v['base_type'] == $base_type) {\n $field = $v['field_name'];\n break;\n }\n }\n }\n \n return $field;\n }", "public function getColumn(): string\n {\n return $this->_column;\n }", "public function get_column_id()\n\t{\n\t\treturn $this->table.'.id';\n\t}", "private function namebase() {\n return $this->module->name;\n }", "public function getFullIdentifier()\n {\n return $this->getDriver()->getColumnFullIdentifier($this);\n }", "public function getQualifiedLocalizableColumn()\n {\n return $this->getTable() . '.' . $this->getLocalizableColumn();\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "protected function getStaticDatabaseColumnName() {\r\n return self::$_databaseColumnName;\r\n }", "public function getNameBase()\n {\n if ($this->nameBase === false) {\n $this->setNameBase($this->product->getNameBase());\n }\n return $this->nameBase;\n }", "public function getNameColumn()\n {\n return $this->nameColumn;\n }", "protected function get_column() {\n\n\t\t$column = $this->foreign_column ?: $this->foreign_table->get_primary_key();\n\t\t$columns = $this->foreign_table->get_columns();\n\n\t\treturn $columns[ $column ];\n\t}", "public static function getTestColumnTableName() {\n\t\treturn 'test_column_'.__CLASS__.'_'.getmypid();\n\t}", "public static function getTestColumnActiveRecordClassName() {\n\t\treturn self::getTestColumnTableName();\n\t}", "function generateColumn( $column, $defaultTable=null )\r\n\t{\r\n\t\tif (!is_object($column)) {\r\n\t\t\treturn SQLName::getNameFull( $defaultTable, $column, $this );\r\n\t\t}\r\n\t\telse switch( get_class( $column ) ) {\r\n\t\tcase FALSE:\r\n\t\t\treturn SQLName::getNameFull( $defaultTable, $column, $this );\r\n\r\n\t\tcase CLASS_SQLName: \r\n\t\t\treturn $column->generate();\r\n\r\n\t\tcase CLASS_DBColumnDefinition:\r\n\t\t\treturn SQLName::getNameFull( $column->getTableAlias(), $column->getName(), $this );\r\n\r\n\t\tcase CLASS_SQLFunction:\r\n\t\t\treturn $column->generate($this);\r\n\t\t\t\r\n\t\tdefault:\r\n\t\t\treturn $column->generate($this);\r\n\t\t}\r\n\t\treturn( \"\" );\r\n\t}", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "abstract public static function get_column_key(): string;", "protected function getUuidColumnName() {\n\n $uuidColumn = null;\n\n if ( ! $this->uuidFieldName ) {\n\n $this->initializeHasUuid();\n }\n\n return $this->uuidFieldName;\n }", "public function getColumnName() {\n return $this->columnName;\n }", "public function getColumnName()\n {\n return $this->columnName;\n }", "public function getBase(): string\n {\n return $this->base;\n }", "protected function getClassFileName($base = false)\n {\n return ($base ? $this->getTableFileName(null, ['%entity%' => 'Base'.DIRECTORY_SEPARATOR.'Base'.$this->getModelName()]) : $this->getTableFileName());\n }", "public function getColumnId(): string\n {\n return $this->getColumn('id', 'id');\n }", "protected function get_default_primary_column_name() {\r\n\t\t$hidden_columns = $this->get_hidden_columns();\r\n\r\n\t\t$primary_column = '';\r\n\t\tforeach ( array( 'ID_parent', 'title_name', 'post_title', 'post_name' ) as $column_name ) {\r\n\t\t\tif ( ! in_array( $column_name, $hidden_columns ) ) {\r\n\t\t\t\t$primary_column = $column_name;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Fallback to the first visible column\r\n\t\tif ( empty( $primary_column ) ) {\r\n\t\t\tforeach ( $this->get_columns() as $column_name => $column_title ) {\r\n\t\t\t\tif ( ( 'cb' !== $column_name ) && ! in_array( $column_name, $hidden_columns ) ) {\r\n\t\t\t\t\t$primary_column = $column_name;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $primary_column;\r\n\t}", "protected function getColumn()\n {\n return DB::select(\n 'SELECT\n\t\t\t\t\t\t\t c.COLUMN_NAME\n\t\t\t\t\t\t\t,c.COLUMN_DEFAULT\n\t\t\t\t\t\t\t,c.IS_NULLABLE\n\t\t\t\t\t\t\t,c.DATA_TYPE\n\t\t\t\t\t\t\t,c.CHARACTER_MAXIMUM_LENGTH\n\t\t\t\t\t\t\t,pk.CONSTRAINT_TYPE AS EXTRA\n\t\t\t\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS AS c\n\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME, tc.CONSTRAINT_TYPE\n\t\t\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc\n\t\t\t\t\t\t\t INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku ON tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME\n\t\t\t\t\t\t\t) AS pk ON c.TABLE_CATALOG = pk.TABLE_CATALOG\n\t\t\t\t\t\t\t AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA\n\t\t\t\t\t\t\t AND c.TABLE_NAME = pk.TABLE_NAME\n\t\t\t\t\t\t\t AND c.COLUMN_NAME = pk.COLUMN_NAME\n\t\t\t\t\t\t\tWHERE c.TABLE_NAME = ? AND c.TABLE_CATALOG = ? ',\n [$this->tableName, $this->databaseName]\n );\n }", "public function getColumn(): string;", "public function get_column_key() {\n\t\treturn $this->column_key;\n\t}", "private function getPropertyName(): string\n {\n $name = $this->foreignKey->getLocalTableName();\n if ($this->hasLocalUniqueIndex()) {\n $name = TDBMDaoGenerator::toSingular($name);\n }\n return TDBMDaoGenerator::toCamelCase($name);\n }", "public function getUsernameColumnName(): string\n {\n return $this->usernameColumn ?? $this->getModelGeneratorConfig()->getConfig('column', 'username');\n }", "public function getName()\n {\n return name_to_id($this->columnName);\n }", "abstract public function getColNames();", "private function getColumnName( $col ) {\n\t\t$pos = strpos( $col, '.' );\n\n\t\tif ( !$pos ) {\n\t\t\treturn $col;\n\t\t}\n\t\treturn substr( $col, $pos + 1 );\n\t}", "public function getResourceDbBaseName()\n {\n return $this->_sResourceDbBaseName;\n }", "public function get_base()\n\t{\n\t\t$base = NULL;\n\t\tif (isset($this->tables[0]))\n\t\t{\n\t\t\tforeach (self::$bases as $base_name => $tables)\n\t\t\t{\n\t\t\t\t$find = FALSE;\n\t\t\t\tif (is_array($tables))\n\t\t\t\t{\n\t\t\t\t\tforeach ($tables as $t)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->tables[0] == $t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$find = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($find)\n\t\t\t\t{\n\t\t\t\t\t$base = $base_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $base;\n\t}", "public function getSqlCol()\n {\n return $this->sqlCol;\n }", "protected function getWhereColumn()\n {\n $table = $this->getDoctrineTable();\n \n if ($this->getOption('column'))\n {\n return $table->getColumnName($this->getOption('column'));\n }\n\n $identifier = (array) $table->getIdentifier();\n $columnName = current($identifier);\n\n return $table->getColumnName($columnName);\n }", "public function column() : int\n {\n return $this->column;\n }", "public function getName() {\n\n //$local_column\n switch($this->type) {\n case self::ONE_TO_ONE:\n $name = $this->getReferencedTable()->getName();\n break;\n case self::MANY_TO_ONE:\n //in this case we need to name the relation based on the column, trimming off _id (if it exists)\n $name = $this->local_columns[0]->getName();\n if(substr($name, -3) === '_id')\n $name = substr($name, 0, -3);\n break;\n case self::ONE_TO_MANY:\n //slightly more complex to remove collisions between m2m names\n $name = Wave\\Inflector::pluralize($this->getReferencedTable()->getName());\n $ref_name = $this->referenced_columns[0]->getName();\n if(substr($ref_name, -3) === '_id')\n $ref_name = substr($ref_name, 0, -3);\n if($ref_name !== $this->getLocalTable()->getName())\n $name .= '_' . $ref_name;\n break;\n case self::MANY_TO_MANY:\n $columns = $this->target_relation->getLocalColumns();\n $name = $columns[0]->getMetadata('relation_name');\n if($name === null) {\n $name = $this->target_relation->getReferencedTable()->getName();\n }\n\n $name = Wave\\Inflector::pluralize($name);\n break;\n }\n\n return Wave\\Inflector::camelize($name);\n\n }", "public function getCol()\n {\n return $this->col;\n }", "public function getVariableColumnName()\r\n\t{\r\n\t\treturn $this->variable_column_name;\r\n\t}", "protected function determineOrderColumnName()\n {\n if (! isset($this->sortable['order_column_name']) || $this->sortable['order_column_name'] == '')\n {\n $orderColumnName = 'order_column';\n }\n else\n {\n $orderColumnName = $this->sortable['order_column_name'];\n }\n\n return $orderColumnName;\n }", "public function getColumn()\n {\n return $this->get('Column');\n }", "private function pk_column(){\n\t\tif( in_array(static::$table_name, Model_Kiwi::$composite_key_tables) ){\n\t\t\treturn \"composite_key\";\n\t\t}\n\t\t//if the primary key of the table has been defined in config - return that else use convention\n\t\tif( in_array( static::$table_name, array_keys(Model_Kiwi::$kiwi_pk_hash))){\n\t\t\treturn Model_Kiwi::$kiwi_pk_hash[ static::$table_name ];\n\t\t}\n\t\treturn Model_Kiwi::singularize(static::$table_name) . '_id';\n\t}", "private function getColumnPropertyName( Column $column ) : string\n {\n\n return lcfirst(str_replace( '_', '', ucwords( $column->getName(), '_' )));\n\n }", "private function baseName(){\n \n if ($this->baseName===null) {\n $this->baseName= implode('/', array_slice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/';\n }\n return $this->baseName;\n\n }", "private function realColumnAttribute($column_name)\r\n\t{\r\n\t\tif($this->pdo->options[LikePDO::ATTR_CASE] == LikePDO::CASE_LOWER)\r\n\t\t\treturn strtolower($column_name);\r\n\t\telseif($this->pdo->options[LikePDO::ATTR_CASE] == LikePDO::CASE_UPPER)\r\n\t\t\treturn strtoupper($column_name);\r\n\t\telse\r\n\t\t\treturn $column_name;\r\n\t}", "public function getCreatorColumnName() {}", "public function getColumnName(){\n $sql = 'SELECT * FROM wp_operatore_museale';\n $result = $this->conn->query($sql);\n $column = array();\n $i = 0;\n while($nameColumn = $result->fetch_field()){\n $column[$i] = $nameColumn->name;\n $i++;\n }\n return $column;\n }", "abstract function getProfileColumnName($field_name);", "private function getBaseName() {\n\t\treturn pathinfo( $this->getImportFilePath(), PATHINFO_FILENAME );\n\t\t;\n\t}", "public function getBasePart(): string\n {\n $string = str_replace($this->getLastPart(), \"\", $this->getFqcn());\n if (isset($string[-1]) && $string[-1] == \"\\\\\") {\n $string = substr($string, 0, -1);\n }\n \n return $string;\n }", "protected function getMainForeignKeyColumnName() {\n /** @var CmfDbModel|KeyValueModelHelpers $this */\n if (empty($this->_detectedMainForeignKeyColumnName)) {\n foreach ($this->getTableConfig()->getRelations() as $relationConfig) {\n if ($relationConfig->getType() === DbRelationConfig::BELONGS_TO) {\n $this->_detectedMainForeignKeyColumnName = $relationConfig->getColumn();\n break;\n }\n }\n if (empty($this->_detectedMainForeignKeyColumnName)) {\n throw new DbModelException($this, get_class($this) . '::' . __METHOD__ . ' - cannot find foreign key column name');\n }\n }\n return $this->_detectedMainForeignKeyColumnName;\n }", "public function getTypeColumn(): string\n {\n if (! isset($this->typeColumn)) {\n return 'type';\n }\n\n return $this->typeColumn;\n }", "public function getTranslationOriginColumnName() {}", "protected function createColumn()\n\t{\n\n\t\t$columnString = sprintf('`%s` %s',\n\t\t\t $this->getColumnName(),\n\t\t\t $this->getColumnType()\n\t\t );\n\n\t\treturn $columnString;\n\n\t}", "public function getSqlColString()\n {\n return $this->sqlColString;\n }", "public function getColumnPrefix();", "public function column_name($item)\n {\n }", "public function getName()\n {\n return 'grid_column';\n }", "private function resolveBindName()\n {\n $table = (self::$plural) ? Inflector::singularize($this->table) : $this->table;\n return $table . '_' . $this->key;\n }", "public function col($column)\n {\n $lang = config('app.locale');\n $column = \"$column\".\"_\".\"$lang\";\n return $this->$column;\n }", "protected function getBaseSelect()\n {\n return \"SELECT * FROM \" . $this->getTableName();\n }", "public function getBaseFileNameAttribute()\n {\n $pos = strrpos($this->fileName, '.');\n if ($pos === false) {\n return $this->fileName;\n }\n\n return substr($this->fileName, 0, $pos);\n }", "protected function getPositionColumn()\n {\n return $this->positionColumn ?? 'position';\n }", "public function get_primary_column()\n {\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->column;\n }", "public static function getPkColumnName()\n {\n $modelClass = self::getClass();\n\n return implode('__', $modelClass::getScheme()->getPkColumnNames());\n }", "public function baseTableIdColumn($prefix = '');", "public function getBaseName() {\n\t\treturn basename($this->getPath());\n\t}", "public function column_name($theme)\n {\n }", "public function column_name($user)\n {\n }", "public function getDefaultSortColumnName()\n {\n return $this->defaultSortColumnName;\n }", "protected function getBaseClassName() {\r\n\t\tif(method_exists(static::$className, 'getBaseClassName')) {\r\n\t\t\treturn call_user_func(array(static::$className, 'getBaseClassName'));\r\n\t\t} else {\r\n\t\t\treturn mb_substr(static::$className, 0, -6);\r\n\t\t}\r\n\t}", "protected function getPrimaryKeyColumnName()\n {\n return ColumnKeys::PATH;\n }", "private function columnName($column)\n {\n // Select all\n if ($column == '*') {\n return \"`{$this->query['table']}`.*\";\n }\n\n if (strpos($column, '.') === false) {\n $column = $this->query['table'] . \".{$column}\";\n }\n\n // Regular column name\n if (strpos($column, '(') === false) {\n return str_replace(array('.'), array('`.`'), \"`{$column}`\");\n } else {\n return trim(str_replace(array('(', ')', '.'), array('(`', '`)', '`.`'), $column), '`');\n }\n }", "public function name() {\n\t\treturn __( 'Columns', 'thrive-cb' );\n\t}" ]
[ "0.773453", "0.7615782", "0.70841944", "0.7012775", "0.6739081", "0.66166", "0.6587883", "0.658724", "0.65863055", "0.65863055", "0.65795845", "0.65767515", "0.6550839", "0.6548002", "0.6520985", "0.64988446", "0.6491407", "0.64689934", "0.64632994", "0.64632994", "0.64632994", "0.64632994", "0.64461577", "0.6431325", "0.6419878", "0.63761455", "0.6292397", "0.6282349", "0.627087", "0.627087", "0.627087", "0.627087", "0.627087", "0.627087", "0.62688255", "0.62688255", "0.62681746", "0.62681746", "0.62681746", "0.6228364", "0.6203357", "0.61945117", "0.61923814", "0.61075443", "0.6092704", "0.6080016", "0.6074786", "0.60441124", "0.60306114", "0.60276824", "0.60189545", "0.5996902", "0.5962815", "0.5947192", "0.594543", "0.594234", "0.591339", "0.59120613", "0.59056777", "0.5902283", "0.58985794", "0.5898464", "0.5897331", "0.58870834", "0.5880043", "0.5874497", "0.5867885", "0.5863623", "0.586102", "0.5848745", "0.5846193", "0.58452845", "0.58415604", "0.58251166", "0.58239746", "0.5819548", "0.5810976", "0.58000207", "0.5799573", "0.57927424", "0.57919204", "0.5786099", "0.5777467", "0.57625103", "0.57608235", "0.57601106", "0.57562214", "0.5753813", "0.5733982", "0.5733982", "0.5733886", "0.5733332", "0.57317406", "0.5729188", "0.57232255", "0.57145756", "0.57009345", "0.56987363", "0.5686409", "0.5683541" ]
0.63984257
25
Valid if actual query is a select statement
public function is_select() { return strpos($this->type, 'select') !== false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_select_statement()\n {\n return $this->object->_select_clause ? TRUE : FALSE;\n }", "function is_select_statement()\n {\n return isset($this->object->_query_args['is_select']) && $this->object->_query_args['is_select'];\n }", "private function isSelectQuery()\n\t{\n\t\treturn sizeof($this->selects) > 0;\n\t}", "protected abstract function getSelectStatement();", "protected abstract function getSelectStatement();", "public function testInvalidSelectStatement()\n {\n $method = $this->builder_reflection->getMethod('sql_select_statement');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('select_statement');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array('INSERT INTO table1'));\n\n $string = '';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "public function testSelect()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $select = $connection->select();\n\n $this->assertInstanceOf(Query\\Select::class, $select);\n $this->assertEquals($connection, $select->connection);\n }", "public function testSelectInstance() {\r\n $this->assertInstanceOf('\\PM\\Main\\Database\\Select', $this->_instance->select());\r\n }", "public function testSelectStmt()\n {\n $select = $this->getConnection()\n ->select()\n (['blog_title', 'blog_id'])\n ('dummy_posts')\n ('WHERE blog_title = :title');\n return $this->assertEquals($select, \"SELECT blog_title, blog_id FROM dummy_posts WHERE blog_title = :title\");\n }", "public function fromSelectQuery(\\Yana\\Db\\Queries\\IsSelectQuery $query): string;", "public function testSelectWithNoParameters()\n {\n $this->db->select(\"test\");\n $this->assertEquals(\"SELECT * FROM test\", (string) $this->db);\n }", "abstract public function prepareSelect();", "protected function prepareSelectStatement() {}", "public function checkSubquerySupport();", "public function createSelectSql(): \\Hx\\Db\\Sql\\SelectInterface;", "public function testSelect()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->select(['a', 'b']));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b'], $elasticQuery['_source']);\n\n $query->select(['c', 'd']);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b', 'c', 'd'], $elasticQuery['_source']);\n\n $query->select(['e', 'f'], true);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['e', 'f'], $elasticQuery['_source']);\n }", "function getSelectQueryResult($query) {\r\n\tif(!preg_match('/^[\\ ]*SELECT/i', $query)) migrationDie(array(\"ERR_QUERY\", \"'SELECT' query expected\", $query));\r\n\t$select_result = array();\r\n\t$query_result = customQuery($query);\r\n\twhile($row = $query_result->fetch_assoc()) {\r\n\t\t$select_result[] = $row;\r\n\t}\r\n\treturn $select_result;\r\n}", "function testDBSelectCorrect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select variable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "function testDBSelect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select varable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "public function testInitialSelectStatement()\n {\n $method = $this->builder_reflection->getMethod('sql_select_statement');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('select_statement');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array('SELECT * FROM table1'));\n\n $string = 'SELECT * FROM table1';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "function selectQuery($query) \t{\n\t\tif($query != '')\t\t{\n\t $res = $this->execute($query);\n\t\t\treturn $this->fetchAll($res);\n\t\t}\n\t}", "protected function Select($sql) { \n if ((empty($sql)) || (!eregi(\"^select\",$sql)) || (empty($this->CONNECTION))) { \n $this->ERROR_MSG = \"\\r\\n\" . \"SQL Statement is <code>null</code> or not a SELECT - \" . date('H:i:s'); \n $this->debug(); \n return false; \n } else { \n $conn = $this->CONNECTION; \n $results = mysql_query($sql,$conn); \n if ((!$results) || (empty($results))) { \n $this->ERROR_MSG = \"\\r\\n\" . mysql_error().\" - \" . date('H:i:s'); \n $this->debug(); \n return false; \n } else { \n// $i = 0; \n// $data = array(); \n// while ($row = mysql_fetch_array($results)) { \n// $data[$i] = $row; \n// $i++; \n// } \n// mysql_free_result($results); \n// return $data; \n return $results;\n } \n } \n }", "public function testSelectWithConditions(): void\n {\n $this->_insert();\n $result = $this->connection->selectQuery('id', 'ordered_uuid_items')\n ->where(['id' => '48298a29-81c0-4c26-a7fb-413140cf8569'], ['id' => 'ordered_uuid'])\n ->execute()\n ->fetchAll('assoc');\n\n $this->assertCount(1, $result);\n $this->assertSame('4c2681c048298a29a7fb413140cf8569', $result[0]['id']);\n }", "public function select();", "public function select();", "public function select();", "function pg_select($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC, int $result_type = PGSQL_ASSOC)\n{\n error_clear_last();\n $result = \\pg_select($connection, $table_name, $assoc_array, $options, $result_type);\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n return $result;\n}", "function querySelect( $query, &$resultContainer )\r\n\t{\r\n\t\t$resultStm = $this->link->query( $query.\";\", PDO::FETCH_CLASS, \"stdclass\" );\r\n\t\treturn $this->_processSelectResult($resultStm, $resultContainer, $query);\r\n\t}", "private function Select()\n {\n $return = false;\n $action = $this->Action();\n $columns = $this->Columns();\n $table = $this->Table();\n $where = (Checker::isArray($this->Where(), false))?$this->Where():array(Where::QUERY => \"\", Where::VALUES => array());\n $order = (Checker::isString($this->Order()))?$this->Order():\"\";\n $limit = (Checker::isInt($this->Limit()))?\" LIMIT \".$this->Limit():\"\";\n if($columns && $table && Checker::isArray($where, false))\n {\n $return[Where::QUERY] = \"$action $columns FROM $table\".$where[Where::QUERY].\"$order$limit\";\n\n if(Checker::isArray($where, false) && isset($where[Where::VALUES])) $return[Where::VALUES] = $where[Where::VALUES];\n else $return[Where::VALUES] = array();\n }\n return $return;\n }", "public function selectQuery($sql_stmt)\n {\n return DB::select($sql_stmt);\n }", "public function isQueryDDL($sql)\n {\n $operations = Config::inst()->get(static::class, 'ddl_operations');\n return $this->isQueryType($sql, $operations);\n }", "function test_select($urabe, $body)\n{\n $sql = $body->sql_select;\n $result = $urabe->select($sql);\n $result->message = \"Urabe test selection query with default parser\";\n return $result;\n}", "public function PgSelect($sql){\n $this->StartBD();\n $this->SQuery = $this->PgQuery($sql);\n if (!$this->SQuery){\n die(\"SELECT Erroneo!\");\n }\n $this->EndBD();\n }", "function sqlQuery($sql = \"\") {\n\n if (empty($sql)) {\n return false;\n }\n if (empty($this->CONN)) {\n return false;\n }\n $conn = $this->CONN;\n $results = mysql_query($sql, $conn) or $this->error(\"Something wrong in query<hr>$sql<hr>\");\n\n if (!$results) {\n $this->error(\"Query went bad ! <hr>$sql<hr>\");\n return false;\n }\n if (!preg_match(\"/^select/i\", $sql)) {\n return true;\n } else {\n $count = 0;\n $data = array();\n while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {\n $data[$count] = $row;\n $count++;\n }\n mysql_free_result($results);\n return $data;\n }\n }", "abstract public function query($sql);", "public function select($query){\n\t\t$result = $this->con->query($query) or die($this->con->error.__LINE__);\n\t\tif($result->num_rows > 0){\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function querySelect($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in querySelect function\",E_USER_ERROR);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\t\r\n\t\tif ($result = $this->socket->query($query)) {\r\n\t\t\t$this->recordsSelected = $result->num_rows;\r\n\t\t\t$this->databaseResults = $this->getData($result);\r\n\t\t\t$result->close();\t\t\t\r\n\t\t}\r\n\t\telseif($this->socket->errno!='')\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->error( $sql.\"Error querying database: \". $this->socket->error,false);\r\n\t\t\treturn false;\r\n\r\n\t\t\t}\r\n\t\t\r\n\t\treturn $this->databaseResults;\r\n\t}", "public function fquery(): mixed\n {\n $sth = $this->query(func_get_args());\n if (is_object($sth)) {\n //select query\n return $sth->fetchAll();\n } else {\n //non-select query that can return bool/int\n return $sth;\n }\n }", "abstract public function query($type, $sql, $asObject = false, array $params = null);", "function unframed_sql_select($pdo, $statement, $parameters) {\n\t$st = $pdo->prepare($statement);\n\tif ($st->execute($parameters)) {\n\t\treturn $st->fetchAll(PDO::FETCH_ASSOC);\n\t}\n\tthrow new Unframed($st->errorInfo()[2]);\n}", "public function select($query)\n {\n $result = $this->link->query($query) or\n die($this->link->error . __LINE__);\n if ($result->num_row > 0) {\n return $result;\n } else {\n return false;\n }\n }", "public function testSelectWithNullFieldParameter()\n {\n $this->db->select(\"test\", new DBField());\n $this->assertEquals(\"SELECT * FROM test\", (string) $this->db);\n }", "public function select( $cols = '*', $extra = null )\n {\n $sql_select_string = $this->formatSelectCommand( $cols, $extra );\n\n $l_result = $this->query( $sql_select_string );\n\n $this->clearDataBuffer( );\n if ( @ mysql_num_rows( $this->db_query_result ) == 0 )\n return false;\n\n return $l_result;\n }", "function queryDB($db, $query, $params) {\r\n // Silex will catch the exception\r\n $stmt = $db->prepare($query);\r\n $results = $stmt->execute($params);\r\n $selectpos = stripos($query, \"select\");\r\n if (($selectpos !== false) && ($selectpos < 6)) {\r\n $results = $stmt->fetchAll();\r\n }\r\n return $results;\r\n}", "public function querySelect($sql, $fields = NULL, $fetchMode = NULL) : Collection;", "public function testIfQueryWorks()\n {\n $this->database->query(\"SELECT * FROM users\");\n\n $data = $this->database->resultSet();\n\n $this->assertIsArray($data);\n }", "protected function processSelect(\\Zend_Db_Select $select)\n { }", "protected static function select()\n {\n }", "protected abstract function getSelectStatement(array $columns);", "function select($sql = \"\", $smarty = false) {\n\t\t\t\t#echo \"<br>\".$sql.\"<br>\";\n\t\t\t$result = 0;\n\t\t\t$this->time_start();\n\t\t\t$r = $this->checkup(\"select\", $sql);\n\t\t\tif (!$r) { $this->error(\"error queriing, its not a select-query: \".$sql); return false; }\n\t\t\t\n\t\t\t$this->affected_rows = 0;\n\n\t\t\t// if there is an SHOW query, there is MYSQL_BOTH needed as mysql_fetch_array result type\n\t\t\tif (eregi(\"^show\", $sql)) {\n\t\t\t\t$temp_type = $this->SELECT_TYPE;\n\t\t\t\t$this->SELECT_TYPE = MYSQLI_BOTH;\n\t\t\t}\n\t\t\t$conn = $this->CONN;\n\n\t\t\t$results = mysqli_query($conn, $sql) or $this->error($sql);\n\t\t\tif ((!$results) or (empty ($results))) {\n\t\t\t\t//mysqli_free_result($conn); // nothing to free\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$count = 0;\n\t\t\t$data = array ();\n\n\t\t\t$this->affected_rows = mysqli_affected_rows($conn);\n\n\t\t\t// create a smarty readable array\n\t\t\tif ($smarty == true) {\n\t\t\t\twhile ($row = mysqli_fetch_array($results, $this->SELECT_TYPE)) {\n\t\t\t\t\t// if there's only one column and the script is allow to create,\n\t\t\t\t\t// create a 1-d array\n\t\t\t\t\tarray_push($data, $row);\n\t\t\t\t}\n\t\t\t\t// normal int associated array\n\t\t\t}\n\t\t\telseif (!ereg(\"INDEX_ASSOCIATION\", $sql)) {\n\t\t\t\t// normal results return (1-d, 2-d arrays)\n\t\t\t\t$anz_rows = mysqli_num_fields($results);\n\t\t\t\twhile ($row = mysqli_fetch_array($results, $this->SELECT_TYPE)) {\n\t\t\t\t\t// if there's only one column and the script is allowed to create,\n\t\t\t\t\t// create a 1-d array\n\t\t\t\t\tif ($anz_rows < 2 && $this->field_dimension == 1) {\n\t\t\t\t\t\t$data[$count] = $row[0];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data[$count] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t$count ++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// build index-assozitive 1-d/2-d array\n\t\t\t\t// entity named INDEX_ASSOCIATION would be the array-key\n\t\t\t\twhile ($row = mysqli_fetch_array($results)) {\n\t\t\t\t\t$count = $row['INDEX_ASSOCIATION'];\n\t\t\t\t\t// if theres only one entity left, build a 1-d array\n\t\t\t\t\tif (count($row) > 4) {\n\t\t\t\t\t\t// remove ASSOCIATIONs, not needed\n\t\t\t\t\t\t$data[$count] = $row;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($row[1] == $row['INDEX_ASSOCIATION']) {\n\t\t\t\t\t\t\t$data[$count] = $row[0];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[$count] = $row[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (eregi(\"^show\", $sql)) {\n\t\t\t\t$this->SELECT_TYPE = $temp_type;\n\t\t\t}\n\n\t\t\tmysqli_free_result($results);\n\t\t\t$this->commands[\"select\"]++;\n\t\t\t$this->commands[\"sum\"]++;\n\n\t\t\t$this->time_stop(\"select\");\n\n\t\t\treturn $data;\n\t\t}", "protected function ejecutarSelect($sql){ \n $conf = $_SESSION['config']['base'];\n $pass = \\Core\\Encriptador::desencriptar($conf['dbclaveAll']);\n $obd = new \\Core\\DataBase($conf['dbhost'], $conf['dbport'], $conf['dbuserAll'], $pass, $conf['dbdatabase']);\n $datos = $obd->select($sql);\n if(!empty($datos)){\n return $datos;\n }\n return 0;\n }", "function select_sql($table='', $fields='*', ...$get_args) {\n\t\t$this->select_result = false;\n return $this->selecting($table, $fields, ...$get_args);\t \n }", "public function get_sql($sql)\n {\n $query = $this->mysqli->query($sql);\n //Make the query to setect to the database\n if ($query) {\n $this->result = $query->fetch_all(MYSQLI_ASSOC);\n return true; // data has been selected\n } else {\n array_push($this->result, $this->mysqli->error);\n return false; // data has not been selected\n }\n }", "abstract protected function _query($sql);", "public function testFunctionWithDatabaseQuery(): void\n {\n $query = ConnectionManager::get('test')\n ->selectQuery(['column']);\n\n $binder = new ValueBinder();\n $function = new $this->expressionClass('MyFunction', [$query]);\n $this->assertSame(\n 'MyFunction((SELECT column))',\n preg_replace('/[`\"\\[\\]]/', '', $function->sql($binder))\n );\n }", "public static function select($query) {\n //Run Query\n $result = self::query($query);\n\n //Check if failed\n if($result === false)\n return false;\n\n return $result -> fetchAll();\n }", "function q($sql,$conn) {\n\t$dev = FALSE;\n\n\t$res =& $conn->query($sql);\n\tif(PEAR::isError($res)) {\n\t\tif($dev) {\n\t\t\techo $res->getMessage().'<br />';\n\t\t\techo '<pre>';\n\t\t\tprint_r($conn->dsn);\n\t\t\techo '</pre>';\n\t\t}\n\t\treturn FALSE;\n\t} else {\n\t\treturn $res;\n\t}\n}", "public function hasStatement();", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "public static function select($sql, $cond=null)\n {\n $result = false;\n try\n {\n // prepare the query with the $sql parameter\n $stmt = self::connect()->prepare($sql);\n // execute the query with the $cond parameter\n $stmt->execute($cond);\n // fetchAll on the query to organize the results in a 2-dimensional array\n $result = $stmt->fetchAll();\n }\n\n // catch errors with stop and display of errors\n catch (Exception $ex)\n {\n die($ex->getMessage());\n }\n\n $stmt = null;\n return $result;\n }", "protected function getSelect() {\n $oSql = new SqlSelect();\n $oSql->setEntity($this->Persistence->getTableName());\n $oSql->addColumn(implode(',', $this->getColumns()));\n $oSql->setCriteria($this->Criteria); \n return $oSql->getInstruction();\n }", "private function _select(){\n $this->debugBacktrace();\n $parameter = $this->selectParam; //transfer to local variable.\n $this->selectParam = \"\"; //reset updateParam.\n\n \n \n $sql = \"\";\n if($this->hasRawSql){\n $sql = $parameter;\n $this->hasRawSql = false;\n }\n else{\n $tableName = $this->tableName;\n $this->tableName = \"\"; //reset.\n\n $columns = \"\";\n if(!isset($parameter) || empty($parameter)){\n $columns = \"*\";\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n else{\n //first check whether it has 'select' keyword\n $parameter = trim($parameter);\n $keyWord = substr($parameter,0,6);\n if(strtoupper($keyWord)==\"SELECT\") {\n $sql = $parameter;\n }\n else{\n $columns = $parameter;\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n }\n }\n\n \n $queryObject = $this->_perform_mysql_query($sql);\n \n if(empty($this->selectModifier)){\n //No select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $quantity = 0;\n $rows = array();\n switch ($this->fetchType){\n case \"fetch_object\":\n while ($row = mysqli_fetch_object($queryObject)) {\n if(isset($tableName)){\n $meta = new stdClass();\n $meta->type = $tableName;\n $row->__meta = $meta;\n }\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_assoc\":\n while ($row = mysqli_fetch_assoc($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_array\":\n while ($row = mysqli_fetch_array($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_row\":\n while ($row = mysqli_fetch_row($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_field\":\n while ($row = mysqli_fetch_field($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n }\n\n if($quantity>0){\n mysqli_free_result($queryObject);\n }\n\n return $rows;\n //<----No select modifier (first, firstOrDefault, single, singleOrDefault) found \n }\n else{ \n //select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $selectModifier = $this->selectModifier;\n $this->selectModifier = \"\";\n $row;\n switch($selectModifier){\n case \"first\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n break;\n \n case \"firstOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n break;\n\n case \"single\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n if($numRows > 1){\n throw new ZeroException(\"Multiple records found.\");\n }\n break;\n\n case \"singleOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n if($numRows > 1){\n return NULL;\n }\n break;\n }\n\n return $this->_prepareSingleRecord($queryObject);\n //<---- select modifier (first, firstOrDefault, single, singleOrDefault) found *212*062#\n }\n }", "public function select($query){\n return pg_fetch_all($this -> query($query));\n }", "public function select($sql)\n {\n if(!$this->connx)\n {\n $this->error = \"Cannot process query, no DB connection.\";\n user_error($this->error, E_USER_WARNING);\n return(FALSE);\n }\n $result = mysql_query($sql, $this->connx);\n if($result)\n {\n if(mysql_num_rows($result))\n {\n return(new QueryResult($result, $this->connx));\n }\n else\n {\n return(0);\n }\n }\n else\n {\n $this->error = \"Query failed ($sql): \" . mysql_error();\n user_error($this->error, E_USER_WARNING);\n return(FALSE);\n }\n }", "public function testSelectWithOneStringParameter()\n {\n $this->db->select(\"test\", 'id');\n $this->assertEquals(\"SELECT id FROM test\", (string) $this->db);\n }", "public function query($query) {\n\n\t\t$this->statement = $this->connectionDriver->prepare($query);\n\n\t\tif (collect($this->builder->bindings)->count() > 0){\n\t\t\t$this->bindValues();\n\t\t}\n\n\t\ttry {\n\t\t\t$this->statement->execute();\n\t\t}\n\t\tcatch (\\PDOException $e) {\n\n\t\t\tif (config('app.debug') == TRUE){\n\t\t\t\techo \"<pre>PDO::errorInfo():<br>\";\n\t\t\t\tprint_r($this->statement->errorInfo());\n\t\t\t\tvar_dump($e);\n\t\t\t\techo '<br> ' . $query . '</pre><br><br>';\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$type = trim(strtoupper(substr($query, 0, strpos($query, \" \"))));\n\t\tswitch ($type) {\n\t\t\tcase \"SELECT\":\n\t\t\t\t$return = \"fetchAll\";\n\t\t\t\tbreak;\n\t\t\tcase \"INSERT\":\n\t\t\t\t$return = \"insert\";\n\t\t\t\tbreak;\n\t\t\tcase \"UPDATE\":\n\t\t\t\t$return = \"update\";\n\t\t\t\tbreak;\n\t\t\tcase \"DELETE\":\n\t\t\t\t$return = \"delete\";\n\t\t\t\tbreak;\n\t\t\tcase \"SHOW\":\n\t\t\t\t$return = \"fetchAll\";\n\t\t\t\tbreak;\n\t\t\tcase \"DESCRIBE\":\n\t\t\t\t$return = \"fetchAll\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$return = \"none\";\n\t\t\t\tbreak;\n\t\t}\n\t\t$datas = $this->getReturn($return);\n\t\t$this->statement->closeCursor();\n\t\treturn $datas;\n\t}", "protected function runSelect()\n {\n return $this->connection->select(\n $this->toSql(),\n $this->getBindings(),\n $this->option->setUseWrite($this->useWritePdo)\n );\n }", "public function hasSql(){\n return $this->_has(1);\n }", "public function testSelectWithEmptyArrayWhereParameter()\n {\n $this->db->select(\"test\", new DBField('id'), []);\n $this->assertEquals(\"SELECT `id` FROM test\", (string) $this->db);\n }", "function select($table, $clause = '', $order = '') {\r\n\t\tif (empty($clause)) $clause = 1;\r\n\t\tif (!empty($order)) $order = 'order by '.$order;\r\n\t\t$this->query(\"select * from $table where $clause $order\");\t\t\t\t\r\n\t\treturn $this->affected_rows();\r\n\t}", "public static function query($sql);", "public function testSelectWithNullWhereParameter()\n {\n $this->db->select(\"test\", new DBField('id'), null);\n $this->assertEquals(\"SELECT `id` FROM test\", (string) $this->db);\n }", "function select($query)\n\t{\n\t\t\n\t\tglobal $connection;\n\t\t$resuts = $connection->query($query);\n\t\treturn $resuts;\n\t}", "public function testRunASqlQuery2(){\r\n $sql = \"Select * from 123;\";//No table named 123\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(false,$success);\r\n }", "public function getSelect()\n {\n throw new \\Exception('SELECT not ready');\n }", "public function runquery(string $query) { \n\n // Check if SELECT is in the query\n if (preg_match('/SELECT/', strtoupper($query)) != 0) {\n // Array with forbidden query parts\n $disAllow = array( 'INSERT','UPDATE','DELETE','RENAME','DROP','CREATE','TRUNCATE','ALTER',\n 'COMMIT','ROLLBACK','MERGE','CALL','EXPLAIN','LOCK','GRANT','REVOKE',\n 'SAVEPOINT','TRANSACTION','SET');\n\n $disAllow = array( 'UPDATE ','DELETE ', 'DROP ', 'TRUNCATE ', 'RENAME ');\n\n $disAllow = implode('|', $disAllow);\n\n // Check if no other harmfull statements exist\n if (preg_match('/('.$disAllow.')/', strtoupper($query)) == 0) {\n\n $conn=array(\n 'driver' => $this->dbtype,\n 'host' => $this->host,\n 'database' => $this->dbname,\n 'username' => $this->username,\n 'password' => decrypt($this->password),\n 'charset' => 'utf8',\n 'collation' => 'utf8_unicode_ci',\n 'prefix' => ''\n ); \n\n if ($this->dbtype=='oracle') {\n $conn['database']='';\n $conn['service_name']=$this->dbname;\n }\n\n Config::set('database.connections.'.$this->name, $conn);\n \n $DB=\\DB::connection($this->name);\n\n //Connection\n try {\n \\DB::connection($this->name)->getPdo();\n } \n catch(\\PDOException $e) { \n return $e->getMessage();\n }\n \n //Query \n try {\n $ret=$DB->select($query);\n }\n catch(\\PDOException $err) {\n return $err->getMessage(); \n }\n \n return collect($ret)->toJson();\n\n } else {\n return 'Error: only SELECT queries area allowed. INVALID keyword included.';\n } \n\n } else {\n return 'Error: only SELECT queries area allowed.';\n } \n \n }", "public function testIsReadyToBeExecuted()\n {\n // Start of user code Statement.testisReadyToBeExecuted\n $selectStatement = new SelectStatement(); \n $this->assertFalse($selectStatement->isReadyToBeExecuted());\n $selectStatement->setSelectExpr(\n SelectExpr::createFromNativeArray('string', array('foo'))\n ); \n $this->assertFalse($selectStatement->isReadyToBeExecuted());\n \n $selectStatement->setTableReferences('some_table');\n $this->assertTrue($selectStatement->isReadyToBeExecuted());\n // End of user code\n }", "public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }", "function select($sql) {\n global $conn;\n\n if($result = $conn->query($sql)) {\n while($row = mysqli_fetch_assoc($result))\n $result_rows[] = $row;\n\n if($result_rows != null)\n DB::return_json($result_rows);\n\n else\n throw new Exception(\"no results\");\n } else\n throw new Exception(\"query failed\");\n }", "function testSelect()\r\n\t{\r\n\t\t$data = new Data();\r\n\t\t$data->setTableAlias( \"d\" );\r\n\r\n\t\t$dic = new Dictionary();\r\n\t\t$dic->setTableAlias( \"dic\" );\r\n\t\t\r\n\t\t$stm = new SQLStatementSelect( $data );\r\n\t\t$stm->setExpression(\r\n\t\t\tnew ExprAND(\r\n\t\t\t\tnew ExprEQ( $data->tag_value(), 1),\r\n\t\t\t\t new ExprEQ( $data->tag_date(), 1),\r\n\t\t\t\t new ExprEQ( $data->tag_string(), \"\"),\r\n\t\t\t\t new ExprEQ( $data->tag_text(), \"\"),\r\n\t\t\t\t new ExprEQ( $data->tag_text(), null)\r\n\t\t\t\t) );\r\n\t\t\r\n\t\t$stm->addOrder( $data->tag_date() );\r\n\t\t$stm->addGroup( $data->tag_date() );\r\n\t\t$stm->addColumn( $dic->tag_text(\"dic_text1\") );\r\n\t\t$stm->addColumn( $dic->tag_text(\"dic_text\") ); //same and alias\r\n\t\t$stm->addJoin( $data->key_dictionary_id($dic) );\r\n\r\n\t\t$query = $stm->generate(new MysqlGenerator());\r\n\t\t\r\n\t\t$expected = \"SELECT\"\r\n\t\t .\" `d`.`data_id` AS `data_id`,\"\r\n\t\t\t.\" `d`.`date` AS `date`,\"\r\n\t\t\t.\" `d`.`value` AS `value`,\"\r\n\t\t\t.\" `d`.`string` AS `string`,\"\r\n\t\t\t.\" `d`.`text` AS `text`,\"\r\n\t\t\t.\" `d`.`enum` AS `enum`,\"\r\n\t\t\t.\" `d`.`blob` AS `blob`,\"\r\n\t\t\t.\" `d`.`real` AS `real`,\"\r\n\t\t\t.\" `d`.`dictionary_id` AS `dictionary_id`,\"\r\n\t\t\t.\" `dic`.`text` AS `dic_text1`,\"\r\n\t\t\t.\" `dic`.`text` AS `dic_text`\"\r\n\t\t\t.\" FROM `t_data` AS `d` \"\r\n\t\t\t.\"LEFT JOIN `t_dictionary` AS `dic` ON (`dic`.`dictionary_id` = `d`.`dictionary_id`) \"\r\n\t\t\t.\"WHERE ((`d`.`value` = 1)\"\r\n\t\t\t.\" AND (`d`.`date` = '1970-01-01 03:00:01')\"\r\n\t\t\t.\" AND (`d`.`string` = '')\"\r\n\t\t\t.\" AND (`d`.`text` = '')\"\r\n\t\t\t.\" AND (`d`.`text` IS NULL)) \"\r\n\t\t\t.\"GROUP BY `d`.`date` \"\r\n\t\t\t.\"ORDER BY `d`.`date` ASC\"\r\n\t\t\t;\r\n\t\t\r\n\t\tTS_ASSERT_EQUALS( $expected, $this->ws($query) );\r\n\t}", "public function createSelect()\n {\n return $this->getConnection()->select();\n }", "public function is_main_query()\n {\n }", "public function testWhereExistsWithSelect()\n {\n $select = new Select($this->mockConnection);\n $query = (new WhereBuilder($this->mockConnection))->whereExists($select);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'type' => 'exists',\n 'select' => $select->toArray(),\n 'boolean' => 'and',\n 'not' => false,\n ]\n ]\n ], $array);\n }", "public function select(string $query)\n{\n // guardamos lo que venga como parametros en la funcion select\n $this->strquery = $query;\n // preparamos el query\n $result = $this->conexion->prepare($this->strquery);\n $result->execute();\n // se utiliza fetch porque solo devuelve un resultado\n $data = $result->fetch(PDO::FETCH_ASSOC);\n return $data;\n}", "static function select($sql, $params = array()) {\n $sth = static::execute($sql, $params);\n\n $result = $sth->fetchAll();\n\n return $result;\n }", "public function select()\n\t{\n\t\treturn call_user_func_array([$this->queryFactory->__invoke('select'), 'select'], func_get_args());\n\t}", "protected function RetSelect() {\n\n $return = \"SELECT\";\n\n if ($this->\n distinct) {\n\n $return .= \" DISTINCT\";\n }\n\n $columnsArr = [];\n\n foreach ($this->\n columns as $key => $value) {\n\n if (is_string($value)) {\n\n $columnsArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $columnsArr[] = \"(\" . $value['subquery']->\n Generate() . \")\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else if (isset($value['value'])) {\n\n $columnsArr[] = \"'{$value['value']}'\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else {\n\n $columnsArr[] = \"{$value['column']}\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n }\n }\n\n if (count($columnsArr)) {\n\n $return .= \" \" . implode($columnsArr, \", \");\n } else {\n\n $return .= \" *\";\n }\n\n\n $tablesStr = \"\";\n\n foreach ($this->\n tables as $key => $value) {\n\n if (is_string($value)) {\n\n $tablesStr .= \", $value\";\n } else {\n\n if (!(isset($value['table']) &&\n $value['table'] != \"\") &&\n isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $value['table'] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n\n if (!isset($value['alias'])) {\n\n throw new \\Exception(\"Error: Alias required in case of subquery to be used in from clause.\");\n }\n } else {\n\n $value['table'] = \"{$value['table']}\";\n }\n\n if (isset($value['alias'])) {\n\n $value['alias'] = \"`{$value['alias']}`\";\n }\n\n if (!isset($value['table']) ||\n $value['table'] == \"\") {\n\n throw new \\Exception(\"Error: Tables not properly provided in QueryHelper.\");\n }\n\n if (!isset($value['jointype'])) {\n\n $tablesStr .= \", \" . $value['table'];\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n } else {\n\n switch ($value['jointype']) {\n case 'j':\n\n $tablesStr .= \" JOIN \" . $value['table'];\n break;\n\n case 'ij':\n\n $tablesStr .= \" INNER JOIN \" . $value['table'];\n break;\n\n case 'cj':\n\n $tablesStr .= \" CROSS JOIN \" . $value['table'];\n break;\n\n case 'sj':\n\n $tablesStr .= \" STRAIGHT_JOIN \" . $value['table'];\n break;\n\n case 'lj':\n\n $tablesStr .= \" LEFT JOIN \" . $value['table'];\n break;\n\n case 'rj':\n\n $tablesStr .= \" RIGHT JOIN \" . $value['table'];\n break;\n\n case 'nj':\n\n $tablesStr .= \" NATURAL JOIN \" . $value['table'];\n break;\n\n case 'nlj':\n\n $tablesStr .= \" NATURAL LEFT JOIN \" . $value['table'];\n break;\n\n case 'nrj':\n\n $tablesStr .= \" NATURAL RIGHT JOIN \" . $value['table'];\n break;\n\n case 'loj':\n\n $tablesStr .= \" LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'roj':\n\n $tablesStr .= \" RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nloj':\n\n $tablesStr .= \" NATURAL LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nroj':\n\n $tablesStr .= \" NATURAL RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n default:\n break;\n }\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n\n if (isset($value['joinconditions']) &&\n count($value['joinconditions'])) {\n\n $tablesStr .= $this->\n WhereClause($value['joinconditions'], 1);\n }\n }\n }\n }\n\n $return .= \" FROM \" . ltrim($tablesStr, \", \");\n\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n\n $groupsArr = [];\n\n foreach ($this->\n group as $key => $value) {\n\n if (is_string($value)) {\n\n $groupsArr[] = \"{$value}\";\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $groupsArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n } else if (isset($value['value'])) {\n\n $value['value'] = $this->\n connection->\n GetConn()->\n real_escape_string($value['value']);\n $groupsArr[] = \"'{$value['value']}'\";\n } else {\n\n $groupsArr[] = \"{$value['column']}\";\n }\n }\n\n if (count($groupsArr)) {\n\n $return .= \" GROUP BY \" . implode($groupsArr, \", \");\n }\n\n\n if (count($this->\n having)) {\n\n $return .= $this->\n WhereClause($this->\n having, 2);\n }\n\n\n $ordersArr = [];\n\n foreach ($this->\n order as $key => $value) {\n\n if (is_string($value)) {\n\n $ordersArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $ordersArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else if (isset($value['value'])) {\n\n $ordersArr[] = \"'{$value['value']}'\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else {\n\n $ordersArr[] = \"{$value['column']}\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n }\n }\n\n if (count($ordersArr)) {\n\n $return .= \" ORDER BY \" . implode($ordersArr, \", \");\n }\n\n if ($this->\n perpage > 0) {\n\n if ($this->\n page < 1) {\n\n $this->\n page = 1;\n }\n\n $startcount = $this->\n perpage * ($this->\n page - 1);\n\n $return .= \" LIMIT {$startcount}, {$this->\n perpage}\";\n }\n\n return $return . \";\";\n }", "public function testFromWithoutAlias()\n {\n $query = (new Select($this->mockConnection))->from('table');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('from', $array);\n $this->assertEquals(['table'], $array['from']);\n }", "function in_query($sql, $type=db::DB_BOTH){\t\t\n\t\t$q = $this->query($sql);\t\t\n\t\t$results = array();\n\t\tif($q){\n\t\t\twhile($row=$this->fetch_array($q, $type)){\n\t\t\t\t$results[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "public function query($sql);", "public function query($sql);", "public function query($sql);", "public function query($sql);", "function BDDselect($sql, $param){\n $bdd = BDDopen();\n $req = $bdd->prepare($sql);\n if($req->execute($param) === FALSE){\n echo 'Errore de la requette';\n print_r($param);\n }\n return $req;\n}", "function select ($distinct, \n\t\t\t\t\t $table_name, \n\t\t\t\t\t $select_column_names,\n\t\t\t\t\t $identifier_array = null,\n\t\t\t\t\t $order_by_array = null,\n\t\t\t\t\t $limit = null,\n\t\t\t\t\t $offset = null,\n\t\t\t\t\t $reconnect_attempt = TRUE\n\t\t\t\t\t )\n\t{\n\t\tif ($reconnect_attempt) {\n\t\t\t// If the connection is lost, try to reconnect.\n\t\t\tif ( !isset( $this->dbcon ) || ! $this->dbcon ) {\n\t\t\t\t$this->db_connect();\n\t\t\t}\n\t\t}\n\t\t$statement = $this->_select($table_name, $select_column_names, $distinct);\n\t\t$statement .= empty($identifier_array) ? '' : $this->_where($identifier_array, TRUE);\n\t\t$statement .= empty($order_by_array) ? '' : $this->_order_by($order_by_array, TRUE);\n\t\t$statement .= empty($limit) && empty($offset) ? '' : $this->_limit_offset($limit, $offset);\n\t\t// echo $statement . '<br />';\n\t\t$result = mysqli_query($this->dbcon, $statement);\n\t\tif (! $result ) {\n\t\t\t/* ===== Bail ===== */\n\t\t\tif (DEBUG_DISPLAY) {\n\t\t\t\techo \"Error. \" . mysqli_error($this->dbcon);\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function testBuildSql()\n {\n $statement = ['from' => ['table' => 't']];\n $this->mockCompiler->shouldReceive('compileQuerySelect')->once()->with($statement)->andReturn(['SQL', []]);\n\n $query = (new Select($this->mockConnection));\n list($sql, $bindings) = $query->buildSql($statement);\n $this->assertEquals('SQL', $sql);\n $this->assertEquals([], $bindings);\n }", "public function select($query, $bindings = []);", "public function select($query, $bindings = []);", "public function select($query, $bindings = []);", "function isInsertQuery(&$q) {\n\t\t$m=array();\n\t\t\n\t\tif(preg_match(\"/INSERT[[:space:]]+INTO[[:space:]]+([a-zA-Z0-9_-]+)/\",$q,$m)){\n\t\t\treturn $m[1];\n\t\t}\n\n\t\treturn '';\n\t}" ]
[ "0.75339055", "0.75099254", "0.7488806", "0.69833547", "0.69833547", "0.6864372", "0.65665054", "0.6544361", "0.6539723", "0.64996564", "0.645866", "0.64451075", "0.6364892", "0.63644725", "0.6333556", "0.6332631", "0.62857145", "0.6234245", "0.6227304", "0.61996466", "0.6066278", "0.6052353", "0.5961251", "0.59510696", "0.59510696", "0.59510696", "0.595015", "0.59109277", "0.59102076", "0.5885149", "0.5870501", "0.5857064", "0.5853026", "0.58348113", "0.5812447", "0.58021593", "0.5798232", "0.5797349", "0.57877123", "0.57829285", "0.57730395", "0.5764971", "0.57613224", "0.57595766", "0.5758874", "0.57397306", "0.5739673", "0.57127064", "0.56697214", "0.5665596", "0.5659334", "0.5656367", "0.5655996", "0.5649849", "0.5648694", "0.56429875", "0.5641038", "0.56285834", "0.56222826", "0.5619837", "0.5604487", "0.56012475", "0.5576443", "0.5564204", "0.55615157", "0.556005", "0.55537015", "0.5551851", "0.5544727", "0.55415756", "0.5538761", "0.5531506", "0.5523509", "0.55229497", "0.55200523", "0.5513139", "0.5510504", "0.5510125", "0.55101085", "0.55070686", "0.5506347", "0.54921645", "0.5490151", "0.54856825", "0.54852074", "0.5483038", "0.5480753", "0.5473989", "0.54739887", "0.54647106", "0.54647106", "0.54647106", "0.54647106", "0.5458747", "0.5454627", "0.545143", "0.5437784", "0.5437784", "0.5437784", "0.54335606" ]
0.56566876
51
Verify if a table is joined
public function is_joined($table) { return in_array($table, array_pluck($this->join, 'table')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isJoin();", "public function isJoin() {\n return (0 < sizeof(array_keys($this->fetchmode, 'join')));\n }", "function joined(Illuminate\\Database\\Eloquent\\Builder $builder, string $table): bool\n {\n foreach ((array) $builder->getQuery()->joins as $join) {\n if ($join->table === $table) {\n return true;\n }\n }\n\n return false;\n }", "public function isJoined(): bool\n {\n if (!empty($this->options['using'])) {\n return true;\n }\n\n return in_array($this->getMethod(), [self::INLOAD, self::JOIN, self::LEFT_JOIN], true);\n }", "public function canAutoJoin()\n {\n return ($this instanceof SingleRelation);\n }", "public function refersToTable(): bool;", "final public function isRelationTable():bool\n {\n return $this->isType('table');\n }", "public function isRequiredForCount() {\n return 'INNER JOIN' == $this->joinType;\n }", "protected function isRelationTable($table)\n\t{\n\t\t$pk=$table->primaryKey;\n\t\treturn (count($pk) === 2 // we want 2 columns\n\t\t\t&& isset($table->foreignKeys[$pk[0]]) // pk column 1 is also a foreign key\n\t\t\t&& isset($table->foreignKeys[$pk[1]]) // pk column 2 is also a foriegn key\n\t\t\t&& $table->foreignKeys[$pk[0]][0] !== $table->foreignKeys[$pk[1]][0]); // and the foreign keys point different tables\n\t}", "private function shouldJoinAudits() {\n return\n $this->needAuditRequests ||\n $this->auditStatus ||\n $this->rowsMustHaveAudits();\n }", "public function testJoinStmt()\n {\n $join = $this->joinTemplate()();\n return $this->assertEquals($join, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "public function hasTable($table);", "public function isMappedToExistingTable()\n {\n if (!empty($this->mapToTable)) {\n return true;\n } else {\n return false;\n }\n }", "private function isFilteredByJoinTable()\n {\n $globalFiltering = (isset($this->requestParams['search']) && '' !== $this->requestParams['search']['value']);\n\n $individualFiltering = false;\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n if (true === array_key_exists($key, $this->requestParams['columns'])) {\n $searchEntity = explode('.', $this->searchColumns[$key])[0];\n if ($searchEntity !== $this->entityShortName) {\n $searchValue = $this->requestParams['columns'][$key]['search']['value'];\n\n if ('' !== $searchValue && 'null' !== $searchValue) {\n $individualFiltering = true;\n break;\n }\n }\n }\n }\n }\n\n return $globalFiltering || $individualFiltering;\n }", "private function checkJoinExists(&$new_join, &$joins)\r\n\t{\r\n\t\tfor ($i = 0; $i < count($joins); $i++)\r\n\t\t{\r\n\t\t\tif ($joins[$i]['from_table'] == $new_join['from_table'] && $joins[$i]['to_table'] == $new_join['to_table']\r\n\t\t\t&& $joins[$i]['from'] == $new_join['from'] && $joins[$i]['to'] == $new_join['to'])\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function isRelated();", "public function hasTable() {\n return $this->_has(2);\n }", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function basic_join_setup()\r\n {\r\n \r\n }", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "function test_getJoin()\n {\n $question = new MDB_QT(TABLE_QUESTION);\n $joinOn1 = TABLE_QUESTION.'.id='.TABLE_ANSWER.'.question_id';\n $question->setJoin(TABLE_ANSWER, $joinOn1);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n );\n $tables = array(TABLE_ANSWER);\n $right = array();\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n\n //--------------------------------------------------------\n\n $joinOn2 = TABLE_USER.'.id='.TABLE_ANSWER.'.question_id';\n $question->setRightJoin(TABLE_USER, $joinOn2);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n 'right' => array(TABLE_USER => $joinOn2),\n );\n $tables = array(TABLE_ANSWER, TABLE_USER);\n $right = array(TABLE_USER => $joinOn2);\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n }", "function joinQuery()\n {\n }", "public function hasAssociationTarget($target)\n {\n }", "public function hasTable($tableName);", "public function hasTable($tableName);", "abstract public function hasTable($tableName);", "function dormTableExists($dormTable) {\n $sql = \"SELECT * FROM $dormTable\";\n if (query($sql) !== FALSE) \n return true;\n else \n return false; \n }", "public function canBeJoined(): bool\n {\n return $this->_canBeJoined;\n }", "public function has_many_trough($from_table, $to_table, $trough_table) {\r\n $result = true;\r\n $result = $result && $this->belongs_to($trough_table, $from_table);\r\n $result = $result && $this->belongs_to($trough_table, $to_table);\r\n return $result;\r\n }", "protected static function check_table() {\n\t\tglobal $wpdb;\n\n\t\t$storage = new WPSEO_Link_Storage();\n\t\t$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $storage->get_table_name() );\n\t\tif ( $wpdb->get_var( $query ) !== $storage->get_table_name() ) {\n\t\t\tself::set_inaccessible();\n\t\t\treturn false;\n\t\t}\n\n\t\tself::set_accessible();\n\t\treturn true;\n\t}", "public function has_many($from_table, $to_table) {\r\n $result = true;\r\n $trough_table = $from_table . '_' . $to_table;\r\n $result = $result && $this->create_table($trough_table, array());\r\n $result = $result && $this->belongs_to($trough_table, $from_table);\r\n $result = $result && $this->belongs_to($trough_table, $to_table);\r\n return $result;\r\n }", "function getJoinCondition() ;", "public function testLeftJoinStmt()\n {\n $leftJoin = $this->joinTemplate()('LEFT');\n return $this->assertEquals($leftJoin, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog LEFT JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "function is_joinable($group, $uid = NULL, $gen_err = FALSE) {\n if (!$uid)\n $uid = userid();\n\n $group_id = $group['group_id'];\n if ($this->is_member($uid, $group['group_id'])) {\n if ($gen_err)\n e(lang('grp_join_error'));\n return false;\n }elseif ($group['group_privacy'] != 2 || $this->is_invited($uid, $group_id, $group['userid'], $gen_err))\n return true;\n else\n return false;\n }", "function getJoinType() ;", "public function hasRelations()\n {\n return 0 !== count($this->relations);\n }", "public function has_one_trough($from_table, $to_table, $trough_table) {\r\n $result = true;\r\n $result = $result && $this->belongs_to($to_table, $trough_table);\r\n $result = $result && $this->belongs_to($trough_table, $from_table);\r\n return $result;\r\n }", "public function hasTable() {\n return $this->_has(5);\n }", "function tableExists($table);", "protected function hasVersionJoin(Builder $builder, string $table)\n {\n return collect($builder->getQuery()->joins)->pluck('table')->contains($table);\n }", "function table_exists()\r\n{\r\n\t$tables = $this->_db->getTableList();\r\n\t$table = self::replaceDbPrefix('#__flexicontact_log');\r\n\tif (self::in_arrayi($table,$tables))\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "public function subpropertyJoinSameTableCountTest() {}", "public function hasSchemaTable();", "public function hasRelations()\r\n {\r\n return !empty($this->relations);\r\n }", "public function fullOuterJoin($table);", "protected function joining_table()\n {\n return $this->connection()->table($this->joining);\n }", "public function getJoinType() {}", "public function getJoinCondition() {}", "function tep_db_table_exists($table, $link = 'db_link') {\n $result = tep_db_query(\"show table status from `\" . DB_DATABASE . \"`\");\n while ($list_tables = tep_db_fetch_array($result)) {\n if ($list_tables['Name'] == $table) {\n return true;\n }\n }\n return false;\n }", "public function testJoinWithoutAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'join.tableId', '=', 'table.id');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => null,\n 'statement' => [\n 'where' => [\n [\n 'column' => 'join.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "private function isForeignInBelongsToModel($table, $key)\n {\n $has_column = array_filter($table->getColumns(), function ($column) use ($key) {\n return $column->name == $key;\n });\n\n //Check if relationship column has been already added from belongsToModelProperty\n return count($has_column) > 0;\n }", "public function testRightJoinStmt()\n {\n $rightJoin = $this->joinTemplate()(\"RIGHT\");\n return $this->assertEquals($rightJoin, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog RIGHT JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "public function leftOuterJoin($table);", "public function exists()\n\t{\n\t\treturn in_array($this->name, $this->driver->getTables());\n\t}", "public function isTableOverlay();", "public static function tableExists() {\n self::init();\n return self::$wpdb->get_var(self::$wpdb->prepare(\"SHOW TABLES LIKE '%s'\", self::$table)) === self::$table;\n }", "public function testBuildSelectFieldsEmptyWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->groupBy('is_admin', 'desc')\n )\n ->groupBy('id', 'asc')\n ;\n\n $this->assertSame(\n 'table1_alias.*, table2_alias.*',\n $query->buildSelectFields()\n );\n }", "public function hasJoinRequestsList()\n {\n return $this->join_requests !== null;\n }", "private function doTablesExist()\n {\n $query = \"SELECT COUNT(*) AS count FROM sqlite_master WHERE name IN ('games', 'events') AND type = 'table'\";\n $result = $this->oDB->getFirst($query);\n\n return $result['count'] == 2;\n }", "public function hasRelation($fieldName) {\n\t\treturn NULL !== $this->getForeignTable($fieldName);\n\t}", "abstract function tables_present($prefix);", "function is_reference_in_table($field, $table, $id)\n{\n $CI =& get_instance();\n $CI->db->where($field, $id);\n $row = $CI->db->get($table)->row();\n if ($row) {\n return true;\n }\n\n return false;\n}", "public function testTableIsCreated()\n {\n $this->assertFalse($this->connection->tableExists('insight_accounts'));\n $this->insight->getTableName('accounts');\n $this->assertTrue($this->connection->tableExists('insight_accounts'));\n }", "public static function hasAssociatedEntity()\n {\n return static::$associatedEntity !== null;\n }", "final public function checkRelationTable():Table\n {\n return static::typecheck($this->relationTable(),Table::class,$this->col());\n }", "public function getJoinedTables()\n {\n return array_keys($this->join);\n }", "static public function hasTable($table)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function isRelationPopulated($name)\n {\n return array_key_exists($name, $this->_related);\n }", "function checkUserTableIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n return true; \n \n }", "public function exists() : bool {\n return DB::tableExists($this->_name);\n }", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "public function bidirectional_relation_exists() {\n $this->db->query(\"SELECT * FROM user_relation WHERE (`from` = ? AND `to` = ?) OR (`from` = ? AND `to` = ?)\",\n array(\n $this->from,\n $this->to,\n $this->to,\n $this->from,\n ));\n\n if($this->db->count() > 0) {\n return $this->db->results()[0]->status;\n } else {\n return false;\n }\n }", "public function rightOuterJoin($table);", "function checkTablesIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n \n \n // Check the taxonomy table..\n if (!isset($tables[$this->prefix.\"taxonomy\"])) {\n return false; \n }\n \n // Now, iterate over the contenttypes, and create the tables if they don't exist.\n foreach ($this->config['contenttypes'] as $key => $contenttype) {\n\n $tablename = $this->prefix . makeSlug($key);\n \n if (!isset($tables[$tablename])) {\n return false; \n }\n \n // Check if all the fields are present in the DB..\n foreach($contenttype['fields'] as $field => $values) {\n if (!isset($tables[$tablename][$field])) {\n return false;\n }\n }\n \n }\n\n \n return true; \n \n }", "public function has_Table(string $nameTable): bool\n {\n return $this->is_Table($nameTable);\n }", "public function isRelationshipData();", "static function check_exist($table){\n\t\t$db = JFactory::getDbo();\n\t\t$table_name = str_replace('#__', $db->getPrefix(),$table);\n\t\treturn in_array($table_name,$db->getTableList());\t\t\n\t}", "public function hasTable($collection)\n {\n return $this->hasCollection($collection);\n }", "public function join(Company $company)\n {\n return true;\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "function tableExists($tablename);", "private function userHasAccessToTables() {\n\t\t$userHasAccessToTables = TRUE;\n\t\t$neededTables = array(\n\t\t\tREALTY_TABLE_OBJECTS,\n\t\t\tREALTY_TABLE_APARTMENT_TYPES,\n\t\t\tREALTY_TABLE_CAR_PLACES,\n\t\t\tREALTY_TABLE_CITIES,\n\t\t\tREALTY_TABLE_DISTRICTS,\n\t\t\tREALTY_TABLE_HOUSE_TYPES,\n\t\t\tREALTY_TABLE_IMAGES,\n\t\t\tREALTY_TABLE_PETS,\n\t\t);\n\n\t\tforeach ($neededTables as $table) {\n\t\t\tif (!$GLOBALS['BE_USER']->check('tables_modify', $table)) {\n\t\t\t\t$userHasAccessToTables = FALSE;\n\t\t\t\t$this->storeErrorMessage('table_access', $table);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $userHasAccessToTables;\n\t}", "function sql_table_exists($table) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\ttry {\n\t\t$result = $sql->query(sql_select($table, '1'));\n\t} catch (Exception $e) {\n\t\treturn FALSE;\n\t}\n\treturn $result !== FALSE;\n}", "public function join($table, $on, $field = null, $comparitor = null);", "public function build_relationship()\n {\n $joins = array();\n\n $main_table = strtolower($this->_model->clean_table());\n\n foreach ($this->associations as $one) {\n\n if (!!$one) {\n $table = strtolower(DB_SUFFIX.'_'.$one);\n\n $clean_one = str_replace( DB_SUFFIX .'_', '', $table );\n\n $joins[] = 'LEFT JOIN '.$table.' ON '.DB_SUFFIX.'_'.$main_table.'.'.$clean_one.'_id = '.$table.'.id';\n\n // Set the columns within the one loop\n $this->get_has_one_columns($one);\n }\n }\n\n if ( count($joins) > 0 ) {\n $result = implode( ' ', $joins );\n } else {\n $result = false;\n }\n\n return $result;\n }", "public function innerJoin($table);", "public static function checkTable()\n {\n $db = JFactory::getDBO();\n\n $tables = $db->getTableList();\n\n if (!empty($tables)) {\n // swap array values with keys, convert to lowercase and return array keys as values\n $tables = array_keys(array_change_key_case(array_flip($tables)));\n $app = JFactory::getApplication();\n $match = str_replace('#__', strtolower($app->getCfg('dbprefix', '')), '#__wf_profiles');\n\n return in_array($match, $tables);\n }\n\n // try with query\n self::buildCountQuery();\n\n return $db->execute();\n }", "public function tableExists()\n {\n /**\n * Here we check to see if a table with that name already exists.\n */\n $mysqli = $this->getMysqli();\n $SQL = \"SHOW TABLES LIKE '\".$this->vars['db']['table'].\"'\";\n // echo $SQL;\n if (!$result = $mysqli->query($SQL)) {\n echo $mysqli->error;\n exit();\n }\n return !($result->num_rows == 0);\n }", "public function is_Table(string $nameTable): bool\n {\n if ($nameTable == \"\") {\n return false;\n }\n $entity = $this->getschema($nameTable);\n return $entity->getNameTable() != null;\n }", "public function testJoinWithAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'j.tableId', '=', 'table.id', 'j');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => 'j',\n 'statement' => [\n 'where' => [\n [\n 'column' => 'j.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "function GetJoins() { return array(); }", "public function testBuildSelectWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->fields()\n ->addField('user@email', 'email')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, 'user@email' AS table2__email\",\n $query->buildSelectFields()\n );\n }", "public function is_relation_key( $meta_key = null ) {\n\t\t\treturn isset( $this->_active_relations[ $meta_key ] );\n\t\t}" ]
[ "0.7319802", "0.7317593", "0.7190631", "0.71645266", "0.67409617", "0.6714178", "0.65963227", "0.6528295", "0.6463979", "0.62334037", "0.6226011", "0.62134486", "0.6200395", "0.616173", "0.6138305", "0.61179066", "0.60968035", "0.60964406", "0.60947293", "0.60846215", "0.6017105", "0.6017105", "0.6017105", "0.6017105", "0.6017105", "0.6017105", "0.5970056", "0.59623647", "0.5891954", "0.587068", "0.587068", "0.5866511", "0.584854", "0.57958996", "0.5786699", "0.5779006", "0.57631654", "0.57574344", "0.57560796", "0.5746334", "0.5738797", "0.5718039", "0.56857014", "0.5684952", "0.5669691", "0.56694967", "0.5650069", "0.56467354", "0.56341636", "0.56335217", "0.56120723", "0.5610332", "0.55969", "0.5588496", "0.5568167", "0.55651987", "0.55409765", "0.55279493", "0.55278337", "0.55148476", "0.5508494", "0.55049556", "0.55005443", "0.5485149", "0.5483519", "0.54770064", "0.54707515", "0.5469807", "0.54683226", "0.54612565", "0.5459781", "0.54505956", "0.5440824", "0.54346186", "0.54322034", "0.5431676", "0.54279107", "0.5410122", "0.5406607", "0.5399606", "0.53839856", "0.5380511", "0.53769755", "0.5375923", "0.5372848", "0.53676176", "0.5354184", "0.53534997", "0.53419125", "0.5332669", "0.5316433", "0.5312978", "0.53108007", "0.5310556", "0.5308005", "0.5304944", "0.5302538", "0.5301283", "0.5299915", "0.5294405" ]
0.8082056
0
Add a column to select
public function add_select($columns) { if ($this->columns) { array_add($this->columns, $columns); } else { $this->select($columns); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addSelect($column);", "public function addSelect($column)\n {\n return $this;\n }", "public function addColumn($field, $alias = null, $mutator = null)\n\t{\n\t\t$this->_type = self::SELECT;\n\t\t\n\t\tif (empty($field)) {\n\t\t\treturn $this;\n\t\t}\n\t\t\n\t\tif(reset($this->_dqlParts[\"select\"][0]->getParts()) == self::SQL_STAR)\n\t\t\t$this->_dqlParts[\"select\"] = array();\n\t\t\n\t\t$selects = is_array($field) ? $field : func_get_args();\n\t\t$this->add('select', new Expr\\Select($selects), true);\n\t\treturn $this;\n\t}", "public function addSelect($select = null)\n {\n return $this->queryBuilder->addSelect($select);\n }", "function addColumn($table, $name, $type);", "function maybe_add_column($table_name, $column_name, $create_ddl)\n {\n }", "final public function addCol(YMKM_SQL_Entity_Select $s)\n {\n $this->doAddCol($s);\n return $this;\n }", "function addColumn($column)\n {\n $this->addColumns($column);\n }", "function addColumn($columnName, $dataType, $extraStuff = \"\", $primaryKey = false) {\n $this->columns[] = new DbColumn($columnName, $dataType, $extraStuff, $primaryKey);\n }", "public function addColumn()\n {\n if ($this->name || $this->timestamps) {\n $this->columns[] = [\n 'column' => $this->name,\n 'length' => $this->length,\n 'dataType' => $this->dataType,\n 'nullable' => $this->nullable,\n 'unsigned' => $this->unsigned,\n 'pk' => $this->pk,\n 'timestamps' => $this->timestamps,\n 'autoIncrement' => $this->autoIncrement,\n 'default' => $this->default,\n 'comment' => $this->comment,\n 'unique' => $this->unique,\n ];\n $this->reset();\n }\n if ($this->foreignKey) {\n $this->columns[] = [\n 'foreignKey' => $this->foreignKey,\n 'references' => $this->references,\n 'on' => $this->on,\n 'onUpdate' => $this->onUpdate,\n 'onDelete' => $this->onDelete,\n ];\n $this->reset();\n }\n }", "abstract public function add_column($table_name, $column_name, $params);", "public function add_column($column)\r\n\t{\r\n\t\t$this->table_fields[] = $column;\r\n\t}", "public function addColumn($column,$table = \"\", $as = \"\");", "public function addColumn(KCommandContext $context)\n\t{\n\t\t$field\t\t= $context->result;\n\t\t$database\t= $this->getModel()->getTable()->getDatabase();\n\t\t$parts\t\t\t= array(\n\t\t\t\t\t\t\t'ALTER TABLE `#__',\n\t\t\t'table'\t\t=>\t'ninjaboard_people',\n\t\t\t\t\t\t\t'` ADD `custom_',\n\t\t\t'column'\t=>\t$field->name,\n\t\t\t\t\t\t\t\"` TEXT NOT NULL DEFAULT '' AFTER `signature`;\"\n\t\t\t\n\t\t);\n\n\t\t$database->execute(implode($parts));\n\t}", "public function addSelect(string ...$columns)\n {\n $this->select = array_merge($this->select, $columns);\n\n return $this;\n }", "protected function _createColumnQuery()\n\t{\n\t\n\t}", "public function addColumn($name, $options)\n\t{\n\t\treturn $this->_adapter->addColumn($this->_identifier, $name, $options);\n\t}", "public function addColumn($column)\n\t{\n\t\t$this->columns[] = $column;\n\t}", "public function col($col)\n {\n return call_user_func_array(array($this, 'addCol'), func_get_args());\n }", "protected function prependRowSelectorColumn()\n {\n if (!$this->option('useRowSelector')) {\n return;\n }\n\n $grid = $this;\n\n $column = new Column(Column::SELECT_COLUMN_NAME, ' ');\n $column->setGrid($this);\n\n $column->display(function ($value) use ($grid, $column) {\n $actions = new RowSelector($value, $grid, $column, $this);\n\n return $actions->display();\n });\n\n $this->columns->prepend($column);\n }", "public function getColumnDDL(Column $col);", "private function addSelectColumn(ClassMetadata $metadata, $column, $columnTableName = null)\n {\n if ($column === null) return $this;\n if (in_array($column, $metadata->getFieldNames())) {\n $this->selectColumns[($columnTableName ?: $metadata->getTableName())][] = $column;\n } else {\n throw new Exception('Column '.$column.' not found in entity.');\n }\n\n return $this;\n }", "public function addCustomColumn($id) {\n if ($id == 'id') {\n /**\n * Add Column for ID\n */\n $value = $this->addColumn ( 'id', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'ID' ),\n 'align' => 'right',\n 'width' => '50px',\n 'index' => 'id',\n 'filter' => false \n ) );\n } else {\n /**\n * When building a module always utilise the installation and\n * upgrade scripts so that any database additions or changes are automatically modified\n * on module installation.\n * There are a number of built in functions to these modules allowing you to add attributes,\n * create new tables etc.\n *\n * Add Column for name\n */\n $value = $this->addColumn ( 'name', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Subscription Product Name' ),\n 'align' => 'left',\n 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Managesubscriptions_Grid_Renderer_Name',\n 'filter_condition_callback' => array (\n $this,\n '_productFilter' \n ) \n ) );\n }\n return $value;\n }", "function yy_r36(){ $this->_retvalue = new SQL\\AlterTable\\AddColumn($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "public function addColumn($tableName, $schemaName, $column){ }", "public function createColumn($name, array $options = []);", "protected function get_select_id_col_name() {\n return \"accession\";\n }", "abstract protected function makeCustomColumn(string $table, DoctrineDBALColumn $column): CustomColumn;", "public function appendOptionToColumn($option, $column)\n {\n $this->_option($option)->toColumn = $column;\n return $this;\n }", "public function selectRaw($column){\n\n $this->bindings['select'] = [];\n $columns = is_array($column) ? $column : func_get_args();\n\n foreach ($columns as $as => $column) {\n\n $this->columns[] = $column;\n\n }\n\n return $this;\n\n }", "public function addColumn(Column $column) {\n\t\t$this->columns[] = $column;\n\t}", "function add_column($column, $type, array $options=null)\n {\n $definition = array(\n 'type' => $type,\n );\n if (!empty($options)) {\n $definition = array_merge($definition, $options);\n }\n \n if (isset($this->columns[$column])) {\n trigger_error(\"Column $column already defined (overwriting it).\", E_USER_WARNING);\n }\n \n $this->columns[$column] = $definition;\n }", "public function fetchAddColumn($used, $prefix = '') {\n $html = '';\n $class = 'tracker_report_table_add_column_unused';\n if (isset($used[$this->id])) {\n $class = 'tracker_report_table_add_column_used';\n }\n $html .= '<option value=\"'. $this->id .'\" class=\"'. $class .'\">'. $this->getLabel() .'</option>';\n return $html;\n }", "public function newColumn($name)\n\t{\n\t\t// TODO: More options directly in this method\n\t\t\n\t\t$c = new Db_Descriptor_Column();\n\t\t$c->setColumn($name);\n\t\t\n\t\treturn $c;\n\t}", "public function column($name)\n {\n return $this->columns([$name => $name]);\n }", "public function addColumn(ColumnInterface $column);", "private function buildSelectColumns()\n {\n $columns = array();\n\n foreach ($this->query['select'] as $column => $as) {\n // Normal column select\n if (is_numeric($column)) {\n $columns[] = $this->columnName($as);\n }\n // Alias\n else {\n $columns[] = $this->columnName($column) . \" AS `{$as}`\";\n }\n }\n\n // Join columns and return\n return implode(', ', $columns);\n }", "public function get_select_for_index()\n\t{\n\t\treturn\t$this->get_column_key().','.\n\t\t\t$this->get_column_title().' AS title,'.\n\t\t\t$this->get_column_detail().','.\n\t\t\t$this->get_column_when();\n\t}", "final public function col():Col\n {\n return $this->table()->col($this->col);\n }", "public function addColumn( $type, $column, $field ) {\n\t\t$table = $type;\n\t\t$type = $field;\n\t\t$table = $this->safeTable($table);\n\t\t$column = $this->safeColumn($column);\n\t\t$type = array_key_exists($type, $this->typeno_sqltype) ? $this->typeno_sqltype[$type] : '';\n\t\t$sql = \"ALTER TABLE $table ADD COLUMN $column $type \";\n\t\t$this->adapter->exec( $sql );\n\t}", "function add_custom_columns($column) \n {\n global $post;\n \n //var_dump($post);\n switch($column) {\n case 'shortcode':\n printf(\"[bbquote id='%s']\", $post->ID);\n break;\n case 'quote':\n echo $post->post_content;\n break;\n }\n }", "public function addColumn($value) {\n array_push($this->columns, $value);\n }", "public function column($selectorName, $propertyName = null, $columnName = null);", "public function addPreviewColumn($id);", "public abstract function getAddColumn(\n Table $table, $property, $def\n );", "public function select(\n $col = '',\n /*# string */ $colAlias = ''\n )/*# : SelectStatementInterface */;", "public function addColumn(Column $column)\n {\n $this->columns[$column->getName()] = $column;\n }", "public function getColumn($name)\r\n {\r\n }", "private function addColumn($columnName, $alias = null)\n {\n if (is_string($alias))\n $columnName = \"$columnName AS $alias\";\n\n $this->columns[] = $columnName;\n }", "public function addSelectTableColumns (Doctrine_Query $q)\n {\n $q->addSelect(\"{$q->getRootAlias()}.*\");\n\n return $this;\n }", "function Viradeco_add_user_columns($column) {\n $column['viraclub'] = __('ViraClub ID','itstar');\n $column['phone'] = __('Phone','itstar');\n $column['email'] = __('Email','itstar');\n \n return $column;\n}", "protected function getNewColumn()\n {\n return $this->newColumn;\n }", "public function modelColumn();", "public function addColumn($ID, $column)\n {\n $this->columns[$ID] = $column;\n }", "public function getUpdateColumn()\n {\n return $this->select_list;\n }", "private function setAddColumnSql() {\n\n if (!empty($this->add_columns)) {\n\n foreach ($this->add_columns as $key => $value) {\n\n foreach ($value as $keys) {\n\n $column_data = $this->one_db_table_columns[$key][$keys];\n\n\n\n $add_colum_params = \"\";\n $default_is_string = false;\n $null_string = \"\";\n $default_string = \"\";\n\n\n\n\n //Sütun tipi\n $add_colum_params .= \" \" . $column_data['Type'] . \" \";\n\n\n if ($column_data['Null'] == \"NO\") {\n\n $null_string = \"NOT NULL\";\n } else if ($column_data['Null'] == \"YES\") {\n\n $null_string = \"NULL\";\n }\n\n\n\n $field_type_detect = substr($column_data['Type'], 0, 4);\n\n if (\n $field_type_detect == \"varc\" ||\n $field_type_detect == \"text\" ||\n $field_type_detect == \"date\") {\n\n $default_is_string = true;\n }\n\n\n\n if ($column_data['Default'] != \"\" || !empty($column_data['Default']) || $column_data['Default'] != NULL) {\n\n\n $default_string = \" DEFAULT \";\n\n\n if ($default_is_string) {\n\n\n $default_string .= \" '\" . $column_data['Default'] . \"' \";\n } else {\n\n $default_string .= \" \" . $column_data['Default'] . \" \";\n }\n }\n\n\n\n $add_colum_params .= $null_string . $default_string;\n\n $writesql = <<< EOT\nALTER TABLE {$key} ADD COLUMN {$column_data['Field']} {$add_colum_params};\nEOT;\n\n $this->execute_sql[\"add_columns\"][] = $writesql;\n }\n }\n }\n }", "public function addColumn($key, $value = null)\n {\n $this->columns[] = [$key, $value];\n return $this;\n }", "function buildColumn($column) {\n $name = $type = null;\n $column = array_merge(array('null' => true), $column);\n extract($column);\n\n if (empty($name) || empty($type)) {\n trigger_error(__('Column name or type not defined in schema', true), E_USER_WARNING);\n return null;\n }\n\n if (!isset($this->columns[$type])) {\n trigger_error(sprintf(__('Column type %s does not exist', true), $type), E_USER_WARNING);\n return null;\n }\n\n $real = $this->columns[$type];\n $out = $this->name($name) . ' ' . $real['name'];\n if (isset($column['key']) && $column['key'] == 'primary' && $type == 'integer') {\n return $this->name($name) . ' ' . $this->columns['primary_key']['name'];\n }\n return parent::buildColumn($column);\n }", "public function query_col($sql) {\r\n\t return $this->query_select_single( $sql );\r\n\t}", "public function addColumns()\n {\n add_filter( 'manage_edit-' . $this->post_type . '_columns', array($this, 'editColumns') ) ; // Add or Remove a Column\n add_action( 'manage_' . $this->post_type . '_posts_custom_column', array($this, 'manageColumns') ); //Show and Modify Column Data\n add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortableColumns') ); // Flags sortable Columns\n add_action( 'load-edit.php', array($this, 'loadSortColumns') );\n }", "public function add_column($column_name, $type = NULL, $options = array())\n\t{\n\t\t$col = new Table_Column($column_name, $type, $options);\n\t\t$this->columns[] = $col;\n\n\t\treturn $this;\n\t}", "public function addColumn($fieldData)\n {\n $this->columns[$fieldData['name']] = $fieldData;\n }", "public function addSelect($select = null)\n {\n $this->_type = self::SELECT;\n\n if (empty($select)) {\n return $this;\n }\n\n $selects = is_array($select) ? $select : func_get_args();\n\n return $this->add('select', $selects, true);\n }", "abstract public function getAddStatement(DColumnDefinition $column);", "public function metaCustomColumn($column_name, $meta_field, $id)\n {\n if ($column_name === $column_name) {\n $column_name = get_post_meta($id, $meta_field, true);\n echo $column_name;\n }\n }", "function AddCol($field=-1,$width=-1,$align='L')\r\n{\r\n\tif($field==-1)\r\n\t{\r\n\t\t$field=count($this->columnProp);\r\n\t}\r\n\r\n\t$this->columnProp[$field]=array('f'=>$field,'w'=>$width,'a'=>$align);\r\n\t#$this->Write(5, \"Ajout de colonne : \".$field.\"/\".$width.\"/\".$align); $this->Ln();\r\n}", "public function addColumn(Table $table, Column $column) {\n $suffix = '';\n if($column->getAutoIncrement()) {\n $suffix = 'PRIMARY KEY';\n }\n $sql = sprintf(config('sql.column.add'), $table->getName(), $this->column($column), $suffix);\n $sql .= \"\\n\";\n return $sql;\n }", "public function fetchCol($columnName);", "public function addColumn(Property $property);", "public function custom_column($column)\n\t\t{\n\t\t\tglobal $post;\n\n\t\t\tswitch ($column) {\n\t\t\t\tcase \"offer_thumbnail\":\n\t\t\t\t\tif (has_post_thumbnail()) {\n\t\t\t\t\t\tthe_post_thumbnail('50x50');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"offer_types\":\n\t\t\t\t\techo get_the_term_list($post->ID, 'offer-types', '', ', ', '');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"offer_order\":\n\t\t\t\t\techo esc_attr($post->menu_order);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "protected function addColumn($table, $column, $alias)\n {\n if(!$this->checkColumn($table, $column, $alias)){\n array_push($this->columns, new Column($column, $alias, $table));\n }\n }", "public function getColumnDefinition($column){ }", "function select() {\n return \"\n contact_a.id AS contact_id,\n contact_a.contact_sub_type AS contact_sub_type,\n contact_a.sort_name AS sort_name,\n source,\n created_date,\n modified_date\n \";\n }", "public static function addColumn($newCol, $type, $require){\n\t\t//this allows us to add column.\n\t\t//self::$db_fields = array_slice($db_fields, 0, $col, true) + array($newCol)\n\t\t//\t\t+ array_slice($db_fields, $col, count($db_fields) -1, true); //incorporate after for now add to end.\n\t\t\n\t\t//assume $newCol must be typed like lower case and with underscore cant start with number etc. (can't contain number? safer)\n\t\t// or catch error and say, invalid column name... try again.\n\t\t\n\t\t$last_element = end(self::$db_fields);\n\t\t\n\t\t//adds new column to db fields\n\t\t$temp = self::$db_fields;\n\t\tarray_push($temp, $newCol);\n\t\tself::$db_fields = $temp;\n\t\t\n\t\t//adds new required to column\n\t\t$temp = self::$required;\n\t\tarray_push($temp, $newCol);\n\t\tself::$required = $temp;\n\t\t\n\t\t//adds new data type to column\n\t\t$temp = self::$data_types;\n\t\tarray_push($temp, $newCol);\n\t\tself::$data_types = $temp;\n\t\t\n\t\t//create new attribute on the fly for each member\n\t\t//do now and have to do for each member.\n\t\tglobal $database;\n\t\t$sql = \"SELECT 'members_id' FROM members1\";\n\t\t//$result = Member::find_by_sql($sql);\n\t\t$result = $database->query($sql);\n\t\t//foreach($result as $attribute=>$value){\n\t\t\n\t\twhile($row = $database->fetch_array($result)){\n\t\t\t$id = $row['members_id'];\n\t\t\t$select = Member::find_by_id($id);\n\t\t\t$select->addAttribute($newCol, \"\"); //default attribute value??\n\t\t}\n\t\t\n\t\t//change database\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_column` VARCHAR(45) NOT NULL DEFAULT \\'default\\' AFTER `additional_info`'; //[puts default value in\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_nonnull` VARCHAR(45) NOT NULL AFTER `test_null`'; leaves column blank\n\t\t//$sql = \"ALTER TABLE `members1` ADD `test_null` VARCHAR(45) NULL AFTER `test_column`\"; //null column puts Null as entry.\n\t\t\n\t\t$data_value;\n\t\tif($type == \"Text\"){\n\t\t\t$data_value = \"TEXT CHARACTER SET utf8 COLLATE utf8_general_ci \"; //$sql = 'ALTER TABLE `members1` ADD `hilarious` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `primate`';\n\t\t}\n\t\telse if($type == \"Single\"){\n\t\t\t$data_value = \"VARCHAR(45) CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse if($type == \"Integer\"){\n\t\t\t$data_value = \"INT(11)\"; //if int not null it defaults to 0.\n\t\t}\n\t\telse if($type == \"Date\"){\n\t\t\t$data_value = \"DATE\"; //ALTER TABLE `members1` ADD `enum_test` DATE NOT NULL AFTER `yep`; //defaults to 0000-00-00 //year month day.\n\t\t}\n\t\telse{\n\t\t\techo \" error has definitely occured\";\n\t\t}\n\t\t\n\t\tif($require == 1){\n\t\t\n\t\t\t$sql = \"ALTER TABLE `\".self::$table_name.\"` \"; \n\t\t\t$sql .= \" ADD `{$newCol}` {$data_value} NOT NULL AFTER `\".$last_element.\"` \";\n\t\t}\n\t\telse{\n\t\t\t\t\t\n\t\t\t$sql = \"ALTER TABLE `\".self::$table_name.\"` \"; \n\t\t\t$sql .= \" ADD `{$newCol}` {$data_value} NULL AFTER `\".$last_element.\"` \";\n\t\t}\n\t\techo \"{$sql}\";\n\t\tif($database->query($sql)){\n\t\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t} \n\t\t\n\t}", "protected function addVirtualColumns()\n {\n \n }", "public function select($columns);", "function changeColumn($table, $oldCol, $newCol, $type=false);", "public function addFilter(Select $select, $table, $column) {\r\n $method = $this->_utils->toCamelCase($this->_operator);\r\n\r\n $this->$method($select, $this->_value, $table, $column);\r\n\r\n return $this;\r\n }", "public function addColumn( $name, $label = NULL )\n\t{\n\t\t$this->columns[ $name ] = $column = new Column( $name, $label );\n\t\treturn $column->setGrid( $this );\n\t}", "function select() {\n return \"\n contact_a.id as contact_id ,\n contact_a.contact_type as contact_type,\n contact_a.sort_name as sort_name,\n contact_a.job_title as job_title,\n contact_a.organization_name as current_employer\n \";\n }", "public function getQuerySelect() {\n return \"a.submitted_on AS `\" .$this->name .\"`\";\n }", "public static function addColumn1($newCol, $type, $require, $choices){\n\t\t//this allows us to add column.\n\t\t//self::$db_fields = array_slice($db_fields, 0, $col, true) + array($newCol)\n\t\t//\t\t+ array_slice($db_fields, $col, count($db_fields) -1, true); //incorporate after for now add to end.\n\t\t\n\t\t//assume $newCol must be typed like lower case and with underscore cant start with number etc. (can't contain number? safer)\n\t\t// or catch error and say, invalid column name... try again.\n\t\t\n\t\t$last_element = end(self::$db_fields);\n\t\t\n\t\t//adds new column to db fields\n\t\t$temp = self::$db_fields;\n\t\tarray_push($temp, $newCol);\n\t\tself::$db_fields = $temp;\n\t\t\n\t\t//adds new required to column\n\t\t$temp = self::$required;\n\t\tarray_push($temp, $newCol);\n\t\tself::$required = $temp;\n\t\t\n\t\t//adds new data type to column\n\t\t$temp = self::$data_types;\n\t\tarray_push($temp, $newCol);\n\t\tself::$data_types = $temp;\n\t\t\n\t\t//create new attribute on the fly for each member\n\t\t//do now and have to do for each member.\n\t\tglobal $database;\n\t\t$sql = \"SELECT 'members_id' FROM members1\";\n\t\t//$result = Member::find_by_sql($sql);\n\t\t$result = $database->query($sql);\n\t\t//foreach($result as $attribute=>$value){\n\t\t\n\t\twhile($row = $database->fetch_array($result)){\n\t\t\t$id = $row['members_id'];\n\t\t\t$select = Member::find_by_id($id);\n\t\t\t$select->addAttribute($newCol, \"\");\n\t\t}\n\t\t\n\t\t//change database\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_column` VARCHAR(45) NOT NULL DEFAULT \\'default\\' AFTER `additional_info`'; //[puts default value in\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_nonnull` VARCHAR(45) NOT NULL AFTER `test_null`'; leaves column blank\n\t\t//$sql = \"ALTER TABLE `members1` ADD `test_null` VARCHAR(45) NULL AFTER `test_column`\"; //null column puts Null as entry.\n\t\t\n\t\t$data_value;\n\t\tif($type == \"Enum\"){ //ALTER TABLE `members1` ADD `enum_test` ENUM('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `yep`;\n\t\t\t$temp = self::$enum_list;\n\t\t\tarray_push($temp, $newCol);\n\t\t\tself::$enum_list = $temp;\n\t\t\t\n\t\t\t$data_value = \"ENUM('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse if($type == \"Set\"){ //ALTER TABLE `members1` ADD `enum_test` SET('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `yep`;\n\t\t\t$temp = self::$set_list;\n\t\t\tarray_push($temp, $newCol);\n\t\t\tself::$set_list = $temp;\n\t\t\t\n\t\t\t$data_value = \"SET('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse{\n\t\t\techo \" error has definitely occured\";\n\t\t}\n\t\t//sql syntax would need to add values from choices array to database.\n\t\t$sql = \"ALTER TABLE \".self::$table_name.\" \"; \n\t\t$sql .= \" ADD '{$newCol}' {$data_value} \";\n\t\t\n\t\tif($database->query($sql)){\n\t\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t\n\t}", "function AddCol($field=-1,$width=-1,$caption='',$align='')\r\n{\r\n if($field==-1)\r\n $field=count($this->aCols);\r\n $this->aCols[]=array('f'=>$field,'c'=>$caption,'w'=>$width,'a'=>$align);\r\n}", "abstract public static function get_column_name(): string;", "public function updateColumn($col = array())\n {\n if (!empty($col)) {\n foreach ($col as $key => $value) {\n $this->select_list .= \"$key = \" . \"'\" . $value . \"'w,\";\n }\n }\n $this->select_list = rtrim($this->select_list, ',');\n }", "protected function createColumn()\n\t{\n\n\t\t$columnString = sprintf('`%s` %s',\n\t\t\t $this->getColumnName(),\n\t\t\t $this->getColumnType()\n\t\t );\n\n\t\treturn $columnString;\n\n\t}", "public function select($field);", "public function select($columns = array('*'));", "private function formatSelectCommand( $cols = '*', $extra = null )\n {\n $sql = 'SELECT ' . $cols . ' FROM ' . $this->table_name;\n\n if ( $extra != null )\n $sql .= ' ' . $extra;\n\n return $sql;\n }", "public function addColumn(ColumnReflection $column)\n\t{\n\t\t$this->columns[$column->getName()] = $column;\n\n\t\tif ( !$column->exists() ) {\n\t\t\t$this->driver->addColumn($column);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function testBuildSelectWithAddFieldExpression()\n {\n $query = $this->getQuery()\n ->addField(Expression::apishka('NOW()'), 'current_time')\n ;\n\n $this->assertSame(\n '*, NOW() AS current_time',\n $query->buildSelectFields()\n );\n }", "function add_column_if_not_exist($dbtable, $column, $column_attr = \"varchar( 255 ) NULL\" ) {\n $exists = false;\n $columns = mysql_query(\"show columns from $dbtable\");\n while ($c = mysql_fetch_assoc($columns)) {\n if($c['Field'] == $column) {\n $exists = true;\n break;\n }\n } \n if (!$exists) {\n mysql_query(\"ALTER TABLE `$dbtable` ADD `$column` $column_attr\");\n }\n }", "public function addColumn($columnName, $type = null, $options = [])\r\n {\r\n }", "public function addColumn( $table, $definition )\n\t{\n\t\treturn $this->query( \"ALTER TABLE `{$this->prefix}{$this->escape_string( $table )}` ADD COLUMN {$this->compileColumnDefinition( $definition )}\" );\n\t}", "protected function setUpOldColumn()\n {\n return new Column('foo', Type::getType(Type::STRING));\n }", "private function addColumn($field, $type = \"migration\", $meta = \"\")\n {\n\n\n if ($type == 'migration') {\n\n $syntax = sprintf(\"\\$table->%s('%s')\", $field['type'], $field['name']);\n\n // If there are arguments for the schema type, like decimal('amount', 5, 2)\n // then we have to remember to work those in.\n if ($field['arguments']) {\n $syntax = substr($syntax, 0, -1) . ', ';\n\n $syntax .= implode(', ', $field['arguments']) . ')';\n }\n\n foreach ($field['options'] as $method => $value) {\n $syntax .= sprintf(\"->%s(%s)\", $method, $value === true ? '' : $value);\n }\n\n $syntax .= ';';\n\n\n } elseif ($type == 'view-index-header') {\n\n // Fields to index view\n $syntax = sprintf(\"<th>%s\", strtoupper($field['name']));\n $syntax .= '</th>';\n\n } elseif ($type == 'view-index-content') {\n\n // Fields to index view\n $syntax = sprintf(\"<td>{{\\$%s->%s\", $meta['var_name'], strtolower($field['name']));\n $syntax .= '}}</td>';\n\n } elseif ($type == 'view-show-content') {\n\n // Fields to show view\n $syntax = sprintf(\"<div class=\\\"form-group\\\">\\n\" .\n str_repeat(' ', 21) . \"<label for=\\\"%s\\\">%s</label>\\n\" .\n str_repeat(' ', 21) . \"<p class=\\\"form-control-static\\\">{{\\$%s->%s}}</p>\\n\" .\n str_repeat(' ', 16) . \"</div>\", strtolower($field['name']), strtoupper($field['name']), $meta['var_name'], strtolower($field['name']));\n\n\n } elseif ($type == 'view-edit-content') {\n $syntax = $this->buildField($field, $type, $meta['var_name']);\n } elseif ($type == 'view-create-content') {\n $syntax = $this->buildField($field, $type, $meta['var_name'], false);\n } else {\n // Fields to controller\n $syntax = sprintf(\"\\$%s->%s = \\$request->input(\\\"%s\", $meta['var_name'], $field['name'], $field['name']);\n $syntax .= '\");';\n }\n\n\n return $syntax;\n }", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "public function render_admin_table_column($column_name, $field_group)\n {\n }", "protected function getColumn()\n {\n return DB::select(\n 'SELECT\n\t\t\t\t\t\t\t c.COLUMN_NAME\n\t\t\t\t\t\t\t,c.COLUMN_DEFAULT\n\t\t\t\t\t\t\t,c.IS_NULLABLE\n\t\t\t\t\t\t\t,c.DATA_TYPE\n\t\t\t\t\t\t\t,c.CHARACTER_MAXIMUM_LENGTH\n\t\t\t\t\t\t\t,pk.CONSTRAINT_TYPE AS EXTRA\n\t\t\t\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS AS c\n\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME, tc.CONSTRAINT_TYPE\n\t\t\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc\n\t\t\t\t\t\t\t INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku ON tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME\n\t\t\t\t\t\t\t) AS pk ON c.TABLE_CATALOG = pk.TABLE_CATALOG\n\t\t\t\t\t\t\t AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA\n\t\t\t\t\t\t\t AND c.TABLE_NAME = pk.TABLE_NAME\n\t\t\t\t\t\t\t AND c.COLUMN_NAME = pk.COLUMN_NAME\n\t\t\t\t\t\t\tWHERE c.TABLE_NAME = ? AND c.TABLE_CATALOG = ? ',\n [$this->tableName, $this->databaseName]\n );\n }" ]
[ "0.81049573", "0.70640635", "0.6766006", "0.6566005", "0.65032744", "0.6495493", "0.6471617", "0.6420811", "0.6388387", "0.6356441", "0.63359874", "0.63029873", "0.62969464", "0.61852556", "0.61820656", "0.61818224", "0.6107336", "0.6072099", "0.60608125", "0.6060768", "0.6053044", "0.60522914", "0.5992934", "0.59537095", "0.59520024", "0.5936553", "0.5930612", "0.5865355", "0.58501273", "0.5826426", "0.5802831", "0.57809544", "0.57753503", "0.5760943", "0.57440853", "0.5743013", "0.5742465", "0.5737364", "0.5732255", "0.5721035", "0.5711981", "0.5697661", "0.5690214", "0.56799084", "0.56768525", "0.5662178", "0.56552124", "0.5644976", "0.56291175", "0.56281364", "0.5627191", "0.5620067", "0.5604354", "0.5603623", "0.5602213", "0.56003505", "0.557978", "0.5572946", "0.55607986", "0.5558809", "0.5535524", "0.55347794", "0.5526112", "0.5525782", "0.552191", "0.552136", "0.5514953", "0.55073714", "0.5494911", "0.5482367", "0.548099", "0.5469843", "0.54610556", "0.54600865", "0.54454887", "0.5444464", "0.5439893", "0.5439791", "0.54366183", "0.5430513", "0.54235697", "0.5421661", "0.54185337", "0.5416899", "0.5412466", "0.5410314", "0.54094493", "0.5403249", "0.54015845", "0.53983635", "0.53927064", "0.5386373", "0.5384455", "0.5364335", "0.5363931", "0.5362889", "0.5357234", "0.5357021", "0.5353167", "0.5351098" ]
0.5866112
27
Reset all binds list
public function reset_binds( $key = null ) { if ($key == null) { $this->binds = array(); } else { $this->binds[ $key ] = array(); } return $this->binds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clean_binds()\r\n {\r\n foreach ($this->binds as &$value) {\r\n $value = array();\r\n }\r\n }", "public function clearRootBindings();", "function unbindAll() {\n foreach (array(\n 'hasOne' => array_keys($this->hasOne),\n 'hasMany' => array_keys($this->hasMany),\n 'belongsTo' => array_keys($this->belongsTo),\n 'hasAndBelongsToMany' => array_keys($this->hasAndBelongsToMany)\n ) as $relation => $model) {\n $this->unbindModel(array($relation => $model));\n }\n }", "function reset()\n {\n $this->mBlockHandles = array();\n $this->mBlockKeys = array();\n $this->mGlobalAssignArray = array();\n }", "public function clearRootBindingTypes();", "public static function reset()\n {\n $container = static::getInstance();\n $container->values = array();\n $container->factories = array();\n $container->raw = array();\n }", "public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }", "function reset(){\n\t\t$this->__columns = array();\n\t\t$this->__actions = array();\n\t}", "public function reset() {\n\t\t$this->registered = array();\n\t}", "public function reset()\n {\n $this->values[self::services] = array();\n $this->values[self::mapping] = array();\n $this->values[self::short_tcp] = self::$fields[self::short_tcp]['default'];\n }", "public function reset() {\n $this->num_aliases = 0;\n $this->alias2class = array();\n $this->alias2table = array();\n }", "private function reset()\n\t{\t\t\n\t\t$this->limit = null;\n\t\t\n\t\t$this->table = null;\n\t\t\n\t\t$this->offset = null;\n\t\t\n\t\t$this->data = [];\n\t\t\n\t\t$this->joins = [];\n\t\t\n\t\t$this->wheres = [];\n\t\t\n\t\t$this->orderBy = [];\n\t\t\n\t\t$this->selects = [];\n\t\t\n\t\t$this->bindings = [];\n\t\t\t\n\t}", "public static function reset()\n\t{\n\t\tstatic::$instances = [];\n\t}", "public function resetWhere()\n\t{\n\t\t$this->wheres = array();\n\t\t$this->bindings = array();\n\t}", "public static function resetAll(): void\n {\n static::getFacadeRoot()->resetAll();\n }", "public function reset()\n {\n $this->values[self::ip] = null;\n $this->values[self::port] = null;\n $this->values[self::module] = null;\n }", "public function resetScope();", "public static function reset() {\n\t\tself::$objects = array();\n\t}", "public function clear() {\n\t\t$this->backends = [];\n\t\t$this->initializedBackends = [];\n\t}", "public static function reset()\n {\n self::resetDefault();\n self::$instances = array();\n }", "public function reset(): void\n {\n $this->_add = new SplObjectStorage();\n $this->_delete = new SplObjectStorage();\n }", "public function reset()\n\t{\n\t\t$this->queries = [];\n\t\t$this->count = [\n\t\t\t'total' => 0, 'slow' => 0, 'select' => 0, 'insert' => 0, 'update' => 0, 'delete' => 0, 'other' => 0\n\t\t];\n\n\t\t$this->modelsActions = [];\n\t\t$this->modelsCount = [\n\t\t\t'retrieved' => [], 'created' => [], 'updated' => [], 'deleted' => []\n\t\t];\n\n\t\t$this->nextQueryModel = null;\n\t}", "public function reset()\n {\n $this->env = array();\n $this->object_handlers = array();\n $this->pagetitle = '';\n }", "private function reset(){\n\n\t\tforeach($this as $k=>$v) unset($this->$k);\n\n\t\t$this::$map = $this->maper();\n\n\t\t$this->name = \"\";\n\n\t\t$this->address = [];\n\n\t\t$this->tableclass();\n\n\t}", "public static function reset()\n {\n if (self::$_instance != null) {\n self::$_instance->_wrapperRegistry = array();\n }\n self::$_instance = null;\n }", "public function reset()\n {\n $this->values[self::_GUILDS] = array();\n $this->values[self::_RESULT] = null;\n $this->values[self::_CREATE_COST] = null;\n }", "public function reset() {\n\t\t\t$this->arList = NULL; \t\n\t\t}", "public function resetRelations()\n\t{\n\t\t$this->relations = array();\n\t}", "public function clearBehaviors()\n\t{\n\t\tif($this->_m!==null)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $name=>$behavior)\n\t\t\t\t$this->detachBehavior($name);\n\t\t\t$this->_m=null;\n\t\t}\n\t}", "public function reset()\n {\n $this->values[self::_INSTANCE_INFO] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n $this->values[self::_HP_DROP] = array();\n }", "public function resetAllBreakpoints();", "public function reset()\n {\n $this->values[self::_BATTLES] = array();\n }", "public function reset() {\n\t\tforeach (array_reverse($this->_callStack) as $call) {\n\t\t\tcall_user_func_array(array($this, \"_reset\" . ucfirst($call['method'])), $call['arguments']);\n\t\t}\n\t}", "protected function reset() {\n\t\t$this->data = array();\n\t}", "public static function reset()\n {\n self::$toLoad = array();\n }", "public function reset(){}", "public function resetLookupCollections()\n\t{\n\t\t$this->lookupCollections[] = null;\n\t}", "public function resetHelperMocks()\n {\n $names = array_keys($this->_registeredHelperMocks);\n foreach ($names as $n) {\n $this->unsetHelper($n);\n }\n }", "public function reset()\n {\n $this->values[self::PORTLIST] = null;\n $this->values[self::TIMEOUTLIST] = null;\n $this->values[self::MIMNOOPINTERVAL] = null;\n $this->values[self::MAXNOOPINTERVAL] = null;\n $this->values[self::TYPINGINTERVAL] = null;\n $this->values[self::NOOPINTERVALTIME] = null;\n }", "protected function resetQuery()\n {\n $this->bindings = [];\n $this->types = [];\n }", "public function reset()\n {\n $this->_metaData = array();\n $this->_columnMap = array();\n }", "public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }", "public function reset()\n {\n $this->values[self::_SAY] = null;\n $this->values[self::_FRESH] = null;\n $this->values[self::_FETCH] = null;\n $this->values[self::_CHAT_ADD_BL] = null;\n $this->values[self::_CHAT_DEL_BL] = null;\n $this->values[self::_CHAT_BLACKLIST] = null;\n $this->values[self::_CHAT_BORAD_SAY] = null;\n }", "public function reset() {\n $this->_events->reset();\n }", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "protected function resetSingletons() {}", "function reset() {\n\t\tparent::_resetSet();\n\t}", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function detachAll() {}", "public function reset() {\n $this->setEntities([]);\n $this->setLinks([]);\n $this->setMetadata([]);\n $this->setIncludes([]);\n $this->setDynamic();\n $this->setCacheability(new CacheableMetadata());\n }", "public function reset()\n {\n $this->values[self::_DIAMOND] = null;\n $this->values[self::_GUILDPOINT] = null;\n $this->values[self::_DPS] = null;\n $this->values[self::_OLD_DPS] = null;\n $this->values[self::_OLD_SUMMARY] = null;\n }", "public function reset()\n {\n $this->values[self::_REWARDS] = array();\n }", "public function reset()\n {\n $this->values[self::_OPEN_PANEL] = null;\n $this->values[self::_QUERY_OPPO] = null;\n $this->values[self::_START_BAT] = null;\n $this->values[self::_END_BAT] = null;\n $this->values[self::_RESET] = null;\n $this->values[self::_DRAW_REWARD] = null;\n }", "public function reset()\n {\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_NUM] = null;\n $this->values[self::_STATE] = null;\n $this->values[self::_APPLY_NUM] = null;\n $this->values[self::_ABLE_APP_COUNT] = null;\n }", "public function reset(): void\n {\n $this->set([]);\n }", "public function resetSingletonMocks()\n {\n $names = array_keys($this->_registeredSingletonMocks);\n foreach ($names as $n) {\n $this->unsetSingleton($n);\n }\n }", "public function reset()\n {\n $this->values[self::_ITEM_IDS] = array();\n $this->values[self::_NEW_HEROES] = array();\n $this->values[self::_SMASH_IDX] = array();\n }", "public function clear()\n {\n foreach ($this->backends as $b) {\n $b->clear();\n }\n }", "public function reset()\n {\n $this->values[self::_ITEM_HISTORYS] = array();\n }", "protected function reset() {}", "protected function reset() {}", "protected function reset() {}", "public function reset()\n {\n $this->values[self::_ITEMS] = array();\n $this->values[self::_RAID_ID] = null;\n $this->values[self::_APPLY_ITEM_ID] = null;\n $this->values[self::_RANK] = null;\n }", "public function reset()\n {\n $this->values[self::_TEAMS] = array();\n $this->values[self::_REWARD] = null;\n $this->values[self::_GUESS] = null;\n }", "public function reset()\n {\n $this->values[self::_RAID_ID] = null;\n $this->values[self::_DPS_LIST] = array();\n $this->values[self::_ITEM_INFO] = array();\n }", "public static function reset($destroyObjects = TRUE) {\n foreach (self::$connections as $object) {\n if ($destroyObjects) $object->destroy();\n self::unregisterObject($object);\n }\n self::$drivers = array();\n self::$connections = array();\n }", "public function reset()\n {\n $this->id = null;\n $this->attributes = array();\n }", "function reset(){\n for( $x=count($this->ctx)-1; $x>=1; $x-- ){ // skip _ROOT_\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'] = array();\n return;\n }\n }\n }", "public function reset()\n {\n $this->values[self::_GUILDS] = null;\n $this->values[self::_RESULT] = null;\n $this->values[self::_CREATE_COST] = null;\n }", "public static function reset()\n\t{\n\t\tself::engine()->reset();\n\t}", "public function reset() : void {\n\t\tforeach ($this->propertyMap as $propertyName => $dbName) {\n\t\t\t$this->{$propertyName} = null;\n\t\t}\n\t}", "public function unsetAll() {\n\t\tparent::unsetAll();\n\t}", "public function reset()\n {\n $this->values[self::_USERS] = array();\n $this->values[self::_HIRE_UIDS] = array();\n $this->values[self::_FROM] = null;\n }", "public function reset()\n {\n $this->values[self::_LOOT] = array();\n $this->values[self::_ITEMS] = array();\n $this->values[self::_SHOP] = null;\n $this->values[self::_SSHOP] = null;\n }", "public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }", "public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }", "public function resetCollectionsForPersist()\n {\n $this->containers = new ArrayCollection();\n $this->functions = new ArrayCollection();\n $this->constants = new ArrayCollection();\n }", "public function reset()\n {\n $this->data = array();\n }", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function refresh()\n {\n $this->_totalCount = null;\n $this->_models = null;\n $this->_keys = null;\n }" ]
[ "0.7603164", "0.736864", "0.71841294", "0.68458885", "0.66105586", "0.64700776", "0.6469926", "0.64404434", "0.6417248", "0.6375447", "0.6364383", "0.63069266", "0.62984943", "0.62854344", "0.6273489", "0.6240372", "0.6222277", "0.62164605", "0.62130105", "0.617965", "0.617862", "0.613078", "0.6127526", "0.6126542", "0.61152744", "0.6108282", "0.6102912", "0.6101126", "0.6098023", "0.609326", "0.60920495", "0.60745436", "0.607112", "0.6049352", "0.6047762", "0.6046481", "0.60301423", "0.60287994", "0.6021971", "0.6018853", "0.6014319", "0.60095453", "0.600672", "0.6005953", "0.6003437", "0.60011834", "0.5999649", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5998861", "0.5989139", "0.59887815", "0.598843", "0.5981749", "0.59790623", "0.59766227", "0.5972523", "0.597181", "0.5969107", "0.5967197", "0.59628767", "0.59616953", "0.5961612", "0.5961557", "0.59540486", "0.595191", "0.5948845", "0.5947962", "0.5945648", "0.59343606", "0.59328264", "0.5927829", "0.5900729", "0.5893104", "0.5891215", "0.58884037", "0.58808285", "0.58808285", "0.58801454", "0.5875943", "0.58705294", "0.58705294", "0.58705294", "0.58705294", "0.58705294", "0.58705294", "0.58705294", "0.5870439", "0.5870439", "0.5870439", "0.5862165" ]
0.6602003
5
Clean all elements of the binds.
public function clean_binds() { foreach ($this->binds as &$value) { $value = array(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearRootBindings();", "function unbindAll() {\n foreach (array(\n 'hasOne' => array_keys($this->hasOne),\n 'hasMany' => array_keys($this->hasMany),\n 'belongsTo' => array_keys($this->belongsTo),\n 'hasAndBelongsToMany' => array_keys($this->hasAndBelongsToMany)\n ) as $relation => $model) {\n $this->unbindModel(array($relation => $model));\n }\n }", "public function clean()\n\t{\n\t\tforeach ($this->dirtyFields AS $field)\n\t\t\t$this->cleanField($field);\n\t}", "public function unsetAll() {\n\t\tparent::unsetAll();\n\t}", "public function clearAttributes ()\n {\n\n $this->attributes = null;\n $this->attributes = array();\n\n }", "public function clearRootBindingTypes();", "public function clear() {\n $this->elements = array();\n }", "public function clear(): void {\n\t\t$this->m_elements = [];\n\t}", "public function clean();", "public function clean();", "public function clean();", "public function clean();", "public function clean();", "public function detachAll() {}", "public function clear() \r\n {\r\n unset($this->elements);\r\n $this->elements = array();\r\n }", "function clear()\n \t{\n \t\tforeach ($this as &$value) \n \t\t $value = null;\n \t}", "public function clean() {\n $this->data = \"\";\n $this->currentRow = 1;\n $this->curPosition = 0;\n }", "protected function clear()\n {\n $this->innerHtml = null;\n $this->outerHtml = null;\n $this->text = null;\n }", "public function removeAll()\n\t{\n\t\t$this->clear();\n\n\t\t$this->values = array();\n\t}", "public function clear()\r\n\t{\r\n\t\t$this->isLoaded = false;\r\n\t\t$this->elements = array();\r\n\t\t$this->keyAssocation = array();\r\n\t\t$this->i = 0;\r\n\t\t$this->count = 0;\r\n\t}", "public function clean()\n {\n\n $this->tokens = [];\n $this->rawMatches = [];\n\n }", "function clear()\r\n\t\t{\r\n\t\t\t$this->elements = array();\r\n\t\t}", "public function clean()\n {\n\n $this->model = null;\n $this->value = null;\n $this->attribute = null;\n $this->data = [];\n\n $this->fkTable = null;\n\n $this->fkQuery = null;\n $this->fkAndQuery = null;\n $this->fkOrQuery = null;\n\n }", "public function unsetAllAttributeValue()\n {\n foreach ($this->attributes as $key=>$val) {\n $this->$key = null;\n }\n }", "public function clean()\n\t{\n\t\t$this->deleteFromContainer($this->binary);\n\t}", "public function clear()\n {\n $this->inputFieldsGroup->clear();\n $this->inputFilesGroup->clear();\n $this->inputImagesGroup->clear();\n $this->inputConditionsGroup->clear();\n }", "public function removeAll () {\n\t\t$this->exchangeArray(array());\n\t}", "function cleanup()\n {\n if (is_object( $this->roottag )) {\n $this->roottag->clear_subtags();\n }\n }", "public function unpopulate();", "function clearContainer()\r\n {\r\n foreach ($this->container as $k => $v)\r\n unset($this->container[$k]);\r\n }", "public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }", "public function cleanup()\n {\n // Remove old parts without binaries \n $this->removePartsWithoutBinary();\n \n // Remove parts where the binary is missing\n $this->removePartsWithMissingBinary();\n \n // Remove binaries without parts\n $this->removeBinariesWithoutParts();\n }", "public function remove_all_data()\n\t{\n\t\t$this->_data = array();\n\t}", "public function clear()\n {\n foreach ($this->backends as $b) {\n $b->clear();\n }\n }", "public function unsetAll()\n {\n parent::unsetAll();\n $this->_quoteId = null;\n $this->_response = null;\n $this->_redirectMessage = null;\n $this->_redirectTitle = null;\n }", "public function removeAllAttributes()\n {\n $this->attr = [];\n }", "public function clean() {}", "function Clean()\n\t{\n\t\t$this->_arrRows\t\t\t\t= Array();\n\t\t$this->_arrHeader\t\t\t= Array();\n\t\t$this->_arrWidths\t\t\t= Array();\n\t\t$this->_arrAlignments\t\t= Array();\n\t\t$this->_arrLinkedTables\t\t= Array();\n\t\t$this->_bolRowHighlighting\t= FALSE;\n\t\t$this->_bolDetails\t\t\t= FALSE;\n\t\t$this->_bolToolTips\t\t\t= FALSE;\n\t\t$this->_bolLinked\t\t\t= FALSE;\n\t\t$this->_intCurrentRow\t\t= NULL;\n\t}", "public function clearBehaviors()\n\t{\n\t\tif($this->_m!==null)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $name=>$behavior)\n\t\t\t\t$this->detachBehavior($name);\n\t\t\t$this->_m=null;\n\t\t}\n\t}", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "protected function _clear()\n\t{\n\t\t$this->_query = null;\n\t\t$this->_set = null;\n\t\t$this->_where = null;\n\t\t$this->_limit = null;\n\t}", "public function clearAll() {}", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public abstract function clean();", "public static function clean()\n\t{\n\t}", "abstract public function clean();", "public function clearAll();", "public function clearAll();", "private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }", "private function desabilitaPoolIdsObjetosManipulados()\n {\n \t// setando para null o atributo _arrayObjetosManipulados\n \t$this->_arrayObjetosManipulados = null;\n }", "public function clear(): void\n {\n unset($this->root);\n unset($this->nodes);\n\n $this->root = null;\n $this->nodes = [];\n }", "public function clear() {\n foreach ($this->Fields as $key => $item) {\n $this->$key = null;\n }\n }", "public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}", "final public static function clear() {\n static::free_all();\n }", "public function clear()\n\t{\n\t\t$this->stmt = null;\n\t\t$this->str = null;\n\t}", "protected function _clean()\r\n\t{\r\n\t\t$this->taintValue = null;\r\n\t\t$this->normalizedValue = null;\r\n\t\r\n\t\t$this->parameterInfo = null;\r\n\t\t$this->bFetched = false;\r\n\t\t\r\n\t\t$this->validationInfo = null;\r\n\t\t$this->isValid = false;\r\n\t}", "private function unsetAll() {\n $ref = new ReflectionClass( $this );\n foreach ( $ref->getProperties() as $key => $value ) {\n $value = $value->getName();\n if ( in_array($value, array('_mysqlCharset', '_mysqlEngine', '_arraySplitChar', '_dbObject', '_singletonThis', '_dbConfig', '_lastQuery')) ) {\n continue;\n }\n\n $this->$value = NULL;\n }\n\n return $this;\n }", "protected function clearEmptyXMLData()\n {\n $emptyFields = array();\n foreach ($this->xml as $field => $value) {\n if ($value == '') {\n $emptyFields[] = $field;\n }\n }\n\n foreach ($emptyFields as $field) {\n unset($this->xml->{$field});\n }\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "public function cleanUp()\n {\n $this->_value = null;\n }", "public function clear_all()\n {\n }", "public function removeAllButtons()\n {\n $this->mixButtons = array();\n $this->blnValidationArray = array();\n $this->blnModified = true;\n }", "function clearAttributes()\n {\n $this->arrRelations = array();\n return true;\n }", "public function clear() {\n\t\t$this->backends = [];\n\t\t$this->initializedBackends = [];\n\t}", "public function removeAll()\n {\n foreach ($this->findAll() as $object) {\n $this->remove($object);\n }\n }", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }", "abstract function clean ();", "public function clean()\n {\n // Set to default values\n $this->sSql = '';\n $this->aValues = [];\n }", "public static function cleanAllLists() {\r\n \tself::$list=array();\r\n }", "protected function cleanBindings(array $bindings): array\n {\n return array_filter($bindings, static function ($binding) {\n return !$binding instanceof Expression;\n });\n }", "public function cleanup() : void\n {\n unset($this->groups);\n }", "public static function reset()\n {\n $container = static::getInstance();\n $container->values = array();\n $container->factories = array();\n $container->raw = array();\n }", "public function clear()\n {\n $this->sql = '';\n $this->columns = array();\n $this->values = array();\n }", "public function cleanCurrent() {}", "protected function clear() {}", "function clear_all () {\n $this->clear_to();\n $this->clear_cc();\n $this->clear_bcc();\n $this->all_emails = array();\n }", "private function clear() {\n $this->select = null;\n $this->where = null;\n $this->order_by = array();\n $this->group_by = '';\n $this->join = array();\n $this->limit = '';\n $this->where_in = null;\n }", "public function clear() {\n\t\t$this->_where\t\t= array();\n\t\t$this->_order\t\t= array();\n\t\t$this->_isAddingNew\t= false;\n\t\t$this->_currentRow\t= 0;\n\t\t$this->_relationship\t= array();\n\t\t$this->_recordset\t= array();\n\t\t$this->_updateBuffer\t= array();\n\t\t$this->_limit\t\t= NULL;\n\t\t$this->_offset\t\t= NULL;\n\t\t$this->isDirty( false );\n\t}", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "protected function resetElementsToBeDeleted() {}", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "public function clearModels();", "public function clear(): void\n {\n $this->items = collect();\n\n $this->save();\n }", "public function clearMembros()\n\t{\n\t\t$this->collMembros = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function clear()\r\n\t{\r\n\t\t// Clear the all list\r\n\t\t$this->all = array();\r\n\r\n\t\t// Clear errors\r\n\t\t$this->error = new stdClass();\r\n\t\t$this->error->all = array();\r\n\t\t$this->error->string = '';\r\n\r\n\t\t// Clear this objects properties and set blank error messages in case they are accessed\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\t$this->{$field} = NULL;\r\n\t\t\t$this->error->{$field} = '';\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has many\" related objects\r\n\t\tforeach ($this->has_many as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has one\" related objects\r\n\t\tforeach ($this->has_one as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear the query related list\r\n\t\t$this->query_related = array();\r\n\r\n\t\t// Clear and refresh stored values\r\n\t\t$this->stored = new stdClass();\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\t}", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "private function resetAll()\n {\n $this->title = null;\n $this->caption = null;\n $this->categories = null;\n $this->image = null;\n $this->tags = null;\n $this->imagePath = null;\n $this->postId = null;\n }", "public function clearAll() {\n $this->param = array();\n $this->method_map = array();\n $this->response = NULL;\n $this->query = '';\n }", "public function clear(): void\n {\n $this->items = [];\n $this->length = 0;\n $this->cursor = 0;\n }", "public function clear()\n\t{\n\t\tforeach($this->all() as $ip)\n\t\t{\n\t\t\t$this->delete($ip['ip_address']);\n\t\t}\n\t}", "public function clean() {\n\t\t\n\t}", "public function reset()\n {\n $this->id = null;\n $this->attributes = array();\n }", "public function clear() {\n $this->_documentBoost = FALSE;\n\n $this->_fields = array();\n $this->_fieldBoosts = array();\n }", "protected function _cleanContexts(){\n\n //remove no more present contexts\n foreach( $this->_destroyContext as $_context ){\n\n self::_TimeStampMsg( \"(parent \" . self::$tHandlerPID . \") : need to delete a context\" );\n $this->_killPids( $_context );\n\n }\n $this->_destroyContext = array();\n\n }", "public function clearModified()\n\t{\n\t\t$this->_modified = array();\n\t}", "private function reset(){\n\n\t\tforeach($this as $k=>$v) unset($this->$k);\n\n\t\t$this::$map = $this->maper();\n\n\t\t$this->name = \"\";\n\n\t\t$this->address = [];\n\n\t\t$this->tableclass();\n\n\t}", "public static function removeAll(){\n\n foreach(static::all() as $key => $value){\n static::remove($key);\n }\n }", "protected function _clean()\n {\n if ($this->_defaultOptions['clean'] === FALSE) {\n return;\n }\n\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'remove unused markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $this->_cleanMarkers('loop');\n $this->_cleanMarkers('optional');\n\n $this->DISPLAY = preg_replace(\n $this->_contentMarkers,\n '',\n $this->DISPLAY\n );\n }" ]
[ "0.68631226", "0.64957654", "0.6461927", "0.62880623", "0.6268342", "0.62313163", "0.6220295", "0.6179055", "0.6162704", "0.6162704", "0.6162704", "0.6162704", "0.6162704", "0.61246485", "0.6109071", "0.61072737", "0.6103128", "0.60998183", "0.60928905", "0.60844046", "0.6045514", "0.5999828", "0.5969386", "0.5968368", "0.59532094", "0.59413606", "0.5935092", "0.59256834", "0.5919873", "0.59176636", "0.59172505", "0.5894951", "0.5882577", "0.5870339", "0.58675396", "0.58649457", "0.5841522", "0.5830674", "0.5804655", "0.5803743", "0.5796885", "0.57860583", "0.5776568", "0.5776568", "0.577637", "0.57732326", "0.5769009", "0.5764662", "0.5764662", "0.57540447", "0.5753601", "0.57526827", "0.5751263", "0.5736907", "0.57300526", "0.57231915", "0.5715444", "0.57104707", "0.5681248", "0.56809133", "0.56802046", "0.5673481", "0.56591266", "0.5652321", "0.56516004", "0.5650516", "0.56486195", "0.56383026", "0.5634178", "0.5633984", "0.5632407", "0.5622651", "0.5620543", "0.5619375", "0.56102204", "0.56081986", "0.5597752", "0.5589703", "0.55853003", "0.55844516", "0.5567993", "0.5566507", "0.55558604", "0.5548316", "0.5546056", "0.55441064", "0.5538851", "0.55344146", "0.5531705", "0.5525541", "0.5525308", "0.5520553", "0.5517923", "0.5516691", "0.5509943", "0.55083865", "0.55059993", "0.5505493", "0.55015624", "0.5500341" ]
0.77769774
0
Get an/all element(s) from binds list
public function get_binds($key = null) { if ($key == null) { return $this->binds; } return $this->binds[ $key ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBinds(): array;", "public function getBindValues();", "public function getBindings();", "public function getBindings(): array;", "public function bindings();", "public function getBind();", "public function get_binds(){\n\t\treturn $this->binds;\n\t}", "public function get_binds_values()\r\n {\r\n return array_values_recursive_with_keys($this->binds);\r\n }", "public function get_all_ip_binding(){\n return $this->query('/ip/hotspot/ip-binding/getall');\n }", "function getMany($query, array $binds = [], $conn)\n{\n $statement = $conn->prepare($query);\n foreach($binds as $key => $value) {\n $statement->bindValue($key, $value);\n }\n $statement->execute();\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return $results;\n}", "public function getBindVars(): array\n {\n return $this->container->getAll();\n }", "public function bindIn(&...$binds);", "public function getBindings(): array\n {\n return $this->bindings;\n }", "public function getBind() {\n return $this->aBind;\n }", "public function getBindings()\n {\n return $this->bindings;\n }", "public function getBindings()\n {\n return $this->bindings;\n }", "public function bindings(): array\n {\n return $this->bindings;\n }", "public function getBindings()\n {\n $bindings = [];\n\n // We will run through all the bindings and pluck out\n // the component (select, where, etc.)\n foreach ($this->bindings as $component => $binding) {\n if (!empty($binding)) {\n // For every binding there could be multiple\n // values set so we need to add all of them as\n // flat $key => $value item in our $bindings.\n foreach ($binding as $key => $value) {\n $bindings[$key] = $value;\n }\n }\n }\n\n return $bindings;\n }", "public function getBoundVariables() {}", "public function bind(array $bindings);", "private function getBindingsCollection(): ?Collection\n\t{\n\t\treturn $this->entityObject->get($this->fieldNameMap->getBindings());\n\t}", "public function findBindings(Expression $expr);", "public function getAllBindings(): array\n {\n return array_merge(\n array_values($this->sockets),\n array_values($this->streams),\n array_values($this->signals),\n array_values($this->timers)\n );\n }", "function getBindVariableName() ;", "public function bound () :array\n {\n return [\n\n ];\n }", "public function getBind(string $name): mixed;", "protected function find_binds(){\n\t\tif ( $this->has_tags() ) {\n\t\t\tforeach ( $this->tags[1] as $tag_key => $tag ) {\n\t\t\t\tforeach ( $this->form[ 'fields' ] as $key_id => $fcfg ) {\n\t\t\t\t\t//don't sync to self\n\t\t\t\t\tif ( $key_id == $this->field_base_id ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $fcfg[ 'slug' ] === $tag ) {\n\t\t\t\t\t\t$this->handle_match( $key_id, $tag_key );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "private function getAttachedKeysFromRelation($bind, string $name): ?array\n {\n if (!$bind instanceof Model) {\n return data_get($bind, $name);\n }\n\n $relation = $bind->{$name}();\n\n if ($relation instanceof BelongsToMany) {\n $relatedKeyName = $relation->getRelatedKeyName();\n\n return $relation->getBaseQuery()\n ->get($relation->getRelated()->qualifyColumn($relatedKeyName))\n ->pluck($relatedKeyName)\n ->all();\n }\n\n if ($relation instanceof MorphMany) {\n $parentKeyName = $relation->getLocalKeyName();\n\n return $relation->getBaseQuery()\n ->get($relation->getQuery()->qualifyColumn($parentKeyName))\n ->pluck($parentKeyName)\n ->all();\n }\n\n return data_get($bind, $name);\n }", "protected function _bind($bind)\r\n {\r\n if ($bind === null) {\r\n return null;\r\n }\r\n if (!is_array($bind)) {\r\n $bind = [$bind];\r\n }\r\n return $bind;\r\n }", "public function getElements();", "protected function get_bindings(): array {\n\t\treturn [];\n\t}", "public function bindOut(&...$binds);", "public function bindValues()\n {\n $ret = [];\n\n if ($this->data)\n {\n $ret = \\array_values($this->data);\n }\n\n if ($this->getWhereValues())\n {\n $ret = \\array_merge($ret, $this->getWhereValues());\n }\n\n return Utils::arrayFlatten($ret);\n }", "public static function getBindings(){\n //Method inherited from \\Illuminate\\Container\\Container \n return \\Illuminate\\Foundation\\Application::getBindings();\n }", "public function set_binds($binds, $key = null)\r\n {\r\n if ($key == null) {\r\n $this->binds = $binds;\r\n }\r\n\r\n else {\r\n $this->binds[$key] = $binds;\r\n }\r\n\r\n return $this->binds;\r\n }", "public function getBindVariableName();", "public function getSocketReadBindings(): array\n {\n $output = [];\n\n foreach ($this->sockets as $id => $binding) {\n if ($binding->getIoMode() == 'r') {\n $output[$id] = $binding;\n }\n }\n\n return $output;\n }", "public function bind()\n {\n foreach ($this->columns as $column) {\n $column->bind();\n }\n }", "public function fetchAll($sql, $bind){\n $sth = $this->db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n /* example:\n $bind = array(':calories' => 150, ':colour' => 'red');\n */\n $sth->execute($bind);\n return $sth->fetchAll(PDO::FETCH_ASSOC);\n }", "public function bindValues(array $bind_values);", "public function getRootBindings();", "public function bindResults(array $bind_results);", "private function registerBindings()\n {\n foreach($this->bindings as $key => $val)\n {\n $this->app->bind($key, $val);\n }\n }", "public function getBindVariableName() {}", "public function getElements() {}", "public function provides()\n {\n return array_keys($this->getBindings());\n }", "public function processBind()\n {\n $bind = [];\n\n foreach ($this->fields as $field)\n {\n\n if($field == $this->tablePK)\n {\n $bind[\":id\"] = $this->data[$field];\n }\n else\n {\n $bind[\":$field\"] = $this->data[$field];\n }\n }\n $this->bind = $bind;\n }", "public function getBindings(int $scope): ?BindingsInterface;", "public function getBindingTypes();", "function executeBoundSQL($cmdstr, $list) {\n\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n}", "public function clean_binds()\r\n {\r\n foreach ($this->binds as &$value) {\r\n $value = array();\r\n }\r\n }", "public function add_bind($key, $value)\r\n {\r\n $this->binds[$key] = array_merge($this->binds[$key],(array) $value);\r\n\r\n return $this->binds;\r\n }", "protected function bind()\n {\n if (!isset($this->di)) {\n return false;\n }\n foreach ($this->di as $contract => $object) {\n $this->app->bind($contract, $object);\n }\n }", "public function get_bound_variables() {\n $bound_variables = [];\n //odbc doesn't support named parameters, only numerically indexed ones\n //We go through the query string, find the named parameters\n $query_bound_variables = $this->query_bound_variables;\n#\t\t\tFB::log($query_bound_variables, 'named_parameters');\n foreach ($query_bound_variables as $index => $parameter) {\n $_bv = isset($this->bound_variables[$parameter]) ? $this->bound_variables[$parameter] : false;\n if (!$_bv) {\n $parameter_name = (string)$parameter;\n throw new PDOException(\"SQLSTATE[HY093]: Invalid parameter number: parameter {$parameter_name} was not defined\", (int)'HY093');\n }\n \n $data_type = $_bv[1];\n $_bv_value = $_bv[0];\n switch ($data_type) {\n case PDO::PARAM_BOOL:\n $value = !isset($_bv_value) ? null : (bool)$_bv_value ? 1 : 0;\n break;\n case PDO::PARAM_NULL:\n $value = null;\n break;\n case PDO::PARAM_INT:\n $value = (int)$_bv_value;\n break;\n case PDO::PARAM_STR:\n #todo todo todo todo todo todo todo: This probably is not adequate enough to prevent SQL injection\n $_bv_value = ODBC::ms_escape_string($_bv_value);\n $value = \"'{$_bv_value}'\";\n break;\n case PDO::PARAM_LOB:\n case PDO::PARAM_STMT:\n case PDO::PARAM_INPUT_OUTPUT:\n default:\n //Not sure what the default value should be\n $value = null;\n break;\n }\n \n $bound_variables[] = $value;\n }\n return $bound_variables;\n }", "public function findRootBindings(Expression $expr);", "protected function elements()\n {\n $window = $this->getUrlWindow($this->onEachSide);\n\n return array_filter(array(\n $window['first'],\n is_array($window['slider']) ? '...' : null,\n $window['slider'],\n is_array($window['last']) ? '...' : null,\n $window['last'],\n ));\n }", "public function setBinds($arrayBinds)\r\n {\r\n $this->binds = $arrayBinds;\r\n }", "public static function &getAll(): array\n {\n return self::getInstance()->elements;\n }", "function bindAllValues($statement, $params)\n {\n foreach($params as $param => $value)\n {\n $statement->bindValue(':'.$param, $value);\n }\n return $statement;\n }", "public function getRootBindingTypes();", "private function bind(array $matches)\n {\n $curRoute = $this->_routes;\n $params = [];\n $skip = false;\n foreach ($matches as $key => $match) {\n $i = 0;\n $paramCount = 0;\n\n if (array_key_exists('params', $curRoute) && !$skip) {\n $curRoute['params'] = $this->bindParams($curRoute, $matches);\n $skip = true;\n if(sizeof($matches) == 0) break;\n }\n\n if (array_key_exists($match, $curRoute)) {\n $curRoute = $curRoute[$match];\n } else {\n $curRoute = false;\n break;\n }\n unset($matches[$key]);\n }\n return $curRoute;\n }", "public function fetchAllIndexed($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_UNIQUE | PDO::FETCH_ASSOC);\r\n }", "public function bindings()\n {\n return $this->hasMany('App\\Binding', 'SOURCE_DEVICE_ID');\n }", "public function bindEvents()\n {\n\n if (!$this->bindEvents){\n // Bind update events to active engine\n $this->engine->bindUpdateEvents();\n }\n return $this->bindEvents;\n }", "protected static function bindBindParams($st) {\n\t\t\tforeach (self::$bind_params as $i => &$p)\n\t\t\t\t$st->bindParam($i+1, $p);\n\t\t}", "public function fetchAll($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_ASSOC);\r\n }", "function bind($bindings_a,$bindings_b,$arg_list_b) {\n\n // return a list of conjuncts that \n\n if (count($arg_list_b) > 0) {\n\n $arg_b = array_shift($arg_list_b);\n\n if (isset($bindings_a[$arg_b])) {\n\n $val = $bindings_a[$arg_b];\n\n if (isset($bindings_b[$arg_b])) {\n\n\tif ($bindings_b[$arg_b] != $val) {\n\t // binding failed.\n\t return \"FAIL\";\n\t}\n }\n else {\n\t$bindings_b[$arg_b] = $val;\n }\n }\n // do rest of $arg_list_b.\n return bind($bindings_a,$bindings_b,$arg_list_b);\n }\n return $bindings_b;\n}", "public function binds( $binds , $typeArray = null )\r\n\t{\r\n\t\tforeach( $binds as $key => $value )\r\n\t\t{\r\n\t\t\tif( $typeArray )\r\n\t\t\t\t$this->bindValue( $key , $value , $typeArray[ $key ] );\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif( is_int( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_INT;\r\n\t\t\t\telseif( is_bool( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_BOOL;\r\n\t\t\t\telseif( is_null( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_NULL;\r\n\t\t\t\telseif( is_string( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_STR;\r\n\t\t\t\telse\r\n\t\t\t\t\t$param = false;\r\n\r\n\t\t\t\t$this->bindValue( $key , $value , $param );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function getElements(){\n return $this->_elements;\n }", "public function getSocketWriteBindings(): array\n {\n $output = [];\n\n foreach ($this->sockets as $id => $binding) {\n if ($binding->getIoMode() == 'w') {\n $output[$id] = $binding;\n }\n }\n\n return $output;\n }", "function bind_array($stmt, &$row) {\n\t$md = $stmt->result_metadata();\n\t$params = array();\n\twhile($field = $md->fetch_field()) {\n\t\t$params[] = &$row[$field->name];\n\t}\n\n\tcall_user_func_array(array($stmt, 'bind_result'), $params);\n}", "public function getSocketBindings(): array\n {\n return $this->sockets;\n }", "public function getElements( $name ) {\n\t\treturn $this->getGpml()->$name;\n\t}", "public static function read($bindAttributes){\n }", "function getElements() {\n return $this->rows_object;\n }", "protected function bind_params($params) {\n\t\t\t$binded_params = array(''); \n\t\t\tforeach($params as $p) { \n\t\t\t\tif(is_int($p)) {\n\t\t\t\t\t$binded_params[0] .= 'i'; //integer\n\t\t\t\t} elseif (is_float($p)) {\n\t\t\t\t\t$binded_params[0] .= 'd'; //double\n\t\t\t\t} elseif (is_string($p)) {\n\t\t\t\t\t$binded_params[0] .= 's'; //string\n\t\t\t\t} else {\n\t\t\t\t\t$binded_params[0] .= 'b'; //blob and unknown\n\t\t\t\t}\n\t\t\t\tarray_push($binded_params, $p);\n\t\t\t}\n\t\t\t\n\t\t\t$refs = array();\n\t\t\tforeach ($binded_params as $key => $value) {\n\t\t\t\t$refs[$key] = & $binded_params[$key];\n\t\t\t}\n\t\t\treturn $refs;\n\t\t}", "public function getElements() {\n\t\treturn $this->elements;\n\t}", "function GrabMoreData($query, $bind)\r\n{\r\n $pdo = connect();\r\n $sql= $query;\r\n $prepare = oci_parse($pdo,$sql);\r\n foreach ($bind as $attribute)\r\n {\r\n oci_bind_by_name($prepare, $attribute[0], $attribute[1]);\r\n/* echo $attribute[0].\" \".$attribute[1];*/\r\n }\r\n if(oci_execute($prepare))\r\n {\r\n $res = oci_fetch_array($prepare,OCI_ASSOC+OCI_RETURN_NULLS);\r\n if ($res != null)\r\n {\r\n return $res;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n $e = oci_error($prepare); \r\n echo $e['message']; \r\n } \r\n}", "public function getElements()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('elements');\n }", "public function bindAll($dbm) {\n $dbm->stmt = $dbm->con->prepare($this->sql);\n $i = 0;\n while ($i < count($this->params)) {\n $dbm->stmt->bindParam($this->params[$i], $this->vals[$i], $this->types[$i]);\n $i++;\n }\n }", "public function getElements() {\n\t\treturn $this->renderables;\n\t}", "public function execute($bind_array);", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statement handle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n return $statement;\n\n}", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "public function listActiveWrapper()\n {\n return array_keys($this->_wrapperRegistry);\n }", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $oraconn, $success;\n\t$statement = OCIParse($oraconn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($oraconn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "public function getElements()\n\t{\n\t\treturn $this->elements;\n\t}", "public function getElements()\n\t{\n\t\treturn $this->elements;\n\t}", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse this command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); // Make sure you do not remove this.\n // Otherwise, $val will remain in an \n // array object wrapper which will not \n // be recognized by Oracle as a proper\n // datatype.\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute this command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement);\n // For OCIExecute errors pass the statement handle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "public function getBlinds()\n\t{\n\t\treturn [$this->bb, $this->sb];\n\t}", "protected function buildBindings(): void\n {\n $this->bindings = $this->fieldValueSet->getBoundValues();\n }", "function executeBoundSQL($cmdstr, $list) {\n\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n }", "public function getExchangeBindings()\n {\n return $this->exchangeBindings;\n }", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n}", "function executeBoundSQL($cmdstr, $list) {\n\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n }", "private function bindValues(\\PDOStatement $stmt, array $bindings): \\PDOStatement {\n\t\tfor ($i = 0; $i < count($bindings); $i++) {\n\t\t\t$param = $i + 1;\n\t\t\tif (is_int($bindings[$i])) {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_INT);\n\t\t\t} else {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_STR);\n\t\t\t}\n\t\t}\n\t\treturn $stmt;\n\t}", "protected function getElements()\n {\n return $this->elements;\n }", "private function bindValues() {\n\t\tforeach ($this->builder->bindings as $key => $value) {\n\t\t\t$this->statement->bindValue(\n\t\t\t\t(is_string($key) ? $key : $key + 1),\n\t\t\t\t$value,\n\t\t\t\t(is_int($value) || is_float($value) ? PDO::PARAM_INT : PDO::PARAM_STR)\n\t\t\t);\n\t\t}\n\n\t\t// Reset Builder - ready for next statement\n\t\t$this->builder->bindings = [];\n\t\t$this->builder->wheres = [];\n\t}", "private function getBounds() {\n\t\tif ($this->element->ParentElement instanceof TreeView) {\n\t\t\t$children = $this->element->ParentElement->Children;\n\t\t\t$firstElement = $children->Get(1);\n\t\t\t$lastElement = $children->Get($children->Count() - 2);\n\t\t} else {\n\t\t\t$children = $this->element->ParentElement->ContainerElement->Children;\n\t\t\t$firstElement = $children->Get(0);\n\t\t\t$lastElement = $children->Get($children->Count() - 1);\n\t\t}\n\t\treturn [$firstElement, $lastElement];\n\t}", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }" ]
[ "0.6945058", "0.65487266", "0.64952815", "0.64054304", "0.6349753", "0.6334879", "0.61204666", "0.60808", "0.6079097", "0.60372716", "0.6029472", "0.5946507", "0.5761154", "0.57311213", "0.5708491", "0.5708491", "0.56947154", "0.5686093", "0.5662899", "0.56624484", "0.56315386", "0.5620523", "0.5591536", "0.55382454", "0.552212", "0.54826635", "0.5474267", "0.5439983", "0.54338694", "0.53787374", "0.5355408", "0.53318053", "0.5294187", "0.52782583", "0.5267504", "0.5247665", "0.524258", "0.5218439", "0.5217243", "0.52069944", "0.520465", "0.51708627", "0.5160946", "0.51482713", "0.5143138", "0.51001436", "0.5081031", "0.5049676", "0.5039882", "0.5030371", "0.5003764", "0.49991563", "0.4996669", "0.4991056", "0.498934", "0.4984743", "0.4981622", "0.49790302", "0.49578452", "0.49443924", "0.494305", "0.4938834", "0.49380064", "0.4923724", "0.49227682", "0.4920265", "0.491988", "0.49099502", "0.48954397", "0.48925546", "0.48781943", "0.48781168", "0.48714277", "0.48290873", "0.48250994", "0.4816923", "0.48147827", "0.48101065", "0.48084155", "0.48030716", "0.48027572", "0.47990477", "0.47945276", "0.47685382", "0.47681844", "0.47605693", "0.47532314", "0.47532314", "0.474694", "0.47466648", "0.47365546", "0.47344378", "0.4728798", "0.4727879", "0.47246733", "0.47214252", "0.47121584", "0.47120494", "0.47055474", "0.47051832" ]
0.59578305
11
Get all values from binds list
public function get_binds_values() { return array_values_recursive_with_keys($this->binds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBindValues();", "public function getBinds(): array;", "public function bindValues()\n {\n $ret = [];\n\n if ($this->data)\n {\n $ret = \\array_values($this->data);\n }\n\n if ($this->getWhereValues())\n {\n $ret = \\array_merge($ret, $this->getWhereValues());\n }\n\n return Utils::arrayFlatten($ret);\n }", "public function getBindVars(): array\n {\n return $this->container->getAll();\n }", "public function get_binds(){\n\t\treturn $this->binds;\n\t}", "public function getBindings();", "public function getBindings(): array;", "public function bindings();", "public function getBind();", "public function getBindings(): array\n {\n return $this->bindings;\n }", "public function getBindings()\n {\n return $this->bindings;\n }", "public function getBindings()\n {\n return $this->bindings;\n }", "public function getBindings()\n {\n $bindings = [];\n\n // We will run through all the bindings and pluck out\n // the component (select, where, etc.)\n foreach ($this->bindings as $component => $binding) {\n if (!empty($binding)) {\n // For every binding there could be multiple\n // values set so we need to add all of them as\n // flat $key => $value item in our $bindings.\n foreach ($binding as $key => $value) {\n $bindings[$key] = $value;\n }\n }\n }\n\n return $bindings;\n }", "public function bindings(): array\n {\n return $this->bindings;\n }", "public function getBoundVariables() {}", "public function processBind()\n {\n $bind = [];\n\n foreach ($this->fields as $field)\n {\n\n if($field == $this->tablePK)\n {\n $bind[\":id\"] = $this->data[$field];\n }\n else\n {\n $bind[\":$field\"] = $this->data[$field];\n }\n }\n $this->bind = $bind;\n }", "public function getAllBindings(): array\n {\n return array_merge(\n array_values($this->sockets),\n array_values($this->streams),\n array_values($this->signals),\n array_values($this->timers)\n );\n }", "public function bindValues(array $bind_values);", "public function getBind() {\n return $this->aBind;\n }", "public function get_binds($key = null)\r\n {\r\n if ($key == null) {\r\n return $this->binds;\r\n }\r\n\r\n return $this->binds[ $key ];\r\n }", "public function get_all_ip_binding(){\n return $this->query('/ip/hotspot/ip-binding/getall');\n }", "private function bindValues() {\n\t\tforeach ($this->builder->bindings as $key => $value) {\n\t\t\t$this->statement->bindValue(\n\t\t\t\t(is_string($key) ? $key : $key + 1),\n\t\t\t\t$value,\n\t\t\t\t(is_int($value) || is_float($value) ? PDO::PARAM_INT : PDO::PARAM_STR)\n\t\t\t);\n\t\t}\n\n\t\t// Reset Builder - ready for next statement\n\t\t$this->builder->bindings = [];\n\t\t$this->builder->wheres = [];\n\t}", "protected function get_bindings(): array {\n\t\treturn [];\n\t}", "public function bind()\n {\n foreach ($this->columns as $column) {\n $column->bind();\n }\n }", "public function get_bound_variables() {\n $bound_variables = [];\n //odbc doesn't support named parameters, only numerically indexed ones\n //We go through the query string, find the named parameters\n $query_bound_variables = $this->query_bound_variables;\n#\t\t\tFB::log($query_bound_variables, 'named_parameters');\n foreach ($query_bound_variables as $index => $parameter) {\n $_bv = isset($this->bound_variables[$parameter]) ? $this->bound_variables[$parameter] : false;\n if (!$_bv) {\n $parameter_name = (string)$parameter;\n throw new PDOException(\"SQLSTATE[HY093]: Invalid parameter number: parameter {$parameter_name} was not defined\", (int)'HY093');\n }\n \n $data_type = $_bv[1];\n $_bv_value = $_bv[0];\n switch ($data_type) {\n case PDO::PARAM_BOOL:\n $value = !isset($_bv_value) ? null : (bool)$_bv_value ? 1 : 0;\n break;\n case PDO::PARAM_NULL:\n $value = null;\n break;\n case PDO::PARAM_INT:\n $value = (int)$_bv_value;\n break;\n case PDO::PARAM_STR:\n #todo todo todo todo todo todo todo: This probably is not adequate enough to prevent SQL injection\n $_bv_value = ODBC::ms_escape_string($_bv_value);\n $value = \"'{$_bv_value}'\";\n break;\n case PDO::PARAM_LOB:\n case PDO::PARAM_STMT:\n case PDO::PARAM_INPUT_OUTPUT:\n default:\n //Not sure what the default value should be\n $value = null;\n break;\n }\n \n $bound_variables[] = $value;\n }\n return $bound_variables;\n }", "private function getBindingsCollection(): ?Collection\n\t{\n\t\treturn $this->entityObject->get($this->fieldNameMap->getBindings());\n\t}", "public function clean_binds()\r\n {\r\n foreach ($this->binds as &$value) {\r\n $value = array();\r\n }\r\n }", "public function bound () :array\n {\n return [\n\n ];\n }", "public static function getBindings(){\n //Method inherited from \\Illuminate\\Container\\Container \n return \\Illuminate\\Foundation\\Application::getBindings();\n }", "protected function buildBindings(): void\n {\n $this->bindings = $this->fieldValueSet->getBoundValues();\n }", "function getBindVariableName() ;", "private function registerBindings()\n {\n foreach($this->bindings as $key => $val)\n {\n $this->app->bind($key, $val);\n }\n }", "public function bindIn(&...$binds);", "protected function getValuesForDatabase() : array {\n\t\t$values = array();\n\t\tforeach ($this->propertyMap as $propertyName => $dbBinding) {\n\t\t\t$value = $this->{$propertyName};\n\t\t\t$value = $this->onBeforeSave($value, $propertyName);\n\n\t\t\t$values[$dbBinding] = $value;\n\t\t}\n\n\t\treturn $values;\n\t}", "public function provides()\n {\n return array_keys($this->getBindings());\n }", "function getParamaters() {\n\t\treturn $this->preparedvalues;\n\t}", "public function bind(array $bindings);", "function bindAllValues($statement, $params)\n {\n foreach($params as $param => $value)\n {\n $statement->bindValue(':'.$param, $value);\n }\n return $statement;\n }", "public function bindAll($dbm) {\n $dbm->stmt = $dbm->con->prepare($this->sql);\n $i = 0;\n while ($i < count($this->params)) {\n $dbm->stmt->bindParam($this->params[$i], $this->vals[$i], $this->types[$i]);\n $i++;\n }\n }", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "public function getBindVariableName() {}", "public function queryData(){\r\n\t\treturn $this->_placeholders;\r\n\t}", "public function getBindVariableName();", "public function bindOut(&...$binds);", "private function _bindValues($values)\n {\n $params = array();\n $types = str_repeat('s', count($values));\n $params[0] = $types;\n\n foreach ($values as &$v) {\n $params[] =& $v;\n }\n\n return call_user_func_array(array($this->_stmt, 'bind_param'), $params);\n }", "function getMany($query, array $binds = [], $conn)\n{\n $statement = $conn->prepare($query);\n foreach($binds as $key => $value) {\n $statement->bindValue($key, $value);\n }\n $statement->execute();\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return $results;\n}", "public function bindResults(array $bind_results);", "public function add_bind($key, $value)\r\n {\r\n $this->binds[$key] = array_merge($this->binds[$key],(array) $value);\r\n\r\n return $this->binds;\r\n }", "function getbindValues($table, $data)\n{\n global $db_lnk;\n $qry_val_arr = array(\n $table\n );\n $result = pg_query_params($db_lnk, 'SELECT * FROM information_schema.columns WHERE table_name = $1 ', $qry_val_arr);\n $bindValues = array();\n while ($field_details = pg_fetch_assoc($result)) {\n $field = $field_details['column_name'];\n $val_arr = array(\n 'created',\n 'modified'\n );\n if (in_array($field, $val_arr)) {\n continue;\n }\n //todo : get list_id from lists table\n if ($field == 'id' && $table == 'lists' && array_key_exists('list_id', $data)) {\n $bindValues['id'] = $data['list_id'];\n }\n if ($field == 'ip_id') {\n $data['ip'] = !empty($data['ip']) ? $data['ip'] : '';\n $ip_id = saveIp();\n $bindValues[$field] = $ip_id;\n } elseif (array_key_exists($field, $data)) {\n if ($field == 'is_active' || $field == 'is_allow_email_alias') {\n $boolean = !empty($data[$field]) ? 'true' : 'false';\n $bindValues[$field] = $boolean;\n } else if ($field == 'due_date' && $data[$field] == null) {\n $bindValues[$field] = null;\n } else {\n $bindValues[$field] = $data[$field];\n }\n }\n }\n return $bindValues;\n}", "public function getValuesList(){\n return $this->_get(1);\n }", "public function getBind(string $name): mixed;", "public function bindings()\n {\n return $this->hasMany('App\\Binding', 'SOURCE_DEVICE_ID');\n }", "public function getValueBinder(): ValueBinder;", "public function getGroupedBindings() {\n return [\n 'fields' => $this->getBindings(),\n 'where' => $this->getWhere()->getBindings(),\n 'having' => $this->getHaving()->getBindings()\n ];\n }", "public static function bindValues($stmt,$params=array()){\n foreach($params as $placeHolder => $value){\n $stmt->bindValue($placeHolder,$value);\n }\n return $stmt;\n }", "public function fetchAll($sql, $bind){\n $sth = $this->db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n /* example:\n $bind = array(':calories' => 150, ':colour' => 'red');\n */\n $sth->execute($bind);\n return $sth->fetchAll(PDO::FETCH_ASSOC);\n }", "private function getAttachedKeysFromRelation($bind, string $name): ?array\n {\n if (!$bind instanceof Model) {\n return data_get($bind, $name);\n }\n\n $relation = $bind->{$name}();\n\n if ($relation instanceof BelongsToMany) {\n $relatedKeyName = $relation->getRelatedKeyName();\n\n return $relation->getBaseQuery()\n ->get($relation->getRelated()->qualifyColumn($relatedKeyName))\n ->pluck($relatedKeyName)\n ->all();\n }\n\n if ($relation instanceof MorphMany) {\n $parentKeyName = $relation->getLocalKeyName();\n\n return $relation->getBaseQuery()\n ->get($relation->getQuery()->qualifyColumn($parentKeyName))\n ->pluck($parentKeyName)\n ->all();\n }\n\n return data_get($bind, $name);\n }", "public function findBindings(Expression $expr);", "function bindAllValues($statement, $params){\n\n\t\tforeach($params as $param => $value) {\n\n if (startsWith($value, 'C')) {\n $aux = explode(\" \", $value);\n $result = \"\";\n foreach($aux as $value){\n if ($value == \"C\") {\n $result .= \"C/\";\n } else {\n $result.= \" \".$value;\n }\n }\n $value = $result;\n }\n\t\t\t$statement->bindValue(':'.$param, $value);\n }\n \n\t\treturn $statement;\n }", "protected static function bindBindParams($st) {\n\t\t\tforeach (self::$bind_params as $i => &$p)\n\t\t\t\t$st->bindParam($i+1, $p);\n\t\t}", "private function bindValues(\\PDOStatement $stmt, array $bindings): \\PDOStatement {\n\t\tfor ($i = 0; $i < count($bindings); $i++) {\n\t\t\t$param = $i + 1;\n\t\t\tif (is_int($bindings[$i])) {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_INT);\n\t\t\t} else {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_STR);\n\t\t\t}\n\t\t}\n\t\treturn $stmt;\n\t}", "public function bindEvents()\n {\n\n if (!$this->bindEvents){\n // Bind update events to active engine\n $this->engine->bindUpdateEvents();\n }\n return $this->bindEvents;\n }", "public function getRootBindings();", "public function getBindingTypes();", "public function set_binds($binds, $key = null)\r\n {\r\n if ($key == null) {\r\n $this->binds = $binds;\r\n }\r\n\r\n else {\r\n $this->binds[$key] = $binds;\r\n }\r\n\r\n return $this->binds;\r\n }", "protected function _bind($bind)\r\n {\r\n if ($bind === null) {\r\n return null;\r\n }\r\n if (!is_array($bind)) {\r\n $bind = [$bind];\r\n }\r\n return $bind;\r\n }", "public function all()\n {\n return $this->values;\n }", "public function getCardBindings(): array\n {\n return $this->data['CardBindingFileds'] ?? []; //ToDo: Check can be typo\n }", "public function getExchangeBindings()\n {\n return $this->exchangeBindings;\n }", "public function getSocketReadBindings(): array\n {\n $output = [];\n\n foreach ($this->sockets as $id => $binding) {\n if ($binding->getIoMode() == 'r') {\n $output[$id] = $binding;\n }\n }\n\n return $output;\n }", "protected function bindValuesMulti($statement, $bindings)\n {\n // Reduce array to flat values while preserving order\n $values = [];\n\n foreach ($bindings as $array) {\n $values = array_merge($values, array_values($array));\n }\n\n $this->bindValues($statement, $values);\n }", "protected function bind()\n {\n if (!isset($this->di)) {\n return false;\n }\n foreach ($this->di as $contract => $object) {\n $this->app->bind($contract, $object);\n }\n }", "protected function bind_params($params) {\n\t\t\t$binded_params = array(''); \n\t\t\tforeach($params as $p) { \n\t\t\t\tif(is_int($p)) {\n\t\t\t\t\t$binded_params[0] .= 'i'; //integer\n\t\t\t\t} elseif (is_float($p)) {\n\t\t\t\t\t$binded_params[0] .= 'd'; //double\n\t\t\t\t} elseif (is_string($p)) {\n\t\t\t\t\t$binded_params[0] .= 's'; //string\n\t\t\t\t} else {\n\t\t\t\t\t$binded_params[0] .= 'b'; //blob and unknown\n\t\t\t\t}\n\t\t\t\tarray_push($binded_params, $p);\n\t\t\t}\n\t\t\t\n\t\t\t$refs = array();\n\t\t\tforeach ($binded_params as $key => $value) {\n\t\t\t\t$refs[$key] = & $binded_params[$key];\n\t\t\t}\n\t\t\treturn $refs;\n\t\t}", "public static function bindValues($statement, $bindings)\n {\n }", "public function getValuesList() {\n return $this->_get(2);\n }", "public function getPortBindings()\n {\n return $this->_portBindings;\n }", "protected function find_binds(){\n\t\tif ( $this->has_tags() ) {\n\t\t\tforeach ( $this->tags[1] as $tag_key => $tag ) {\n\t\t\t\tforeach ( $this->form[ 'fields' ] as $key_id => $fcfg ) {\n\t\t\t\t\t//don't sync to self\n\t\t\t\t\tif ( $key_id == $this->field_base_id ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $fcfg[ 'slug' ] === $tag ) {\n\t\t\t\t\t\t$this->handle_match( $key_id, $tag_key );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function getVariablesList() {\n return $this->_get(2);\n }", "public function getSqlPreparedValues()\n {\n return $this->sqlPreparedValues;\n }", "static protected function getQueryBindings($query){\n\t\t\t$regexBindings = '/:([^\\s,\\)\\(]*)/m';\n\t\t\tpreg_match_all($regexBindings, $query, $matches, PREG_SET_ORDER, 0);\n\t\t\treturn $matches;\n\t\t}", "public function getBinding() {\n return $this->binding;\n }", "public function setBinds($arrayBinds)\r\n {\r\n $this->binds = $arrayBinds;\r\n }", "public function getAll()\n {\n return $this->values;\n }", "public function getAll()\n {\n return $this->values;\n }", "public function getValuesList() {\n return $this->_get(3);\n }", "public function resultset($bind_array=array());", "function bind_array($stmt, &$row) {\n\t$md = $stmt->result_metadata();\n\t$params = array();\n\twhile($field = $md->fetch_field()) {\n\t\t$params[] = &$row[$field->name];\n\t}\n\n\tcall_user_func_array(array($stmt, 'bind_result'), $params);\n}", "static public function getAll()\r\n {\r\n return self::$values;\r\n }", "public function dtgParameter_Bind() {\n\t\t\t$this->dtgParameter->TotalItemCount = Parameter::CountAll();\n\n\t\t\t$objClauses = array();\n\t\t\tif ($objClause = $this->dtgParameter->OrderByClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\tif ($objClause = $this->dtgParameter->LimitClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\t$this->dtgParameter->DataSource = Parameter::LoadAll($objClauses);\n\t\t}", "public function getSocketWriteBindings(): array\n {\n $output = [];\n\n foreach ($this->sockets as $id => $binding) {\n if ($binding->getIoMode() == 'w') {\n $output[$id] = $binding;\n }\n }\n\n return $output;\n }", "public function execute($bind_array);", "public function all()\r\n {\r\n return $this->parameters;\r\n }", "public function getSocketBindings(): array\n {\n return $this->sockets;\n }", "protected function bindValues($stmt, array $binds)\n\t{\n\t\t// Bind each value to the given prepared statement\n\t\tforeach($binds as $field => $value) {\n\t\t\t$stmt->bindValue($field, $value);\n\t\t}\n\t\treturn true;\n\t}", "public function fetchAll($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function all()\n {\n return $this->params;\n }", "function get_value_list()\n\t{\n\t\treturn $this->value;\n\t}", "public function prepareBindings(array $bindings);", "public function bindFields()\n {\n // TODO: Implement bindFields() method.\n }", "public function getValues()\n\t{\n\t\treturn $this->_values;\n\t}" ]
[ "0.82217616", "0.7527059", "0.7237501", "0.715083", "0.71380484", "0.7116035", "0.6928018", "0.68112993", "0.67598164", "0.6759041", "0.6709758", "0.6709758", "0.6703255", "0.65679324", "0.6567089", "0.65560496", "0.65010417", "0.64996", "0.64436525", "0.64434755", "0.63997257", "0.6346796", "0.6327609", "0.6250796", "0.61944586", "0.6178071", "0.61620176", "0.6155782", "0.60405934", "0.60031134", "0.5996938", "0.5987837", "0.5961755", "0.59173864", "0.5895045", "0.5891063", "0.58664227", "0.5861663", "0.58419555", "0.5828351", "0.5802061", "0.57752436", "0.5763823", "0.5757767", "0.5750451", "0.5704919", "0.56984705", "0.56978047", "0.56942874", "0.56190485", "0.5589417", "0.55426973", "0.55416644", "0.55003536", "0.54955125", "0.5477463", "0.5467173", "0.5465589", "0.5455683", "0.54451716", "0.54384154", "0.54327", "0.5423373", "0.54205185", "0.54192215", "0.54189074", "0.5411881", "0.5397002", "0.53931737", "0.5385835", "0.537279", "0.53516185", "0.5345496", "0.532728", "0.5325693", "0.5318846", "0.52900535", "0.52682763", "0.5258481", "0.52427924", "0.52343", "0.523412", "0.5232114", "0.5232114", "0.5219845", "0.5218884", "0.5218327", "0.52182573", "0.52102", "0.52041125", "0.5201653", "0.5194956", "0.5175354", "0.5174184", "0.5162744", "0.5152382", "0.51484996", "0.5145742", "0.5129818", "0.51289886" ]
0.76063067
1
Rewrite an/all element(s) from binds list
public function set_binds($binds, $key = null) { if ($key == null) { $this->binds = $binds; } else { $this->binds[$key] = $binds; } return $this->binds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clean_binds()\r\n {\r\n foreach ($this->binds as &$value) {\r\n $value = array();\r\n }\r\n }", "public function processBind()\n {\n $bind = [];\n\n foreach ($this->fields as $field)\n {\n\n if($field == $this->tablePK)\n {\n $bind[\":id\"] = $this->data[$field];\n }\n else\n {\n $bind[\":$field\"] = $this->data[$field];\n }\n }\n $this->bind = $bind;\n }", "public function prepareBindings(array $bindings);", "private function setBindings(array $bindings): void\n\t{\n\t\tEntityBinding::normalizeEntityBindings($this->boundEntityTypeId, $bindings);\n\t\tEntityBinding::removeBindingsWithDuplicatingEntityIDs($this->boundEntityTypeId, $bindings);\n\n\t\t$bindingsCollection = $this->getBindingsCollection();\n\t\t$currentBindings = $bindingsCollection ? $this->bindingsCollectionToArray($bindingsCollection) : [];\n\n\t\t[$add, $update, $delete] = $this->separateBindingsByOperation($currentBindings, $bindings);\n\n\t\t$this->addBindings($add);\n\n\t\t// may be bindings collection was created in entityObject while we were adding new bindings to it\n\t\t$bindingsCollection = $bindingsCollection ? $bindingsCollection : $this->getBindingsCollection();\n\t\tif ($bindingsCollection)\n\t\t{\n\t\t\t$this->updateBindings($bindingsCollection, $update);\n\t\t\t$this->deleteBindings($bindingsCollection, $delete);\n\t\t}\n\n\t\tif (!$bindingsCollection || count($bindingsCollection) <= 0)\n\t\t{\n\t\t\tif ($this->fieldNameMap->isSingleIdFilled())\n\t\t\t{\n\t\t\t\t$this->entityObject->set($this->fieldNameMap->getSingleId(), 0);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t$idOfPrimaryBoundEntity = $this->ensureExactlyOnePrimaryBoundEntityExists($bindingsCollection, $bindings);\n\n\t\tif ($this->fieldNameMap->isSingleIdFilled())\n\t\t{\n\t\t\t$this->entityObject->set($this->fieldNameMap->getSingleId(), $idOfPrimaryBoundEntity);\n\t\t}\n\t}", "public function replaceBinds($sql, $binds = array())\n\t{\n\t\t$binds = (Array) $binds;\n\t\t\n\t\t// named binds\n\t\tif(preg_match_all('/:([\\w]+)(?=\\s|$)/', $sql, $matches))\n\t\t{\n\t\t\t$result = '';\n\t\t\t\n\t\t\t// replace the named binds\n\t\t\tforeach($matches[1] as $id)\n\t\t\t{\n\t\t\t\tif( ! isset($binds[$id]))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_Connection_MissingBindParameterException($id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// add the part before the name and then the escaped data\n\t\t\t\t$result .= strstr($sql, ':' . $id, true) . $this->escape($binds[$id]);\n\t\t\t\t// make $sql contain the next to match, this to prevent matching in the previously escaped data\n\t\t\t\t$sql = substr($sql, strpos($sql, ':' . $id) + strlen($id) + 1);\n\t\t\t}\n\t\t\t\n\t\t\t// assemble\n\t\t\t$res = $result . $sql;\n\t\t}\n\t\t// unnamed binds\n\t\telse\n\t\t{\n\t\t\t// split the condition\n\t\t\t$parts = explode('?', $sql);\n\t\t\t$c = count($parts) - 1;\n\t\t\t\n\t\t\tif($c > count($binds))\n\t\t\t{\n\t\t\t\tthrow new Db_Connection_MissingBindParameterException($c);\n\t\t\t}\n\t\t\t\n\t\t\t$res = '';\n\t\t\t\n\t\t\t// insert the binds\n\t\t\tfor($i = 0; $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$res .= $parts[$i] . $this->escape($binds[$i]);\n\t\t\t}\n\t\t\t\n\t\t\t// add the last part\n\t\t\t$res .= $parts[$i];\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "public function bind(array $bindings);", "public static function prepareBindings(array $bindings)\n {\n }", "public function setBinds($arrayBinds)\r\n {\r\n $this->binds = $arrayBinds;\r\n }", "public function bindIn(&...$binds);", "public function bindValues(array $bind_values);", "public function bindings();", "protected function buildBindings(): void\n {\n $this->bindings = $this->fieldValueSet->getBoundValues();\n }", "private function bindValues() {\n\t\tforeach ($this->builder->bindings as $key => $value) {\n\t\t\t$this->statement->bindValue(\n\t\t\t\t(is_string($key) ? $key : $key + 1),\n\t\t\t\t$value,\n\t\t\t\t(is_int($value) || is_float($value) ? PDO::PARAM_INT : PDO::PARAM_STR)\n\t\t\t);\n\t\t}\n\n\t\t// Reset Builder - ready for next statement\n\t\t$this->builder->bindings = [];\n\t\t$this->builder->wheres = [];\n\t}", "public function bind(array $values) {\n foreach ($this->elements as $element) {\n if (array_key_exists($element->getName(), $values)) {\n $element->setFilteredValue($values[$element->getName()]);\n }\n }\n }", "function unify_right_side($connect,$right_side,$bindings) {\n\n if (count($right_side) == 0) {\n // done; return successful set of bindings\n return array($bindings);\n }\n\n $conjunct = array_shift($right_side);\n \n $conj_arg_list = $conjunct['arg_list'];\n \n $conj_bindings = bind($bindings,array(),$conj_arg_list);\n \n $Conjunct_tuple = unify($connect,$conjunct['pred'],$conj_arg_list,$conj_bindings);\n // $Conjunct_binding_sets is a set of binding sets.\n\n $Conjunct_binding_sets = $Conjunct_tuple[0];\n $Conjunct_arg_lists = $Conjunct_tuple[1];\n\n // return list of binding sets.\n $retval = array();\n\n // CHECKME: sometimes $Conjunct_binding_sets is NULL; is it ok?\n if ($Conjunct_binding_sets) {\n // merge existing with each set $b_ in $Conjunct_binding_sets.\n // NOTE USE OF &$b HERE : REQUIRES PHP5 : http://www.php.net/manual/en/control-structures.foreach.php\n foreach($Conjunct_binding_sets as &$Conjunct_binding_set) {\n foreach ($bindings as $key => $val) {\n\tif (!isset($Conjunct_binding_set[$key])) {\n\t // assign value of the $i'th element in $bindings to the $i'th element in $Conjunct_binding_set.\n\t $Conjunct_binding_set[$key] = $val;\n\t}\n }\n \n $result = unify_right_side($connect,\n\t\t\t\t $right_side,\n\t\t\t\t $Conjunct_binding_set);\n \n // final_set := union( final_set ,this conjunct's results)\n // (actually appending 2 lists together, but should really be a union of sets)\n foreach($result as $res) {\n\t$retval[] = $res;\n }\n }\n }\n\n return $retval;\n}", "public function bind()\n {\n foreach ($this->columns as $column) {\n $column->bind();\n }\n }", "public function prepareBindings(array $bindings)\n {\n $grammar = $this->getQueryGrammar();\n\n $prepared = [];\n\n foreach ($bindings as $key => $binding) {\n // The bindings are collected in a little bit different way than\n // Eloquent, we will need the key name in order to know where to replace\n // the value using the Neo4j client.\n $value = $binding;\n\n // We need to get the array value of the binding\n // if it were mapped\n if (is_array($value)) {\n // There are different ways to handle multiple\n // bindings vs. single bindings as values.\n $value = array_values($value);\n }\n\n // We need to transform all instances of the DateTime class into an actual\n // date string. Each query grammar maintains its own date string format\n // so we'll just ask the grammar for the format to get from the date.\n\n if ($value instanceof DateTime) {\n $binding = $value->format($grammar->getDateFormat());\n }\n\n $property = is_array($binding) ? key($binding) : $key;\n\n // We will set the binding key and value, then\n // we replace the binding property of the id (if found)\n // with a _nodeId instead since the client\n // will not accept replacing \"id(n)\" with a value\n // which have been previously processed by the grammar\n // to be _nodeId instead.\n if (!is_array($binding)) {\n $binding = [$binding];\n }\n\n foreach ($binding as $property => $real) {\n // We should not pass any numeric key-value items since the Neo4j client expects\n // a JSON map parameters.\n if (is_numeric($property)) {\n $property = (!is_numeric($key)) ? $key : 'id';\n }\n\n if ($property == 'id') {\n $property = $grammar->getIdReplacement($property);\n }\n\n $prepared[$property] = $real;\n }\n }\n\n return $prepared;\n }", "protected function bind_params($params) {\n\t\t\t$binded_params = array(''); \n\t\t\tforeach($params as $p) { \n\t\t\t\tif(is_int($p)) {\n\t\t\t\t\t$binded_params[0] .= 'i'; //integer\n\t\t\t\t} elseif (is_float($p)) {\n\t\t\t\t\t$binded_params[0] .= 'd'; //double\n\t\t\t\t} elseif (is_string($p)) {\n\t\t\t\t\t$binded_params[0] .= 's'; //string\n\t\t\t\t} else {\n\t\t\t\t\t$binded_params[0] .= 'b'; //blob and unknown\n\t\t\t\t}\n\t\t\t\tarray_push($binded_params, $p);\n\t\t\t}\n\t\t\t\n\t\t\t$refs = array();\n\t\t\tforeach ($binded_params as $key => $value) {\n\t\t\t\t$refs[$key] = & $binded_params[$key];\n\t\t\t}\n\t\t\treturn $refs;\n\t\t}", "protected function bindValues(PDOStatement $statement, array $bindings): void\r\n {\r\n foreach ($bindings as $key => $val) {\r\n $statement->bindValue(\r\n is_numeric($key) === true ? $key + 1 : $key,\r\n $val,\r\n is_int($val) === true ? PDO::PARAM_INT : PDO::PARAM_STR\r\n );\r\n }\r\n }", "public function addBindings(array $bindings)\n {\n $this->bindlings = array_merge_recursive($this->bindlings, $bindings);\n }", "public function bindOut(&...$binds);", "public function prepareBindingsForUpdate(array $bindings, array $values): array\n {\n $cleanBindings = Arr::except($bindings, ['select', 'join']);\n \n return array_values(\n array_merge($bindings['join'], $values, Arr::flatten($cleanBindings))\n );\n }", "private function bindValues(\\PDOStatement $stmt, array $bindings): \\PDOStatement {\n\t\tfor ($i = 0; $i < count($bindings); $i++) {\n\t\t\t$param = $i + 1;\n\t\t\tif (is_int($bindings[$i])) {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_INT);\n\t\t\t} else {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_STR);\n\t\t\t}\n\t\t}\n\t\treturn $stmt;\n\t}", "function bind($bindings_a,$bindings_b,$arg_list_b) {\n\n // return a list of conjuncts that \n\n if (count($arg_list_b) > 0) {\n\n $arg_b = array_shift($arg_list_b);\n\n if (isset($bindings_a[$arg_b])) {\n\n $val = $bindings_a[$arg_b];\n\n if (isset($bindings_b[$arg_b])) {\n\n\tif ($bindings_b[$arg_b] != $val) {\n\t // binding failed.\n\t return \"FAIL\";\n\t}\n }\n else {\n\t$bindings_b[$arg_b] = $val;\n }\n }\n // do rest of $arg_list_b.\n return bind($bindings_a,$bindings_b,$arg_list_b);\n }\n return $bindings_b;\n}", "function bindAllValues($statement, $params){\n\n\t\tforeach($params as $param => $value) {\n\n if (startsWith($value, 'C')) {\n $aux = explode(\" \", $value);\n $result = \"\";\n foreach($aux as $value){\n if ($value == \"C\") {\n $result .= \"C/\";\n } else {\n $result.= \" \".$value;\n }\n }\n $value = $result;\n }\n\t\t\t$statement->bindValue(':'.$param, $value);\n }\n \n\t\treturn $statement;\n }", "private function registerBindings()\n {\n foreach($this->bindings as $key => $val)\n {\n $this->app->bind($key, $val);\n }\n }", "public function prepareBindingsForUpdate(array $bindings, array $values)\n {\n $values = collect($values)->map(function ($value, $column) {\n return is_array($value) || ($this->isJsonSelector($column) && ! $this->isExpression($value))\n ? json_encode($value)\n : $value;\n })->all();\n\n $cleanBindings = Arr::except($bindings, 'select');\n\n return array_values(\n array_merge($values, Arr::flatten($cleanBindings))\n );\n }", "public function bind($data)\n {\n\n foreach ($data as $key => $value) {\n //Check if the item is in the whitelist\n if ($this->whitelist !== null && !in_array($key, $this->whitelist)) {\n continue;\n }\n\n if (in_array($key, $this->blacklist)) {\n continue;\n }\n\n $this->bindKey($key, $value);\n }\n }", "public function bind( $formArray, $prefix=\"\", $suffix=\"\", $tryBind=true, $storeOriginalText=false );", "function bind( $array, $ignore = '' )\n {\n if (key_exists( 'field-name', $array ) && is_array( $array['field-name'] )) {\n \t$array['field-name'] = implode( ',', $array['field-name'] );\n }\n \n return parent::bind( $array, $ignore );\n }", "private function injectSpecialBindings(string $sql, array $bindings):string {\n\tforeach(self::SPECIAL_BINDINGS as $special) {\n\t\t$specialPlaceholder = \":\" . $special;\n\n\t\tif(!array_key_exists($special, $bindings)) {\n\t\t\tcontinue;\n\t\t}\n\t\t$sql = str_replace($specialPlaceholder, $bindings[$special], $sql);\n\t\tunset($bindings[$special]);\n\t}\n\n\treturn $sql;\n}", "public function prepareBindings(array $bindings)\n\t{\n\t\treturn $this->neoeloquent->prepareBindings($bindings);\n\t}", "public function replace(array $bind)\n {\n $cols = array();\n $vals = array();\n foreach ($bind as $col => $val) {\n $cols[] = $this->_db->quoteIdentifier($col, true);\n if ($val instanceof Zend_Db_Expr) {\n $vals[] = $val->__toString();\n unset($bind[$col]);\n } else {\n $vals[] = '?';\n }\n }\n\n // build the statement\n $sql = \"REPLACE INTO \"\n . $this->_db->quoteIdentifier($this->_name, true)\n . ' (' . implode(', ', $cols) . ') '\n . 'VALUES (' . implode(', ', $vals) . ')';\n\n $this->_setAdapter($this->_adapter);\n\n // execute the statement and return the number of affected rows\n $stmt = $this->_db->query($sql, array_values($bind));\n $result = $stmt->rowCount();\n\n return $result;\n\n }", "function create_binding() {\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"SELECT OLT_ID from OLT_IP_POOLS where OLT_ID = '$this->olt_id'\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t\twhile ($row = $result->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\tif ($row[\"OLT_ID\"])\r\n\t\t\t\t$error = (\"ERROR: THIS OLT have been ASSIGNED pool ALREADY, Please remove any existing bindings and try to create again!\");\r\n\t\t\t\treturn $error;\t\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"INSERT INTO OLT_IP_POOLS (OLT_ID, IP_POOL_ID) VALUES ('$this->olt_id', '$this->id')\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t}", "protected function bindValuesMulti($statement, $bindings)\n {\n // Reduce array to flat values while preserving order\n $values = [];\n\n foreach ($bindings as $array) {\n $values = array_merge($values, array_values($array));\n }\n\n $this->bindValues($statement, $values);\n }", "public function prepareBindingsForUpdateFrom(array $bindings, array $values)\n {\n $values = collect($values)->map(function ($value, $column) {\n return is_array($value) || ($this->isJsonSelector($column) && ! $this->isExpression($value))\n ? json_encode($value)\n : $value;\n })->all();\n\n $bindingsWithoutWhere = Arr::except($bindings, ['select', 'where']);\n\n return array_values(\n array_merge($values, $bindings['where'], Arr::flatten($bindingsWithoutWhere))\n );\n }", "function bindAllValues($statement, $params)\n {\n foreach($params as $param => $value)\n {\n $statement->bindValue(':'.$param, $value);\n }\n return $statement;\n }", "public function binds( $binds , $typeArray = null )\r\n\t{\r\n\t\tforeach( $binds as $key => $value )\r\n\t\t{\r\n\t\t\tif( $typeArray )\r\n\t\t\t\t$this->bindValue( $key , $value , $typeArray[ $key ] );\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif( is_int( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_INT;\r\n\t\t\t\telseif( is_bool( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_BOOL;\r\n\t\t\t\telseif( is_null( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_NULL;\r\n\t\t\t\telseif( is_string( $value ) )\r\n\t\t\t\t\t$param = \\PDO::PARAM_STR;\r\n\t\t\t\telse\r\n\t\t\t\t\t$param = false;\r\n\r\n\t\t\t\t$this->bindValue( $key , $value , $param );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected static function bindBindParams($st) {\n\t\t\tforeach (self::$bind_params as $i => &$p)\n\t\t\t\t$st->bindParam($i+1, $p);\n\t\t}", "protected function replaceBindings(&$stub, $bindings)\n {\n $replaceString = '[';\n foreach($bindings as $role => $permissions) {\n $role = strtolower($role);\n $replaceString .= \"\n '$role' => [\";\n foreach($permissions as $permission) {\n $permission = strtolower($permission);\n $replaceString .= \"\n '$permission',\";\n }\n $replaceString .= '\n ],';\n\n\n }\n $replaceString .= '\n ];';\n\n\n $stub = str_replace('{{bindings}}', $replaceString, $stub);\n\n return $this;\n }", "protected function registerBindings(Collection $bindings)\n {\n $bindings->each(function ($concretion, $abstraction) {\n $this->app->bind($abstraction, $concretion);\n });\n }", "function unbindAll() {\n foreach (array(\n 'hasOne' => array_keys($this->hasOne),\n 'hasMany' => array_keys($this->hasMany),\n 'belongsTo' => array_keys($this->belongsTo),\n 'hasAndBelongsToMany' => array_keys($this->hasAndBelongsToMany)\n ) as $relation => $model) {\n $this->unbindModel(array($relation => $model));\n }\n }", "protected function _bind($bind)\r\n {\r\n if ($bind === null) {\r\n return null;\r\n }\r\n if (!is_array($bind)) {\r\n $bind = [$bind];\r\n }\r\n return $bind;\r\n }", "function executeBoundSQL($cmdstr, $list) {\n\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n}", "protected function bindValues($statement, $bindings)\n {\n foreach ($bindings as $key => $value) {\n $statement->bindValue(\n is_string($key) ? $key : $key + 1,\n $value,\n is_int($value) ? \\PDO::PARAM_INT : \\PDO::PARAM_STR\n );\n }\n }", "function mod_element_list($newElement, $list, $lastElement, $description, $ecolor, $priority, $modified){\n $lid = get_id($list);\n //modifier\n if ($lid!=-1){\n $SQL = \"UPDATE element_list SET element = '$newElement', description = '$description', ecolor = $ecolor, priority = $priority, modified = $modified \n WHERE element = '$lastElement' and list='$lid'\";\n global $db;\n $res = $db->prepare($SQL);\n $res->execute();\n }\n}", "private function bindParameters($statement, $params) {\n foreach ($params as $param) {\n $value = $param->getValue(); // We have to do this because bindParam \n $columnName = $param->getColumnName(); // keep a reference to the object and\n $type = $param->getType();\n $length = $param->getLength();\n // we cannot do it with the function call\n // getValue();\n $statement->bindParam($columnName, $value, $type, $length);\n unset($value); // unset the variable to remove the reference to avoid\n unset($columnName);// problem in the next loop iteration\n unset($type);\n unset($length);\n }\n }", "public static function reorderBindValues($bindValues, $statement)\n {\n preg_match_all('/:(\\w*)/', $statement, $matches);\n\n $values = [];\n foreach ($matches[1] as $value) {\n $values[] = $bindValues[$value];\n }\n\n return $values;\n }", "function bind($elem) {\n $isArrayElem = is_array( $elem );\n $fromObjectElem = is_object( $elem );\n if (!$isArrayElem && !$fromObjectElem) {\n throw new Exception(\"La fuente para cargar los datos no es valida.\");\n return false;\n }\n $attr = $this->getProperties();\n foreach ($attr as $k => $v) {\n if ($isArrayElem && isset( $elem[$k] )) {\n $this->$k = $elem[$k];\n } else if ($fromObjectElem && isset( $elem->$k )) {\n $this->$k = $elem->$k;\n }\n }\n return true;\n }", "public function getBinds(): array;", "private function bindAliasesToContainer()\n {\n foreach (static::$aliasMap as $alias => $classes)\n {\n foreach ($classes as $class)\n {\n $this->alias($alias, $class);\n }\n }\n }", "function bind( $array, $ignore='' )\r\n {\r\n $result = parent::bind( $array );\r\n // cast properties\r\n $this->id\t= (int) $this->id;\r\n\r\n return $result;\r\n }", "function edit_elements($element, $sentence)\n {\n $element->nodeValue = '';\n foreach($sentence as $node)\n {\n /* Appends a new HTML element at the end of the old one. */\n $element->appendChild($node);\n }\n }", "public function bindParams(array $params);", "private function checkBindings($bindings)\n {\n foreach ($bindings as &$binding) {\n if (is_string($binding) && !mb_check_encoding($binding, 'UTF-8')) {\n $binding = '[BINARY DATA]';\n }\n }\n\n return $bindings;\n }", "private function _filtertBindings($fieldNodes, $isDirect = false) {}", "function bind($tag_name, $data)\r\n {\r\n if (is_array($data)) {\r\n foreach ($data as $name => $val) {\r\n $this->set($name, $val);\r\n }\r\n } else {\r\n $this->set($tag_name, $data);\r\n\r\n }\r\n }", "public static function bindValues($statement, $bindings)\n {\n }", "function bindObjects()\r\n\t{\r\n\t $this->bindEventObject();\r\n\t $this->bindRecurringObject();\r\n\t $this->bindSeriesObject();\r\n\t $this->bindVenueObject();\r\n\t\t$this->image_src = $this->getImage('src');\r\n\t\t$this->link_view = 'index.php?option=com_calendar&view=events&task=view&id=' . $this->event_id . '&instance_id=' . $this->eventinstance_id;\r\n\t\t$this->bindPrimaryCategoryObject();\r\n\t\t$this->bindActionButtonObject();\r\n\t}", "private function bind_params($query, $bindings, $update = false)\n {\n $query = \\str_replace('\"', '`', $query);\n $bindings = $this->prepareBindings($bindings);\n\n if (!$bindings) {\n return $query;\n }\n\n $bindings = \\array_map(function ($replace) {\n if (\\is_string($replace)) {\n $replace = \"'\" . esc_sql($replace) . \"'\";\n } elseif ($replace === null) {\n $replace = \"null\";\n }\n\n return $replace;\n }, $bindings);\n\n $query = \\str_replace(array('%', '?'), array('%%', '%s'), $query);\n $query = \\vsprintf($query, $bindings);\n\n return $query;\n }", "protected function setRepositoryBindings()\n\t{\n\t\t$this->aliases = $this->app['config']['app.aliases'];\n\n\t\t// Set the items being bound\n\t\t$bindings = ['Comment', 'Goal', 'Plan', 'Stat'];\n\n\t\tforeach ($bindings as $binding)\n\t\t{\n\t\t\t$this->bindRepository($binding);\n\t\t}\n\t}", "public function add_bind($key, $value)\r\n {\r\n $this->binds[$key] = array_merge($this->binds[$key],(array) $value);\r\n\r\n return $this->binds;\r\n }", "private function prepbindvariables($stmt, $params) {\n\n if (empty($params)) {\n return $stmt;\n }\n\n if ($params != null) {\n // Generate the Type String (eg: 'issisd')\n $types = '';\n foreach ($params as $param) {\n if (is_int($param)) {\n // Integer\n $types .= 'i';\n } elseif (is_float($param)) {\n // Double\n $types .= 'd';\n } elseif (is_string($param)) {\n // String\n $types .= 's';\n } else {\n // Blob and Unknown\n $types .= 'b';\n }\n }\n\n // Add the Type String as the first Parameter\n $bind_names[] = $types;\n\n // Loop thru the given Parameters\n for ($i = 0; $i < count($params); $i++) {\n // Create a variable Name\n $bind_name = 'bind' . $i;\n // Add the Parameter to the variable Variable\n $$bind_name = $params[$i];\n // Associate the Variable as an Element in the Array\n $bind_names[] = &$$bind_name;\n }\n\n // Call the Function bind_param with dynamic Parameters\n call_user_func_array(array($stmt, 'bind_param'), $bind_names);\n }\n return $stmt;\n }", "protected function bind()\n {\n if (!isset($this->di)) {\n return false;\n }\n foreach ($this->di as $contract => $object) {\n $this->app->bind($contract, $object);\n }\n }", "public static function syncBindings($module, $bindings = [])\n {\n if (!\\is_array($bindings)) {\n $bindings = [];\n }\n\n // 排序,逐次减1\n $displayorder = count($bindings);\n\n if($displayorder > 0) {\n // 删除无用项\n pdo_delete('modules_bindings', [\n 'module' => $module\n ]);\n }\n\n foreach ($bindings as $binding) {\n\n $entry = $binding[0];\n $title = $binding[1];\n $do = $binding[2];\n $icon = $bidning[3] ?: '';\n\n $where = [];\n $where['module'] = $module;\n $where['entry'] = $entry;\n $where['do'] = $do;\n\n $data = [];\n $data['title'] = $title;\n $data['icon'] = $icon;\n $data['displayorder'] = $displayorder;\n\n $row = pdo_get('modules_bindings', $where);\n if (!empty($row)) {\n pdo_update('modules_bindings', $data, $where);\n } else {\n $data = array_merge($data, $where);\n pdo_insert('modules_bindings', $data);\n }\n\n $dos[] = \"'\" . $do . \"'\";\n $displayorder -= 1;\n }\n\n }", "public function bindResults(array $bind_results);", "private function bind(array $matches)\n {\n $curRoute = $this->_routes;\n $params = [];\n $skip = false;\n foreach ($matches as $key => $match) {\n $i = 0;\n $paramCount = 0;\n\n if (array_key_exists('params', $curRoute) && !$skip) {\n $curRoute['params'] = $this->bindParams($curRoute, $matches);\n $skip = true;\n if(sizeof($matches) == 0) break;\n }\n\n if (array_key_exists($match, $curRoute)) {\n $curRoute = $curRoute[$match];\n } else {\n $curRoute = false;\n break;\n }\n unset($matches[$key]);\n }\n return $curRoute;\n }", "public function bindAll($dbm) {\n $dbm->stmt = $dbm->con->prepare($this->sql);\n $i = 0;\n while ($i < count($this->params)) {\n $dbm->stmt->bindParam($this->params[$i], $this->vals[$i], $this->types[$i]);\n $i++;\n }\n }", "public function testBindingProcessor()\n {\n $processor = new Processor\\Bindings();\n $input = '{{ test }} works';\n\n $output = $processor->replace($input, []);\n $this->assertSame(' works', $output);\n\n $output = $processor->replace($input, ['test' => 'yay']);\n $this->assertSame('yay works', $output);\n\n $input = '{{ test.nested }} works';\n $output = $processor->replace($input, ['test' => ['nested' => 'also']]);\n $this->assertSame('also works', $output);\n\n $bindingObj = new \\stdClass();\n $bindingObj->nested = 'obj';\n $output = $processor->replace($input, ['test' => $bindingObj]);\n $this->assertSame('obj works', $output);\n\n $bindingObj->nested = ['sub' => 'yyyaaayyy'];\n $input = '{{ test.nested.sub }} works';\n $output = $processor->replace($input, ['test' => $bindingObj]);\n $this->assertSame('yyyaaayyy works', $output);\n }", "function bind_subq($stmt){\n global $params;\n foreach ($params as $name => &$value){\n switch ($name){\n case 'grouping': case 'page': case 'sort':\n // none of these affect bindings\n break;\n case 'collection': case 'yearstart': case 'yearend':\n $stmt->bindParam(\":$name\", $value, PDO::PARAM_INT);\n break;\n default:\n // all other params are arrays\n foreach ($value as $index => &$component){\n $bindstr = ':' . $name . $index;\n $stmt->bindParam($bindstr, $component, PDO::PARAM_INT);\n }\n }\n }\n}", "public function bind($array, $ignore = '')\n\t{\n\t\treturn parent::bind($array, $ignore);\n\t}", "public function getBindValues();", "function bind_array($stmt, &$row) {\n\t$md = $stmt->result_metadata();\n\t$params = array();\n\twhile($field = $md->fetch_field()) {\n\t\t$params[] = &$row[$field->name];\n\t}\n\n\tcall_user_func_array(array($stmt, 'bind_result'), $params);\n}", "public function bind($array, $ignore = '')\r\n\t{\r\n\t\tif (isset($array['params']) && is_array($array['params'])) {\r\n\t\t\t$registry = new JRegistry();\r\n\t\t\t$registry->loadArray($array['params']);\r\n\t\t\t$array['params'] = (string)$registry;\r\n\t\t}\r\n\t\r\n\t\treturn parent::bind($array, $ignore);\r\n\t}", "public function toAssignableList($aExprList, $bIsBinding) \n {\n $iEnd = count($aExprList);\n for ($iI = 0; $iI < $iEnd; $iI++) {\n $oElt = $aExprList[$iI];\n if ($oElt) \n $this->fnToAssignable($oElt, $bIsBinding);\n }\n if ($iEnd) {\n $oLast = $aExprList[$iEnd - 1];\n if ($this->aOptions['ecmaVersion'] == 6 \n && $bIsBinding \n && $oLast \n && $oLast->sType == \"RestElement\" \n && $oLast->oArgument->sType != \"Identifier\")\n $this->fnUnexpected($oLast->oArgument->iStart);\n }\n return $aExprList;\n }", "protected function bind($element)\n\t{\n\t\tif (isset($element->htmlAttr) && stripos($element->htmlAttr, 'onclick') !== false)\n\t\t{\n\t\t\t// strip onclick and trim ending double quotes\n\t\t\t$function = rtrim($element->htmlAttr, '\"');\n\t\t\t$function = str_replace('onClick=\"', '', $function);\n\t\t\t$function = str_replace('onclick=\"', '', $function);\n\n\t\t\t// the javascript function to call\n\t\t\t$element->htmlAttr = $function;\n\t\t}\n\n\t\tif (empty($element->id))\n\t\t{\n\t\t\t$element->id = parent::getName() . '1';\n\t\t}\n\n\t\tif (empty($element->value))\n\t\t{\n\t\t\t$element->value = 1;\n\t\t}\n\n\t\treturn $element;\n\t}", "public function bind($data)\r\n {\r\n if ($data) {\r\n foreach ($data as $key => $value) {\r\n $this->$key = $value;\r\n }\r\n }\r\n }", "public function getBindings(): array;", "protected function cleanBindings(array $bindings): array\n {\n return array_filter($bindings, static function ($binding) {\n return !$binding instanceof Expression;\n });\n }", "protected function bindValues($stmt, array $binds)\n\t{\n\t\t// Bind each value to the given prepared statement\n\t\tforeach($binds as $field => $value) {\n\t\t\t$stmt->bindValue($field, $value);\n\t\t}\n\t\treturn true;\n\t}", "private function _bindUPGroupList()\n\t{\n\t\t$result = array();\n\t\tforeach($this->_getUPGroups() as $key => $content){\n\t\t\t$result[] = array($key, $key);\n\t\t}\n\t\t$result[] = array(\"chg\", \"** Show All **\");\n\t\t$this->preferencesList->DataSource = $result;\n\t\t$this->preferencesList->DataBind();\n\t}", "private function addToBindings($value)\n {\n if (is_array($value)){\n $this->bindings = array_merge($this->bindings , array_values($value));\n }\n else{\n $this->bindings[] = $value;\n }\n }", "public function remapListedDBRecords() {}", "public function addBind($sValue) {\n $this->aBind[] = Array($this->i, $sValue, $this->bindType($sValue));\n $this->i++;\n }", "public function reset_binds( $key = null )\r\n {\r\n if ($key == null) {\r\n $this->binds = array();\r\n }\r\n\r\n else {\r\n $this->binds[ $key ] = array();\r\n }\r\n\r\n return $this->binds;\r\n }", "public function binding( $builder )\n {\n $sql = $builder->toSql();\n foreach($builder->getBindings() as $binding)\n {\n $value = is_numeric($binding) ? $binding : \"'\".$binding.\"'\";\n $sql = preg_replace('/\\?/', $value, $sql, 1);\n }\n return $sql;\n\n #$builder = $this->getBuilder();\n #$sql = $builder->toSql();\n #foreach($builder->getBindings() as $binding)\n #{\n # $value = is_numeric($binding) ? $binding : \"'\".$binding.\"'\";\n # $sql = preg_replace('/\\?/', $value, $sql, 1);\n #}\n #return $sql;\n }", "private function _replaceElementTexts()\n {\n $collection = $this->_record;\n // If this option is set, it will loop through the $elementTexts provided,\n // find each one and manually update it (provided it exists).\n // The rest of the element texts will get added as per usual.\n foreach ($this->_elementTexts as $elementSetName => $textArray) {\n foreach ($textArray as $elementName => $elementTextSet) {\n $etRecordSet = $collection->getElementTexts($elementSetName, $elementName);\n foreach ($elementTextSet as $elementTextIndex => $textAttr) {\n // If we have an existing ElementText record, use that\n // instead of adding a new one.\n if (array_key_exists($elementTextIndex, $etRecordSet)) {\n $etRecord = $etRecordSet[$elementTextIndex];\n $etRecord->text = $textAttr['text'];\n $etRecord->html = $textAttr['html'];\n $etRecord->save();\n } else {\n // Otherwise we should just append the new text to the\n // pre-existing ones.\n $elementRecord = $collection->getElement($elementSetName, $elementName);\n $collection->addTextForElement($elementRecord, $textAttr['text'], $textAttr['html']);\n }\n }\n }\n }\n }", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statement handle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n return $statement;\n\n}", "public function bindVariable($bindVariableName);", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "public function preparedQuery( $query, array $_binds )\n\t{\n\t\t/* Init Bind object */\n\t\t$bind = new Db\\Bind();\n\t\t\n\t\t/* Sort out subqueries */\n\t\t$binds = array();\n\t\t$i = 0;\n\t\tforeach ( $_binds as $bindVal )\n\t\t{\n\t\t\t$i++;\n\t\t\tif ( $bindVal instanceof \\IPS\\Db\\Select )\n\t\t\t{\n\t\t\t\t$pos = 0;\n\t\t\t\tfor ( $j=0; $j<$i; $j++ )\n\t\t\t\t{\n\t\t\t\t\t$pos = mb_strpos( $query, '?', $pos ) + 1;\n\t\t\t\t}\n\t\t\t\t$query = mb_substr( $query, 0, $pos - 1 ) . $bindVal->query . mb_substr( $query, $pos );\n\t\t\t\t$i--;\n\t\t\t\t\n\t\t\t\tforeach ( $bindVal->binds as $v )\n\t\t\t\t{\n\t\t\t\t\t$binds[] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$binds[] = $bindVal;\n\t\t\t}\n\t\t}\n\n\t\t/* Loop values to bind */\n\t\t$i = 0;\n\t\t$longThreshold = 1048576;\n\t\t$sendAsLong = array();\n\t\tforeach ( $binds as $bindVal )\n\t\t{\n\t\t\tif( ( is_object( $bindVal ) OR is_string( $bindVal ) ) AND \\strlen( (string) $bindVal ) > $longThreshold )\n\t\t\t{\n\t\t\t\t$sendAsLong[ $i ] = (string) $bindVal;\n\t\t\t}\n\n\t\t\t$i++;\n\t\t\tswitch ( gettype( $bindVal ) )\n\t\t\t{\n\t\t\t\tcase 'boolean':\n\t\t\t\tcase 'integer':\n\t\t\t\t\t$bind->add( 'i', $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'double':\n\t\t\t\t\t$bind->add( 'd', $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcase 'string':\n\t\t\t\t\t$bind->add( 's', ( \\strlen( $bindVal ) > $longThreshold ) ? NULL : $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'object':\n\t\t\t\t\tif( method_exists( $bindVal, '__toString' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bind->add( 's', ( \\strlen( $bindVal ) > $longThreshold ) ? NULL : (string) $bindVal );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Deliberately no break\n\t\t\t\t\t\n\t\t\t\tcase 'NULL':\n\t\t\t\tcase 'array':\n\t\t\t\tcase 'resource':\n\t\t\t\tcase 'unknown type':\n\t\t\t\tdefault:\n\t\t\t\t\t/* For NULL values, you can't bind, so we adjust the query to actually pass a NULL value */\n\t\t\t\t\t$pos = 0;\n\t\t\t\t\tfor ( $j=0; $j<$i; $j++ )\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos = mb_strpos( $query, '?', $pos ) + 1;\n\t\t\t\t\t}\n\t\t\t\t\t$query = mb_substr( $query, 0, $pos - 1 ) . 'NULL' . mb_substr( $query, $pos );\n\t\t\t\t\t$i--;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t/* Log */\n\t\tif ( \\IPS\\QUERY_LOG )\n\t\t{\t\n\t\t\t/* Replace ?s with the actual values */\n\t $logQuery = $query;\n\t foreach ( $binds as $b )\n\t {\n\t\t $logQuery = preg_replace( '/\\?/', var_export( $b, TRUE ), $logQuery, 1 );\n\t }\n\t \n\t\t\t/* Log */\n\t\t\t$this->log( $logQuery );\t\n\t\t}\n\t\t\n\t\t/* Add a backtrace to the query so we know where it came from if it causes issues */\n\t\t$comment = '??';\n\t\t$line = '?';\n\t\tforeach( debug_backtrace( FALSE ) as $b )\n\t\t{\n\t\t\tif ( isset( $b['line'] ) )\n\t\t\t{\n\t\t\t\t$line = $b['line'];\n\t\t\t}\n\t\t\t\n\t\t\tif( isset( $b['class'] ) and $b['class'] !== 'IPS\\_Db' and $b['class'] !== 'IPS\\Db\\_Select' )\n\t\t\t{\n\t\t\t\t$comment = \"{$b['class']}::{$b['function']}:{$line}\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$_query = $query;\n\t\t$query = \"/*{$comment}*/ {$query}\";\n\t\t\t\t\n\t\t/* Prepare */\n\t\t$stmt = parent::prepare( $query );\n\t\tif( $stmt === FALSE )\n\t\t{\n\t\t\tthrow new \\IPS\\Db\\Exception( $this->error, $this->errno, NULL, $_query, $binds );\n\t\t}\n\t\t\n\t\t/* Bind values */\n\t\tif( $bind->haveBinds() === TRUE )\n\t\t{\n\t\t\tcall_user_func_array( array( $stmt, 'bind_param' ), $bind->get() );\n\n\t\t\tif( count( $sendAsLong ) )\n\t\t\t{\n\t\t\t\tforeach( $sendAsLong as $index => $data )\n\t\t\t\t{\n\t\t\t\t\t$chunks = str_split( $data, $longThreshold - 1 );\n\n\t\t\t\t\tforeach( $chunks as $chunk )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stmt->send_long_data( $index, $chunk );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Execute */\n\t\t$stmt->execute();\t\t\n\t\tif ( $stmt->error )\n\t\t{\n\t\t\tthrow new \\IPS\\Db\\Exception( $stmt->error, $stmt->errno, NULL, $_query, $binds );\n\t\t}\n\t\t$stmt->store_result();\n\t\t\t\t\t\t\n\t\t/* Return a Statement object */\n\t\treturn $stmt;\n\t}", "public function replace($items);", "private function updateNetworks()\n {\n foreach ($this->networks as $net_key => $net_value) {\n $url = $net_value['template'];\n\n foreach ($this->args as $arg_key => $arg_value) {\n $url = str_replace('{' . $arg_key . '}', $arg_value, $url);\n }\n\n $this->networks[$net_key]['url'] = $url;\n }\n }", "private function addToBindings($value): void\n {\n if (is_array($value)) {\n $this->bindings = array_merge($this->bindings, array_values($value));\n } else {\n $this->bindings[] = $value;\n }\n }", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $oraconn, $success;\n\t$statement = OCIParse($oraconn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($oraconn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "private function _replaceElementTexts()\n {\n $item = $this->_record;\n // If this option is set, it will loop through the $elementTexts provided,\n // find each one and manually update it (provided it exists).\n // The rest of the element texts will get added as per usual.\n foreach ($this->_elementTexts as $elementSetName => $textArray) {\n foreach ($textArray as $elementName => $elementTextSet) {\n $etRecordSet = $item->getElementTexts($elementSetName, $elementName);\n foreach ($elementTextSet as $elementTextIndex => $textAttr) {\n // If we have an existing ElementText record, use that\n // instead of adding a new one.\n if (array_key_exists($elementTextIndex, $etRecordSet)) {\n $etRecord = $etRecordSet[$elementTextIndex];\n $etRecord->text = $textAttr['text'];\n $etRecord->html = $textAttr['html'];\n $etRecord->save();\n } else {\n // Otherwise we should just append the new text to the\n // pre-existing ones.\n $elementRecord = $item->getElement($elementSetName, $elementName);\n $item->addTextForElement($elementRecord, $textAttr['text'], $textAttr['html']);\n }\n }\n }\n }\n }", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse this command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); // Make sure you do not remove this.\n // Otherwise, $val will remain in an \n // array object wrapper which will not \n // be recognized by Oracle as a proper\n // datatype.\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute this command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement);\n // For OCIExecute errors pass the statement handle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "protected function _prepareRuleActionSelectBind($object, $actionBind)\r\n {\r\n $bind = array();\r\n if (!is_array($actionBind)) {\r\n $actionBind = array();\r\n }\r\n\r\n foreach ($actionBind as $bindData) {\r\n if (!is_array($bindData) || !array_key_exists('bind', $bindData) || !array_key_exists('field', $bindData)) {\r\n continue;\r\n }\r\n $k = $bindData['bind'];\r\n $v = $object->getProduct()->getDataUsingMethod($bindData['field']);\r\n\r\n if (!empty($bindData['callback'])) {\r\n $callbacks = $bindData['callback'];\r\n if (!is_array($callbacks)) {\r\n $callbacks = array($callbacks);\r\n }\r\n foreach ($callbacks as $callback) {\r\n if (is_array($callback)) {\r\n $method = $callback[0];\r\n $v = $this->$method($v, $callback[1]);\r\n } else {\r\n $v = $this->$callback($v);\r\n }\r\n }\r\n }\r\n\r\n if (is_array($v)) {\r\n $v = join(',', $v);\r\n }\r\n\r\n $bind[$k] = $v;\r\n }\r\n\r\n return $bind;\r\n }", "protected function bind( &$stmt, $obj )\n\t{\n\t\t$words = StrUtil::multiexplode( array(' ','=',',','(',')'), $stmt->queryString );\n\t\tforeach ($obj as $key => &$value) {\n\t\t\tif( $this->paramExists( $words, $key ) ){\n\t\t\t\t$stmt->bindParam($key, $this->convert($value) );\n\t\t\t}\n\t\t}\n\t}", "public function prepareBindings(array $bindings)\n {\n foreach ($bindings as $key => $value) {\n if ($value instanceof DateTime) {\n $bindings[$key] = $value->format($this->getDateFormat());\n } else if ($value === false) {\n $bindings[$key] = 0;\n }\n }\n\n return $bindings;\n }" ]
[ "0.65540063", "0.60299027", "0.597621", "0.57028556", "0.56671584", "0.56648916", "0.56629264", "0.55195403", "0.5518054", "0.55080026", "0.5465953", "0.54563385", "0.5418467", "0.5368313", "0.5367788", "0.5348757", "0.53385365", "0.5314398", "0.53141856", "0.52938986", "0.5291161", "0.52880096", "0.52851576", "0.52619606", "0.5254164", "0.52152425", "0.5202177", "0.5187644", "0.5186099", "0.5173282", "0.5143241", "0.5120221", "0.51078767", "0.5095692", "0.5091772", "0.50700444", "0.50667965", "0.5053702", "0.5042439", "0.5031074", "0.501586", "0.49841008", "0.49491045", "0.4916893", "0.49090827", "0.48949945", "0.48765415", "0.48671356", "0.4865121", "0.48587915", "0.48337016", "0.4831099", "0.48062384", "0.47898412", "0.4776692", "0.47726512", "0.47634605", "0.47633988", "0.47558475", "0.47420102", "0.4721388", "0.4721163", "0.4719164", "0.47072384", "0.47030813", "0.4698612", "0.46984267", "0.46955353", "0.46913472", "0.46890438", "0.4674464", "0.46663943", "0.46649024", "0.46605408", "0.4654753", "0.46513233", "0.46493968", "0.4648133", "0.46441385", "0.4642898", "0.4624571", "0.46166545", "0.46074066", "0.46035713", "0.46016198", "0.45996153", "0.45984802", "0.45953146", "0.45901385", "0.4572386", "0.45714414", "0.45660686", "0.45635742", "0.45619202", "0.45593807", "0.45498258", "0.45412305", "0.45340613", "0.45314702", "0.4525074" ]
0.52019024
27
Add a new bind param to the query
public function add_bind($key, $value) { $this->binds[$key] = array_merge($this->binds[$key],(array) $value); return $this->binds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function bindParam()\n\t{\n\t\tif($this->nbParameters == 0)\n\t\t\treturn;\n\t\t$stmt = $this->stmt;\n\t\tcall_user_func_array(array($stmt, \"bind_param\"), $this->refValues(array_merge(array($this->parametersTypes), $this->parametersValues)));\n\t}", "public function bind($param, $value);", "public function bindParam ($placeholder,$value,$param_constant = null) {\n $this->query->bindParam($placeholder,$value,$param_constant);\n }", "public function dtgParameter_Bind() {\n\t\t\t$this->dtgParameter->TotalItemCount = Parameter::CountAll();\n\n\t\t\t$objClauses = array();\n\t\t\tif ($objClause = $this->dtgParameter->OrderByClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\tif ($objClause = $this->dtgParameter->LimitClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\t$this->dtgParameter->DataSource = Parameter::LoadAll($objClauses);\n\t\t}", "public function bind($name,$value,$type = NULL);", "private function bind_params($query, $bindings, $update = false)\n {\n $query = \\str_replace('\"', '`', $query);\n $bindings = $this->prepareBindings($bindings);\n\n if (!$bindings) {\n return $query;\n }\n\n $bindings = \\array_map(function ($replace) {\n if (\\is_string($replace)) {\n $replace = \"'\" . esc_sql($replace) . \"'\";\n } elseif ($replace === null) {\n $replace = \"null\";\n }\n\n return $replace;\n }, $bindings);\n\n $query = \\str_replace(array('%', '?'), array('%%', '%s'), $query);\n $query = \\vsprintf($query, $bindings);\n\n return $query;\n }", "public function add_ip_binding($param){\n $input = array(\n 'command' => '/ip/hotspot/ip-binding/add'\n );\n $out = array_merge($input, $param);\n return $this->query($out);\n }", "function bindParam(&$sql,$location,$var,$type){\n switch($type){\n default:\n case 'STRING':\n $var = addslashes($var);\n $var = \"'\".$var.\"'\";\n break;\n case 'INTEGER':\n case 'INT':\n $var = (int)$var;\n }\n\n for($i=1,$pos=0;$i<=$location;$i++){\n $pos = strpos($sql,\"? \",$pos+1);\n }\n\n $sql = substr($sql,0,$pos).$var.substr($sql,$pos+1);\n}", "private function setParam($stmt, $key, $value)\r\n {\r\n $stmt->bindParam($key, $value);\r\n }", "protected static function bindBindParams($st) {\n\t\t\tforeach (self::$bind_params as $i => &$p)\n\t\t\t\t$st->bindParam($i+1, $p);\n\t\t}", "public function bindValue($param, $value, $type = null);", "function bind_subq($stmt){\n global $params;\n foreach ($params as $name => &$value){\n switch ($name){\n case 'grouping': case 'page': case 'sort':\n // none of these affect bindings\n break;\n case 'collection': case 'yearstart': case 'yearend':\n $stmt->bindParam(\":$name\", $value, PDO::PARAM_INT);\n break;\n default:\n // all other params are arrays\n foreach ($value as $index => &$component){\n $bindstr = ':' . $name . $index;\n $stmt->bindParam($bindstr, $component, PDO::PARAM_INT);\n }\n }\n }\n}", "private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}", "public function bindValue ($placeholder,$value,$param_constant = null) {\n $this->query->bindValue($placeholder,$value,$param_constant);\n }", "public function bind($param, $value, $type = null)\n {\n if( is_null($type) ) {\n switch( true ) {\n case is_int($value) :\n $type = PDO::PARAM_INT;\n break;\n case is_bool($value) :\n $type = PDO::PARAM_BOOL;\n break;\n case is_null($value) :\n $type = PDO::PARAM_NULL;\n break;\n default :\n $type = PDO::PARAM_STR;\n \n }\n }\n\n // Membuat bind parameter, value dan type agar terhindar dari SQL injection, Karena query di eksekusi terlebih dahulu setelah stringnya dibersihkan\n $this->stmt->bindValue($param, $value, $type);\n }", "public function bindParams(array $params);", "public function bindVariable($bindVariableName);", "public function set_binding()\n {\n $owner_id = $this->get_owner_id();\n $startstr = $this->get_date();\n $this->stmt->bind_param('is', $owner_id, $startstr );\n }", "public function addQueryParameter($name, ProviderInterface $queryParameter)\n {\n $this->queryParameters[$name] = $queryParameter;\n }", "public function bindParam($param, &$variable, $type = null, $length = null);", "public function bindColumn($column, &$param, $type = NULL, $maxlen = NULL, $driverdata = NULL)\n {\n }", "public function bindColumn ($column,$var) {\n $this->query->bindColumn($column,$var);\n }", "public function bindValue($name, $value);", "public function testParamBindQueryFeature()\n {\n $condition = $this->getConnection()\n ->condition()\n (\"WHERE blog_title LIKE :title\");\n $select = $this->getConnection()\n ->select()\n (['blog_id', 'blog_title'])\n ('dummy_posts')\n ($condition);\n $rows = $this->getConnection()\n ->query()\n ($select)\n ([\n ['param' => ':title', 'value' => '%o%', 'type' => PDO::PARAM_INT]\n ])\n ('fetch-all')\n ();\n return $this->assertTrue(count($rows['rows']) > 0);\n }", "function bindParam(& $sql,$location,$var,$type){\n\n //确定类型\n switch ($type){\n //字符串\n default: //默认使用字符串类型\n\n case 'STRING' :\n $var = addslashes($var); //转义\n $var = \"'\".$var.\"'\"; //加上单引号\n break;\n\n case 'INTEGER':\n\n case 'INT':\n $var = (int)$var;//强转int\n }\n\n for ($i = 1,$pos =0 ;$i <= $location ;$i++){\n $pos = strpos($sql,'?',$pos+1);\n }\n\n //替换?\n $sql = substr($sql,0,$pos).$var.substr($sql,$pos+1);\n}", "public function bind($param, $value, $type = null) {\n if(is_null($type)) {\n switch(true) {\n case is_int($value):\n $type = PDO::PARAM_INT;\n break;\n case is_bool($value):\n $type = PDO::PARAM_BOOL;\n break;\n case is_null($value):\n $type = PDO::PARAM_NULL;\n break;\n default:\n $type = PDO::PARAM_STR;\n } \n }\n $this -> stmt -> bindValue($param, $value, $type);\n }", "public function bindParam($key, $value)\n {\n $this->params[$key] = $value;\n return $this;\n }", "public function bindParam($parameter, &$variable, $type = \\PDO::PARAM_STR);", "public function bindQuery($entity)\n {\n $entity = getClass($entity);\n // ??? param \n $name = $entity->name;\n $email = idem;\n $localisation = idem;\n \n $query = getQuery($name, $email, $localisation);\n \n $nbr_param = 3; // ??? count or param in list ?\n \n for( $i =0; $i < $nbr_param; $i++)\n {\n $query->bindParam(':nbr_param[0]', $entity->name);\n }\n $query->execute();\n }", "public function bindValue(mixed $value, ?int $bindType = PDO::PARAM_STR, ?string $bindName = null)\n {\n $this->boundValues[] = [$value, $bindType, $bindName];\n }", "function addParam($name, $value) {\n if (!isset($this->params[$name])) {\n $this->setParam($name, $value);\n }\n else {\n $oldParam = $this->getParam($name);\n if (!is_array($oldParam)) {\n $oldParam = array($oldParam);\n }\n array_push($oldParam, $value);\n $this->setParam($name, $oldParam);\n }\n }", "public function bindValue($parameter, $value, $type = \\PDO::PARAM_STR);", "protected function add_bind( $key_id ) {\n\t\tif( ! is_array( $this->binds ) ){\n\t\t\t$this->binds = array();\n\t\t}\n\n\t\tif( ! in_array( $key_id, $this->binds ) ){\n\t\t\t$this->binds[] = $key_id;\n\t\t}\n\n\t}", "public function bind($param, $value, $type = null) {\n if(is_null($type)) {\n switch (true) {\n case is_int($value):\n $type = PDO::PARAM_INT;\n break;\n case is_bool($value):\n $type = PDO::PARAM_BOOL;\n break;\n case is_null($value):\n $type = PDO::PARAM_NULL;\n break;\n default:\n $type = PDO::PARAM_STR;\n }\n }\n $this->stmt->bindValue($param, $value, $type);\n }", "public function bind($param, $value, $type = NULL) {\n if(is_null($type)) {\n switch(true) {\n case is_int($value):\n $type = PDO::PARAM_INT;\n break;\n case is_bool($value):\n $type = PDO::PARAM_BOOL;\n break;\n case is_null($value):\n $type = PDO::PARAM_NULL;\n break;\n default:\n $type = PDO::PARAM_STR;\n }\n }\n $this->stmt->bindValue($param, $value, $type);\n }", "public function processBind()\n {\n $bind = [];\n\n foreach ($this->fields as $field)\n {\n\n if($field == $this->tablePK)\n {\n $bind[\":id\"] = $this->data[$field];\n }\n else\n {\n $bind[\":$field\"] = $this->data[$field];\n }\n }\n $this->bind = $bind;\n }", "public function bind($param, $value, $type = null){\r\n if(is_null($type)){\r\n switch(true){\r\n case is_int($value):\r\n $type = PDO::PARAM_INT;\r\n break;\r\n case is_bool($value):\r\n $type = PDO::PARAM_BOOL;\r\n break;\r\n case is_null($value):\r\n $type = PDO::PARAM_NULL;\r\n break;\r\n default:\r\n $type = PDO::PARAM_STR; \r\n }\r\n }\r\n\r\n $this->stmt->bindValue($param, $value, $type);\r\n }", "public function bind($param, $value, $type = null)\n {\n if (is_null($type)) {\n switch (true) {\n case is_int($value):\n $type = PDO::PARAM_INT;\n break;\n case is_bool($value):\n $type = PDO::PARAM_BOOL;\n break;\n case is_null($value):\n $type = PDO::PARAM_NULL;\n break;\n default:\n $type = PDO::PARAM_STR;\n break;\n }\n }\n $this->dbStmt->bindValue($param, $value, $type);\n }", "public function replaceBinds($sql, $binds = array())\n\t{\n\t\t$binds = (Array) $binds;\n\t\t\n\t\t// named binds\n\t\tif(preg_match_all('/:([\\w]+)(?=\\s|$)/', $sql, $matches))\n\t\t{\n\t\t\t$result = '';\n\t\t\t\n\t\t\t// replace the named binds\n\t\t\tforeach($matches[1] as $id)\n\t\t\t{\n\t\t\t\tif( ! isset($binds[$id]))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_Connection_MissingBindParameterException($id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// add the part before the name and then the escaped data\n\t\t\t\t$result .= strstr($sql, ':' . $id, true) . $this->escape($binds[$id]);\n\t\t\t\t// make $sql contain the next to match, this to prevent matching in the previously escaped data\n\t\t\t\t$sql = substr($sql, strpos($sql, ':' . $id) + strlen($id) + 1);\n\t\t\t}\n\t\t\t\n\t\t\t// assemble\n\t\t\t$res = $result . $sql;\n\t\t}\n\t\t// unnamed binds\n\t\telse\n\t\t{\n\t\t\t// split the condition\n\t\t\t$parts = explode('?', $sql);\n\t\t\t$c = count($parts) - 1;\n\t\t\t\n\t\t\tif($c > count($binds))\n\t\t\t{\n\t\t\t\tthrow new Db_Connection_MissingBindParameterException($c);\n\t\t\t}\n\t\t\t\n\t\t\t$res = '';\n\t\t\t\n\t\t\t// insert the binds\n\t\t\tfor($i = 0; $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$res .= $parts[$i] . $this->escape($binds[$i]);\n\t\t\t}\n\t\t\t\n\t\t\t// add the last part\n\t\t\t$res .= $parts[$i];\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "public static function bindParams($stmt,$params=array()){\n foreach($params as $placeHolder => $value){\n $stmt->bindParam($placeHolder,$value);\n }\n return $stmt;\n }", "public function bind($param, $value, $type = null)\n {\n if(is_null($type)) {\n switch (true) {\n case is_int($value):\n $type = PDO::PARAM_INT;\n break;\n case is_bool($value):\n $type = PDO::PARAM_BOOL;\n break;\n case is_null($value):\n $type = PDO::PARAM_NULL;\n break;\n default:\n $type = PDO::PARAM_STR;\n }\n }\n $this->statement->bindValue($param, $value, $type);\n }", "private function getBindParam($param){\n $bind_param = null;\n if(is_int($param)){\n $bind_param = 'i';\n }\n else if(is_double($param)){\n $bind_param = 'd';\n }\n else if(is_string($param)){\n $bind_param = 's';\n }\n else{\n $bind_param = 'b';\n }\n\n return $bind_param;\n }", "public function bindValue($column, $value, $type = 'string')\n {\n parent::bindValue($column, $value, $type);\n if ($type === null) {\n $type = 'string';\n }\n if (!ctype_digit($type)) {\n $value = $this->cast($value, $type)[0];\n }\n $this->_compiledParams[$column] = $value;\n }", "public function addParam($name,$value)\n\t\t{\n\t\t\t$this->param[$name] = $value;\n\t\t}", "public function add_query_var($qv)\n {\n }", "private function bindValues() {\n\t\tforeach ($this->builder->bindings as $key => $value) {\n\t\t\t$this->statement->bindValue(\n\t\t\t\t(is_string($key) ? $key : $key + 1),\n\t\t\t\t$value,\n\t\t\t\t(is_int($value) || is_float($value) ? PDO::PARAM_INT : PDO::PARAM_STR)\n\t\t\t);\n\t\t}\n\n\t\t// Reset Builder - ready for next statement\n\t\t$this->builder->bindings = [];\n\t\t$this->builder->wheres = [];\n\t}", "public function queryParam($name);", "public static function bindValues($stmt,$params=array()){\n foreach($params as $placeHolder => $value){\n $stmt->bindValue($placeHolder,$value);\n }\n return $stmt;\n }", "public function bind($param, $value, $type = null)\r\n {\r\n if (is_null($type))\r\n {\r\n switch (true)\r\n {\r\n case is_int($value):\r\n $type = PDO::PARAM_INT;\r\n break;\r\n case is_bool($value):\r\n $type = PDO::PARAM_BOOL;\r\n break;\r\n case is_null($value):\r\n $type = PDO::PARAM_NULL;\r\n break;\r\n default:\r\n $type = PDO::PARAM_STR;\r\n }\r\n }\r\n $this->stmt->bindValue($param, $value, $type);\r\n }", "public function addQuerystringParameter($key, $value)\n {\n $this->querystringParams[$key] = $value;\n }", "public function bind($param, $value, $type=null) {\n\n //If the type was set to null\n if (is_null($type)) {\n //Automatically set it.\n switch (true) {\n //If It is an integer\n case is_int($value):\n $type = PDO::PARAM_INT;\n break;\n //If a boolean do this\n case is_bool($value):\n $type = PDO::PARAM_BOOL;\n break;\n //If a null value do this\n case is_null($value):\n $type = PDO::PARAM_NULL;\n break;\n //Otherwise do this.\n default:\n $type = PDO::PARAM_STR;\n break;\n }\n }\n\n //Bind the parameter to the statement\n $this->_pstmt->bindValue($param, $value, $type);\n }", "static private function bind_params( &$sth, &$paramArray, &$datatypeArray )\n {\n if( isset( $paramArray ) )\n {\n $arrayCount = count($paramArray);\n for( $i = 0 ; $i < $arrayCount ; $i++ )\n {\n $param = (isset($paramArray[$i]) ? $paramArray[$i] : NULL);\n $datatype = (isset($datatypeArray[$i]) ? $datatypeArray[$i] : NULL);\n \n if( !$sth->bindValue(($i+1), $param, $datatype) )\n throw new PDOException(\"Database::bind_params() error: binding failure.\");\n }\n }\n }", "private function bindParams($statement, $params)\n\t{\n\t\tif(!$params) return $statement;\n\n\t\t$types = \"\";\n\t\tif (phpversion() >= '5.3')\n\t\t{\n\t\t $bind = array();\n\t\t foreach($params as $key => $val)\n\t\t {\n\t\t\t\t$types .= $this->mysqlParamType($val);\n\t\t $bind[] = &$params[$key];\n\t\t }\n\t\t} \n\t\telse\n\t\t $bind = array_values($params);\n\n\t\tarray_unshift($bind, $types);\n\tdebug(\"bindParams\", $bind);\n\t\tcall_user_func_array(array($statement, 'bind_param'), $bind);\n\n\t\treturn $statement;\n\t}", "private function bindParameters(&$obj, &$bind_params_r)\n {\n call_user_func_array(array($obj, \"bind_param\"), $bind_params_r);\n }", "function bindResidentHousingApplication($STATEMENT_ID,$databaseFieldWeNeed,$fieldWeWantToSpecify){\n return oci_bind_by_name($STATEMENT_ID,$databaseFieldWeNeed,$fieldWeWantToSpecify);\n }", "public function binder(&$statement, $param, $value, $type = null){\n\t\tif(is_null($type)){\n\t\t\tif(is_null($value)) $type = PDO::PARAM_NULL;\n\t\t\telse if(is_int($value)) $type = PDO::PARAM_INT;\n\t\t\telse if(is_bool($value)) $type = PDO::PARAM_BOOL;\n\t\t\telse $type = PDO::PARAM_STR;\n\t\t}\n\t\t$statement->bindValue($param, $value, $type);\n\t}", "public function bindColumn($column, &$param, $type = NULL, $maxlen = 0, $driverdata = NULL)\r\n\t{\r\n\t\tif(!is_resource($this->resource))\r\n\t\t{\r\n\t\t\tthrow new LikePDOException(\"There is no active statement\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->columnsBound[$column] = array\r\n\t\t\t(\r\n\t\t\t\t\"param\" => &$param,\r\n\t\t\t\t\"type\" => $type,\r\n\t\t\t\t\"maxlen\" => $maxlen\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function bind()\n {\n foreach ($this->columns as $column) {\n $column->bind();\n }\n }", "protected function bind( &$stmt, $obj )\n\t{\n\t\t$words = StrUtil::multiexplode( array(' ','=',',','(',')'), $stmt->queryString );\n\t\tforeach ($obj as $key => &$value) {\n\t\t\tif( $this->paramExists( $words, $key ) ){\n\t\t\t\t$stmt->bindParam($key, $this->convert($value) );\n\t\t\t}\n\t\t}\n\t}", "function query_prepared($query, $param=null)\n { \n $stmt = $this->dbh->prepare($query);\n foreach ($param as $index => $val) {\n // indexing start from 1 in Sqlite3 statement\n if (is_array($val)) {\n $ok = $stmt->bindParam($index + 1, $val);\n } else {\n $ok = $stmt->bindValue($index + 1, $val, $this->getArgType($val));\n }\n \n if (!$ok) {\n $type_error = \"Unable to bind param: $val\";\n $this->register_error($type_error);\n $this->show_errors ? trigger_error($type_error,E_USER_WARNING) : null;\n return false;\n }\n }\n \n return $stmt->execute();\n }", "public function bindParam($parameter, &$variable, $data_type = false, $length = NULL, $driver_options = NULL)\n {\n }", "public function bindValue(string | int $param, mixed $value, int $type = \\PDO::PARAM_STR);", "protected function queryBindParam($stmt, $format_chars, $format_str, $param_arr) {\n\n foreach ($param_arr as $k => $v) {\n\n $type = $format_chars[$k];\n\n switch ($type) {\n\n case 'i':\n $param_arr[$k] = (int) $v;\n break;\n\n case 'd':\n $param_arr[$k] = (float) $v;\n break;\n\n case 't':\n $param_arr[$k] = stripslashes($v);\n break;\n\n case 'a':\n $param_arr[$k] = $this->cleaner($v, TRUE);\n break;\n\n default: $this->cleaner($v);\n }\n\n $param_arr[$k] = & $param_arr[$k];\n }\n\n if (call_user_func_array(array($stmt, 'bind_param'), array_merge(array($format_str), $param_arr))) {\n\n return $stmt;\n }\n\n trigger_error(sprintf('%s [%s]: [%s]', __METHOD__, $stmt->errno, $stmt->error));\n return FALSE;\n }", "protected function bindParam($value): string\n {\n // Value already defined?\n $index = array_search($value, $this->Parameters, true);\n if ($index !== false) {\n return $index;\n } else if (is_int($value) || is_float($value)) {\n return $value;\n } else {\n // get the next parameter index and count up\n $index = ':param' . $this->ParameterIndex++;\n\n // save value\n $this->Parameters[$index] = $value;\n\n // return index\n return $index;\n }\n }", "protected function bindValues(PDOStatement &$stmt) {\n\t\t$stmt->bindValue(1,$this->getIdChat());\n\t\t$stmt->bindValue(2,$this->getIdJoueur());\n\t\t$stmt->bindValue(3,$this->getPseudo());\n\t\t$stmt->bindValue(4,$this->getQuand());\n\t\t$stmt->bindValue(5,$this->getMessage());\n\t}", "public function addParameter(string $name, $value): self;", "function addToWhereArray($inputName,$dbColumn,$dbRelation) {\n\t\tif(!empty($_GET[$inputName])) {\n\t\t\tif($dbRelation==='like') {\n\t\t\t\t$this->whereArray[count($this->whereArray)] = [$dbColumn,$dbRelation,'%'.$_GET[$inputName].'%'];\n\t\t\t} else {\n\t\t\t\t$this->whereArray[count($this->whereArray)] = [$dbColumn,$dbRelation,$_GET[$inputName]];\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}", "protected function bindParametersFromContainer()\n {\n $parameters = $this->parameterContainer->getNamedArray();\n $type = '';\n $args = [];\n\n foreach ($parameters as $name => &$value) {\n if ($this->parameterContainer->offsetHasErrata($name)) {\n switch ($this->parameterContainer->offsetGetErrata($name)) {\n case ParameterContainer::TYPE_DOUBLE:\n $type .= 'd';\n break;\n case ParameterContainer::TYPE_NULL:\n $value = null; // as per @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php#96148\n case ParameterContainer::TYPE_INTEGER:\n $type .= 'i';\n break;\n case ParameterContainer::TYPE_STRING:\n default:\n $type .= 's';\n break;\n }\n } else {\n $type .= 's';\n }\n $args[] = &$value;\n }\n\n if ($args) {\n array_unshift($args, $type);\n call_user_func_array([$this->resource, 'bind_param'], $args);\n }\n }", "public function addParam($key, $value)\n {\n $this->_params[$key] = $value;\n }", "public function bindAndExecute()\n\t{\n\n\t\t//$params = func_get_args();\n\n\t\t// The only way to get the parameters by reference is to use the debug_backtrace functions rather than\n\t\t// func_get_args. I'm not a fan of this but it works.\n\n $params = array();\n\n\t\t$stack = debug_backtrace();\n\t\tif(isset($stack[0][\"args\"]))\n\t\t\tfor($i=0; $i < count($stack[0][\"args\"]); $i++)\n\t\t\t\t$params[$i] = & $stack[0][\"args\"][$i];\n\n\n\n\n\n\n\t\tMysqlBase::$queryCount++;\n\n\t\t$arrayIndex = $this->myQuery . ' ' . implode('::', $params);\n\t\tif(isset(MysqlBase::$queryArray[$arrayIndex]))\n\t\t{\n\t\t\tMysqlBase::$queryArray[$arrayIndex]++;\n\t\t}else{\n\t\t\tMysqlBase::$queryArray[$arrayIndex] = 1;\n\t\t}\n\n\n\t\tif(!call_user_func_array(array($this, 'bind_param'), $params))\n\t\t\t$this->throwError();\n\n\t\tif($this->execute())\n\t\t{\n\t\t\t$this->store_result();\n\t\t\treturn true;\n\t\t}else{\n\t\t\tif($this->errno > 0)\n\t\t\t\t$this->throwError();\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function bind($bind, $choice, $length){\n $choice = strtolower($choice);\n //the ideas from lecture notes\n $choice = str_replace(\"'\", \"''\", $choice);\n oci_bind_by_name($this->result, $bind, $choice, $length);\n }", "public function bindIn(&...$binds);", "function bindTerm($STATEMENT_ID,$termWeWant,$fieldWeAreChanging){\n return oci_bind_by_name($STATEMENT_ID,$termWeWant,$fieldWeAreChanging);\n }", "public function bindParam($pos, &$value, $type = \\PDO::PARAM_STR, $length = 0, $driver_options = null)\n {\n $this->connection->getProfiler()->start();\n\n return parent::bindParam($pos, $value, $type, $length, $driver_options);\n }", "public function bindParam($name, &$value, $dataType=null, $length=null, $driverOptions=null)\n {\n \t$this->prepare();\n \tif($dataType===null)\n \t\t$this->_statement->bindParam($name,$value,$this->_connection->getPdoType(gettype($value)));\n \telse if($length===null)\n \t\t$this->_statement->bindParam($name,$value,$dataType);\n \telse if($driverOptions===null)\n \t\t$this->_statement->bindParam($name,$value,$dataType,$length);\n \telse\n \t\t$this->_statement->bindParam($name,$value,$dataType,$length,$driverOptions);\n \t$this->_paramLog[$name]=&$value;\n \treturn $this;\n }", "public function bindColumn($column, &$param, $type = PDO::PARAM_STR, $maxlen = null, $driverdata = null)\n {\n if ($maxlen !== null || $driverdata !== null) {\n throw new PDOException('$maxlen and $driverdata parameters '\n . 'are not implemented for Oci8PDO_Statement::bindColumn()');\n }\n if ($type !== PDO::PARAM_INT && $type !== PDO::PARAM_STR) {\n throw new PDOException('Only PDO::PARAM_INT and PDO::PARAM_STR '\n . 'are implemented for the $type parameter of Oci8PDO_Statement::bindColumn()');\n }\n\n $this->boundColumns[] = [\n 'column' => $column,\n 'param' => &$param,\n 'type' => $type\n ];\n }", "public function bindMore($parray)\n {\n if(empty($this->parameters) && is_array($parray)) {\n $columns = array_keys($parray);\n foreach($columns as $i => &$column)\t{\n $this->bind($column, $parray[$column]);\n }\n }\n }", "public function add_query_var($qv) {\n\t\tif ( !in_array($qv, $this->public_query_vars) )\n\t\t\t$this->public_query_vars[] = $qv;\n\t}", "function dbh_query_bind( $sql ) {\n if ( isset( $GLOBALS['orm_dbh'] ) ) $use_dbh = $GLOBALS['orm_dbh'];\n if ( ORM_SQL_PROFILE ) START_TIMER('dbh_query_bind');\n $bind_params = array_slice( func_get_args(), 1 );\n ### Allow params passed in an array or as args\n if ( is_a( $bind_params[ count($bind_params) - 1 ], 'PDO' ) || is_a( $bind_params[ count($bind_params) - 1 ], 'PhoneyPDO' ) ) $use_dbh = array_pop($bind_params);\n if ( ! isset( $GLOBALS['orm_dbh'] ) ) $GLOBALS['orm_dbh'] = $use_dbh; # steal their DBH for global use, hehehe\n if ( count( $bind_params ) == 1 && is_array(array_shift(array_values($bind_params))) ) { $bind_params = array_shift(array_values($bind_params)); };\n# if (ORM_SQL_DEBUG) trace_dump();\n reverse_t_bools($bind_params);\n if (ORM_SQL_DEBUG) bug($sql, $bind_params);\n try { \n $sth = $use_dbh->prepare($sql);\n $rv = $sth->execute($bind_params);\n } catch (PDOException $e) {\n trace_dump();\n $err_msg = 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line();\n if ( strlen($err_msg) > 1024 ) {\n bug($err_msg,$sql,$bind_params,$e->getMessage());\n $sql = substr($sql,0,1020 + strlen($sql) - strlen($err_msg) ).'...';\n }\n trigger_error( 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line(), E_USER_ERROR);\n return false;\n }\n if ( ORM_SQL_PROFILE ) END_TIMER('dbh_query_bind');\n return $sth;\n }", "public function addParam($param, $raw = true)\n {\n if ($param instanceof PMA_Message) {\n $this->_params[] = $param;\n } elseif ($raw) {\n $this->_params[] = htmlspecialchars($param);\n } else {\n $this->_params[] = PMA_Message::notice($param);\n }\n }", "public function addQueryParams($params) {}", "protected function bindValues(PDOStatement &$stmt) {\n\t\t$stmt->bindValue(1,$this->getId());\n\t\t$stmt->bindValue(2,$this->getGenre());\n\t\t$stmt->bindValue(3,$this->getJaar());\n\t\t$stmt->bindValue(4,$this->getMaand());\n\t\t$stmt->bindValue(5,$this->getNummer());\n\t\t$stmt->bindValue(6,$this->getMutualiteit());\n\t\t$stmt->bindValue(7,$this->getFactuurdatum());\n\t\t$stmt->bindValue(8,$this->getFactuurFile());\n\t\t$stmt->bindValue(9,$this->getCreditActief());\n\t\t$stmt->bindValue(10,$this->getVervangt());\n\t}", "public function bindValue($parameter, $value, $data_type = false)\n {\n }", "public function bindValue($name, $value, $dataType = null)\n\t{\n\t\t$this->prepare();\n\t\tif ($dataType === null) {\n\t\t\t$this->pdoStatement->bindValue($name, $value, $this->connection->getPdoType(gettype($value)));\n\t\t} else {\n\t\t\t$this->pdoStatement->bindValue($name, $value, $dataType);\n\t\t}\n\t\t$this->_paramLog[$name] = $value;\n\t\treturn $this;\n\t}", "protected function add_parameter($name, $details)\n\t{\n\t\t$this->P->add_parameter($name, $details);\n\t}", "public function statement($query, $bindings = []);", "public function statement($query, $bindings = []);", "public function preparedQuery( $query, array $_binds )\n\t{\n\t\t/* Init Bind object */\n\t\t$bind = new Db\\Bind();\n\t\t\n\t\t/* Sort out subqueries */\n\t\t$binds = array();\n\t\t$i = 0;\n\t\tforeach ( $_binds as $bindVal )\n\t\t{\n\t\t\t$i++;\n\t\t\tif ( $bindVal instanceof \\IPS\\Db\\Select )\n\t\t\t{\n\t\t\t\t$pos = 0;\n\t\t\t\tfor ( $j=0; $j<$i; $j++ )\n\t\t\t\t{\n\t\t\t\t\t$pos = mb_strpos( $query, '?', $pos ) + 1;\n\t\t\t\t}\n\t\t\t\t$query = mb_substr( $query, 0, $pos - 1 ) . $bindVal->query . mb_substr( $query, $pos );\n\t\t\t\t$i--;\n\t\t\t\t\n\t\t\t\tforeach ( $bindVal->binds as $v )\n\t\t\t\t{\n\t\t\t\t\t$binds[] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$binds[] = $bindVal;\n\t\t\t}\n\t\t}\n\n\t\t/* Loop values to bind */\n\t\t$i = 0;\n\t\t$longThreshold = 1048576;\n\t\t$sendAsLong = array();\n\t\tforeach ( $binds as $bindVal )\n\t\t{\n\t\t\tif( ( is_object( $bindVal ) OR is_string( $bindVal ) ) AND \\strlen( (string) $bindVal ) > $longThreshold )\n\t\t\t{\n\t\t\t\t$sendAsLong[ $i ] = (string) $bindVal;\n\t\t\t}\n\n\t\t\t$i++;\n\t\t\tswitch ( gettype( $bindVal ) )\n\t\t\t{\n\t\t\t\tcase 'boolean':\n\t\t\t\tcase 'integer':\n\t\t\t\t\t$bind->add( 'i', $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'double':\n\t\t\t\t\t$bind->add( 'd', $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcase 'string':\n\t\t\t\t\t$bind->add( 's', ( \\strlen( $bindVal ) > $longThreshold ) ? NULL : $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'object':\n\t\t\t\t\tif( method_exists( $bindVal, '__toString' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bind->add( 's', ( \\strlen( $bindVal ) > $longThreshold ) ? NULL : (string) $bindVal );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Deliberately no break\n\t\t\t\t\t\n\t\t\t\tcase 'NULL':\n\t\t\t\tcase 'array':\n\t\t\t\tcase 'resource':\n\t\t\t\tcase 'unknown type':\n\t\t\t\tdefault:\n\t\t\t\t\t/* For NULL values, you can't bind, so we adjust the query to actually pass a NULL value */\n\t\t\t\t\t$pos = 0;\n\t\t\t\t\tfor ( $j=0; $j<$i; $j++ )\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos = mb_strpos( $query, '?', $pos ) + 1;\n\t\t\t\t\t}\n\t\t\t\t\t$query = mb_substr( $query, 0, $pos - 1 ) . 'NULL' . mb_substr( $query, $pos );\n\t\t\t\t\t$i--;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t/* Log */\n\t\tif ( \\IPS\\QUERY_LOG )\n\t\t{\t\n\t\t\t/* Replace ?s with the actual values */\n\t $logQuery = $query;\n\t foreach ( $binds as $b )\n\t {\n\t\t $logQuery = preg_replace( '/\\?/', var_export( $b, TRUE ), $logQuery, 1 );\n\t }\n\t \n\t\t\t/* Log */\n\t\t\t$this->log( $logQuery );\t\n\t\t}\n\t\t\n\t\t/* Add a backtrace to the query so we know where it came from if it causes issues */\n\t\t$comment = '??';\n\t\t$line = '?';\n\t\tforeach( debug_backtrace( FALSE ) as $b )\n\t\t{\n\t\t\tif ( isset( $b['line'] ) )\n\t\t\t{\n\t\t\t\t$line = $b['line'];\n\t\t\t}\n\t\t\t\n\t\t\tif( isset( $b['class'] ) and $b['class'] !== 'IPS\\_Db' and $b['class'] !== 'IPS\\Db\\_Select' )\n\t\t\t{\n\t\t\t\t$comment = \"{$b['class']}::{$b['function']}:{$line}\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$_query = $query;\n\t\t$query = \"/*{$comment}*/ {$query}\";\n\t\t\t\t\n\t\t/* Prepare */\n\t\t$stmt = parent::prepare( $query );\n\t\tif( $stmt === FALSE )\n\t\t{\n\t\t\tthrow new \\IPS\\Db\\Exception( $this->error, $this->errno, NULL, $_query, $binds );\n\t\t}\n\t\t\n\t\t/* Bind values */\n\t\tif( $bind->haveBinds() === TRUE )\n\t\t{\n\t\t\tcall_user_func_array( array( $stmt, 'bind_param' ), $bind->get() );\n\n\t\t\tif( count( $sendAsLong ) )\n\t\t\t{\n\t\t\t\tforeach( $sendAsLong as $index => $data )\n\t\t\t\t{\n\t\t\t\t\t$chunks = str_split( $data, $longThreshold - 1 );\n\n\t\t\t\t\tforeach( $chunks as $chunk )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stmt->send_long_data( $index, $chunk );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Execute */\n\t\t$stmt->execute();\t\t\n\t\tif ( $stmt->error )\n\t\t{\n\t\t\tthrow new \\IPS\\Db\\Exception( $stmt->error, $stmt->errno, NULL, $_query, $binds );\n\t\t}\n\t\t$stmt->store_result();\n\t\t\t\t\t\t\n\t\t/* Return a Statement object */\n\t\treturn $stmt;\n\t}", "public function bind($param, & $var)\n\t{\n\t\t$this->parameters[$param] =& $var;\n\n\t\treturn $this;\n\t}", "private function setParam($statemant, $key, $value){\n\t\t$statemant->bindParam($key, $value);\n\t}", "public function bind($parameter, $value, $type = null) {\n switch (is_null($type)) {\n case is_int($value):\n $type = PDO::PARAM_INT;\n break;\n case is_bool($value):\n $type = PDO::PARAM_BOOL;\n break;\n case is_null($value):\n $type = PDO::PARAM_NULL;\n break;\n default:\n $type = PDO::PARAM_STR;\n }\n $this->statement->bindValue($parameter, $value, $type);\n }", "function addExtraParameter($name) {\n\t\t$this->addParameter($name, Request::getParameter($name));\n\t}", "public function setParameter($name, $value): QueryBuilderInterface;", "function bindAllValues($statement, $params)\n {\n foreach($params as $param => $value)\n {\n $statement->bindValue(':'.$param, $value);\n }\n return $statement;\n }", "private function bindValues(\\PDOStatement $stmt, array $bindings): \\PDOStatement {\n\t\tfor ($i = 0; $i < count($bindings); $i++) {\n\t\t\t$param = $i + 1;\n\t\t\tif (is_int($bindings[$i])) {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_INT);\n\t\t\t} else {\n\t\t\t\t$stmt->bindParam($param, $bindings[$i], \\PDO::PARAM_STR);\n\t\t\t}\n\t\t}\n\t\treturn $stmt;\n\t}", "private function bindParams(Statement &$stmt, array $vars = [])\n {\n $types = '';\n $params = [];\n\n // Loop through each of the query vars, and calculate their types\n foreach ($vars as $var) {\n $type = 's';\n\n if (is_float($var)) {\n $type = 'd';\n }\n\n if (is_int($var)) {\n $type = 'i';\n }\n\n $types .= $type;\n }\n\n // Add the types string to the beginning of the array\n $params = [$types];\n\n // Add each of the vars to the array\n foreach ($vars as $key => $var) {\n $params[] = &$vars[$key];\n }\n\n // Pass the array as parameters to mysqli_stmt_bind_param\n $ref = new ReflectionClass('mysqli_stmt');\n $bind = $ref->getMethod('bind_param');\n $bind->invokeArgs($stmt, $params);\n }", "function bindParam($stmt, $type, $arg1, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL, $arg5 = NULL, $arg6 = NULL) {\n $numargs = func_num_args();\n $numtypes = strlen($type);\n\n if ($numargs <= 2) {\n echo \"Invalid number of arguments in bindParam. ($numargs)\";\n die();\n } else if ($numtypes != ($numargs - 2)) {\n echo \"Invalid number of types in \\$type.\"\n . \"$numtypes types specified for \"\n . ($numargs - 2) . \" arguments.\";\n die();\n }\n switch ($numargs) {\n case 3:\n if (!($stmt->bind_param($type, $arg1))) {\n echo \"Database binding error.\";\n die();\n }\n break;\n case 4:\n if (!($stmt->bind_param($type, $arg1, $arg2))) {\n echo \"Database binding error.\";\n die();\n }\n break;\n case 5:\n if (!($stmt->bind_param($type, $arg1, $arg2, $arg3))) {\n echo \"Database binding error.\";\n die();\n }\n break;\n case 6:\n if (!($stmt->bind_param($type, $arg1, $arg2, $arg3, $arg4))) {\n echo \"Database binding error.\";\n die();\n }\n break;\n case 7:\n if (!($stmt->bind_param($type, $arg1, $arg2, $arg3, $arg4, $arg5))) {\n echo \"Database binding error.\";\n die();\n }\n break;\n case 8:\n if (!($stmt->bind_param($type, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6))) {\n echo \"Database binding error.\";\n die();\n }\n break;\n default:\n echo \"Invalid number of arguments in bindParam. ($numargs)\";\n die();\n }\n}", "public function bindValue($name, $value, $dataType=null)\n {\n \t$this->prepare();\n \tif($dataType===null)\n \t\t$this->_statement->bindValue($name,$value,$this->_connection->getPdoType(gettype($value)));\n \telse\n \t\t$this->_statement->bindValue($name,$value,$dataType);\n \t$this->_paramLog[$name]=$value;\n \treturn $this;\n }", "public function bind( $params , $value , $type ){\n\t\tif( is_null($type) ){\n\t\t\tswitch (true) {\n\t\t\t\tcase is_int($value):\n\t\t\t\t\t$type = PDO::PARAM_INT ;\n\t\t\t\t\tbreak;\n\t\t\t\tcase is_bool($value):\n\t\t\t\t\t$type = PDO::PARAM_BOOL ;\n\t\t\t\t\tbreak;\n\t\t\t\tcase is_null($value):\n\t\t\t\t\t$type = PDO::PARAM_NULL ;\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\t$type = PDO::PARAM_STR ;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$this->statement->bind( $params , $value , $type ) ;\n\t}", "function dbh_bind( $dbh ) {\n $GLOBALS['orm_dbh'] = $dbh;\n}" ]
[ "0.72067755", "0.71270436", "0.6674223", "0.64940035", "0.6464403", "0.6371666", "0.6351975", "0.62718636", "0.627014", "0.625741", "0.6153433", "0.6101076", "0.60575986", "0.6035389", "0.6032857", "0.5989612", "0.59879047", "0.5977871", "0.59764", "0.59725547", "0.5963982", "0.5961549", "0.5930342", "0.5930302", "0.590556", "0.58979315", "0.5880823", "0.58613205", "0.58515483", "0.5843996", "0.583633", "0.5824347", "0.5803044", "0.57975155", "0.5793613", "0.57834685", "0.5758378", "0.5749585", "0.57436955", "0.5740078", "0.5736441", "0.5730584", "0.57202464", "0.5713019", "0.571013", "0.5708325", "0.57027745", "0.5669883", "0.56675404", "0.56600696", "0.5653623", "0.56497616", "0.5617964", "0.5598882", "0.5591906", "0.5590683", "0.5590291", "0.55781513", "0.5566753", "0.55602604", "0.55536264", "0.5548013", "0.5539822", "0.5539433", "0.55370474", "0.5521671", "0.5520443", "0.5520384", "0.5517474", "0.5513724", "0.549212", "0.54625314", "0.5450656", "0.5440783", "0.54380405", "0.54240143", "0.54226065", "0.5421623", "0.54215175", "0.5414502", "0.53995025", "0.5371866", "0.53671175", "0.5363262", "0.53592765", "0.5355968", "0.5355968", "0.53499466", "0.5349364", "0.5344079", "0.5341626", "0.5335827", "0.5335303", "0.53330386", "0.53287476", "0.5325523", "0.5320128", "0.5318335", "0.53183246", "0.5316171" ]
0.54732335
71
Allows treat the object as a string
public function __toString() { return $this->to_sql(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function objectAsString($object);", "public function objectToString($obj);", "function objectToString( &$object ) {\n\n\t}", "function toString ($object)\n{\n\treturn get_class($object);\n}", "function dataToString($object=null) {\r\n\t\treturn $object->__toString();\r\n\t}", "public static function is_stringable_object($input)\n {\n }", "public abstract function __toString();", "static function toString($var){\n\t\tif(self::isString($var)){\n\t\t\treturn $var;\n\t\t}else if(self::isObject($var)){\n\t\t\tif(self::isStringObject($var) || self::isFileObject($var)){\n\t\t\t\treturn $var->val();\n\t\t\t}\n\t\t}\n\n\t\treturn (string) $var;\n\t}", "public function __toString()\n {\n return $this->str;\n }", "private static function objToStr($obj)\n {\n return method_exists($obj, '__toString') ? (string)$obj : get_class($obj) . '@' . spl_object_hash($obj);\n }", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "function to_str(){\n //\n //A string version of a literal is basicaly the literal itself as a string \n //hence it should be encosed in double quotes incase it is needed to be \n //converted into json\n return \"'$this->value'\";\n }", "private function convertObjectToString ($str)\n {\n if ( is_array($str) || is_object($str) )\n return serialize($str);\n\n return $str;\n }", "function __toString();", "function __toString();", "function __toString();", "public function __toString()\n {\n return $this->str_value;\n }", "function asString();", "function asString();", "function __toString() {\n return $this->string();\n }", "public function __toString()\n {\n $type = gettype($this->value);\n\n switch ($type) {\n case 'boolean':\n return $this->boolean($this->value);\n break;\n case 'integer':\n return $this->int($this->value);\n break;\n case 'double':\n return $this->float($this->value);\n break;\n case 'string':\n return $this->string($this->value);\n break;\n case 'array':\n return $this->array($this->value);\n break;\n case 'object':\n return $this->object($this->value);\n break;\n case 'resource':\n return $this->resource($this->value);\n break;\n case 'NULL':\n return 'NULL';\n break;\n default:\n return '(unknown type)';\n break;\n };\n }", "public function __toString() { return $this->as_string(); }", "public function __toString()\n {\n return $this->str;\n }", "abstract public function __toString();", "abstract public function __toString();", "abstract public function __toString();", "abstract public function __toString();", "abstract public function __toString();", "abstract public function __toString();", "public static function stringable($object): bool\n {\n if (!is_object($object)) {\n return false;\n }\n\n return method_exists($object, '__toString');\n }", "public function __toString()\n {\n notice('Object: \"'.get_class($this).'\" is used as string');\n\n return 'Object('.get_class($this).')';\n }", "protected function _asText()\n {\n return (string) parent::__toString();\n }", "function o_castString($value) {\n\t\t\treturn Obj::singleton()->castString($value);\n\t\t}", "public function toString() {}", "public function toString() {}", "public function toString() {}", "public function toString() {}", "public function toString() {}", "public function toString() {}", "function __toString() ;", "function __toString() ;", "public function __toString(){\n return $this->convert();\n }", "abstract public function __toString() ;", "public function __tostring();", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}" ]
[ "0.82396567", "0.7392192", "0.71866757", "0.7130644", "0.71025455", "0.70260805", "0.679866", "0.6798016", "0.6787454", "0.67759484", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.67748266", "0.6746033", "0.6740347", "0.6732841", "0.6732841", "0.6732841", "0.67313606", "0.67176235", "0.67176235", "0.668677", "0.6684539", "0.66720086", "0.6667564", "0.6658947", "0.6658947", "0.6658947", "0.6658947", "0.6658947", "0.6658947", "0.66535354", "0.6646166", "0.6622115", "0.66140157", "0.6593669", "0.6593669", "0.65928984", "0.65928984", "0.65928984", "0.6591201", "0.6584691", "0.65837824", "0.65604883", "0.65582514", "0.6555958", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552197", "0.6552197", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829", "0.6551829" ]
0.0
-1
Sluggable// Return the sluggable configuration array for this model.
public function sluggable() { return [ 'slug' => [ 'source' => 'tags' ] ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sluggable() : array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n 'onUpdate' => false,\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true,\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'slug_or_title',\n ],\n ];\n }", "public function sluggable(): array\n {\n return ['slug' => ['source' => 'title']];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['seo_url', 'seo_url1']\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['title']\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'sluglot'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name',\n\t\t\t],\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug'=>[\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'judul'\n ]\n ];\n }", "public function sluggable(): array\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name'\n\t\t\t]\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug_subway' => [\n 'source' => 'slugsubways',\n 'unique' => false\n ],\n 'slug_district' => [\n 'source' => 'slugdistricts',\n 'unique' => false\n ],\n 'slug_area' => [\n 'source' => 'slugareas',\n 'unique' => false\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['id', 'seo_name', 'company.name', 'municipality'],\n 'separator' => '-'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'job_title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug_name' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name'\n\t\t\t]\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n 'maxLength' => 90\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'page_slug' => [\n 'source' => 'page_title',\n 'maxLength' => null,\n 'maxLengthKeepWords' => true,\n 'method' => null,\n 'separator' => '-',\n 'unique' => true,\n 'uniqueSuffix' => null,\n 'includeTrashed' => false,\n 'reserved' => null,\n 'onUpdate' => false\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'slug_or_title',\n\t\t\t],\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'description'\n ]\n ];\n }", "public function sluggable()\n {\n return ['slug' =>\n ['source' => 'name',],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'judul'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'method' => function ($value) {\n return $this->browseable ? $this->browseable->slugFallback($value) : '';\n }\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => ['name', 'franchise']\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'full_name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ],\n 'slug_fa' => [\n 'source' => 'name_fa'\n ],\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ],\n 'translate_key' => [\n 'source' => 'privacyTranslateKey'\n ],\n 'description_translate_key' => [\n 'source' => 'privacyDescriptionTranslateKey'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'titre'\n ]\n ];\n }", "public function sluggable() {\n return [\n 'slug_curso' => [\n 'source' => 'titulo'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'abbreviation' => [\n 'source' => 'abbreviation'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'ofi_direccion'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'product_friendly_url' => [\n 'source' => 'name'\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'name' => [\n 'source' => 'display_name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'alias' => [\n 'source' => 'title'\n ]\n ];\n }", "public function hasSluggable()\n {\n return $this->sluggable ?: false;\n }", "public function sluggable()\n {\n return [\n 'stripe_id' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'username' => [\n 'source' => 'name'\n ]\n ];\n }", "public static function getSlugList(){\n return Arr::flatten(self::all('slug')->toArray());\n }", "public function getSluggableFields()\n {\n return [ 'title' ];\n }", "public function getSlugOptions() : SlugOptions\n {\n return SlugOptions::create()\n ->generateSlugsFrom('title')\n ->saveSlugsTo('slug');\n }", "public function getSlugOptions(): SlugOptions\n {\n return SlugOptions::create()->generateSlugsFrom('title')->saveSlugsTo('slug');\n }" ]
[ "0.7353561", "0.7336823", "0.7324178", "0.7319859", "0.7309407", "0.73035383", "0.73035383", "0.7298271", "0.7298271", "0.7298271", "0.7298271", "0.7298271", "0.7298271", "0.7295287", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7251269", "0.7239406", "0.7239406", "0.7239406", "0.7239406", "0.7239028", "0.7239028", "0.72262126", "0.72144663", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7184894", "0.7183771", "0.71705914", "0.7169269", "0.7141889", "0.71199626", "0.71173257", "0.71098185", "0.7104886", "0.70649624", "0.7041522", "0.70315856", "0.7030637", "0.7024357", "0.70208883", "0.7013043", "0.6981518", "0.6981182", "0.69770944", "0.6957916", "0.6952068", "0.69276196", "0.69136167", "0.69077355", "0.68862027", "0.6869742", "0.680337", "0.67958635", "0.6780668", "0.6762628", "0.66781753", "0.66365796", "0.6603459", "0.6434876", "0.63912916", "0.6234294", "0.6162535", "0.61516017", "0.6093301", "0.60851246" ]
0.72245187
42
Create new queue item
public function newAction() { // the same form is used to create and edit $this->_forward('edit'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createQueue();", "public function createItem($data) {\n // the queue table yet, so we cannot rely on drupal_write_record().\n $query = db_insert('queue')\n ->fields(array(\n 'name' => $this->name,\n 'data' => serialize($data),\n // We cannot rely on REQUEST_TIME because many items might be created\n // by a single request which takes longer than 1 second.\n 'created' => time(),\n ));\n return (bool) $query->execute();\n }", "public function createNewItem();", "public function createQueue() {\n // Drupal is first installed) so there is nothing we need to do to create\n // a new queue.\n }", "public function testAddToQueue()\n {\n $this->setUpDB(['email']);\n \n $Email = new \\EmailTemplate('test');\n \n // Add the message to queue\n $r = $Email->queue('test@st.ro', 'test', 'test');\n \n // get data from DB\n $EmailQueue = new \\EmailQueue();\n $filter = ['too' => 'test@st.ro'];\n $Collection = $EmailQueue->Get($filter, []);\n \n // asserts\n $this->assertEquals(1, $r);\n $this->assertInstanceOf(\\Collection::class, $Collection);\n $this->assertCount(1, $Collection);\n $Item = $Collection->getItem();\n $this->assertInstanceOf(\\SetterGetter::class, $Item);\n $this->assertEquals('test', $Item->getSubject());\n $this->assertEquals('test', $Item->getBody());\n }", "public function add($item)\n {\n $this->queueItems[] = $item;\n }", "function addNewMyQueue($myqueueName)\r\n {\r\n $time = time(); \r\n $q = \"INSERT INTO \".TBL_MYQUEUE.\" VALUES (NULL, '$myqueueName', $time )\";\r\n return mysql_query($q, $this->connection);\r\n }", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function create()\n {\n // Not needed cause this is coming from the item listing\n }", "public function createItem($data);", "public function createItem (Item $item) {\n $this->itemsDB->create($item);\n $item->setId($this->retrieveLastItemId());\n }", "public function test_createQueue() {\n\n }", "public function createQueue($name, $options = null);", "public function testQueueBuilding()\n {\n\n $contract = $this->getScenarioContract();\n $collection = $this->getScenarioCollection();\n\n $probFactory = new \\CsCannon\\MetadataProbeFactory();\n\n $probFactory->populateLocal();\n $probe = $probFactory->getOrCreate($collection,$contract,'null');\n\n\n $this->assertInstanceOf(\\CsCannon\\MetadataProbe::class,$probe,'Could not laod prob');\n\n\n $erc721_3 = \\CsCannon\\Blockchains\\Ethereum\\Interfaces\\ERC721::init(3);\n $erc721_4 = \\CsCannon\\Blockchains\\Ethereum\\Interfaces\\ERC721::init(4);\n $erc721_1 = \\CsCannon\\Blockchains\\Ethereum\\Interfaces\\ERC721::init(1); //this should exist already\n\n $probe->queue($erc721_3);\n\n // $probe->queue($erc721_3,$erc721_4,$erc721_1);\n while($probe->executeQueue()) {\n\n sleep(1);\n\n\n }\n\n\n }", "public function enqueue($item)\n {\n array_push($this->array, $item);\n }", "protected function createItem()\n {\n return $this->_setUpNewNode(\n new Item()\n );\n }", "public function enqueue($item)\n {\n $this->items[] = $item;\n }", "public function Queues();", "public function createItem( $preparedItem ) {\n\t}", "private function performQueueOperations()\n\t{\n\t\t//$this->queue_manager = high_risk\n\t\t$application_id = $this->application->getModel()->application_id;\n\t\t$qi = $this->queue_manager->getQueue(\"high_risk\")->getNewQueueItem($application_id);\n\t\t$this->queue_manager->moveToQueue($qi, \"high_risk\");\t\t\n\t}", "public function createItem($item) {\n\t\treturn tdb::insert(self::$tablename,$item);\n\t}", "public function createNewItem()\n {\n return null;\n }", "function setupNewItem()\n {\n $item = array(\n 'id' => null,\n 'pending_id' => null,\n 'content_id' => null,\n 'created' => date( 'Y-m-d H:i:s'),\n 'createdBy' => $_SESSION['isLoggedUID'],\n 'updated' => null,\n 'updatedBy' => null,\n 'status' => 'create',\n 'topic' => null,\n 'subtopic' => null,\n 'heading' => null,\n 'date' => date( 'Y-m-d H:i:s'),\n 'caption' => null,\n 'text' => null,\n 'download_src' => null,\n 'download_name' => null,\n 'images' => array(),\n 'tags' => array(),\n 'terms' => array());\n $_SESSION['cropId'] = null;\n\n return($item);\n }", "public function add($id) \n {\n $log = FezLog::get();\n if (!array_key_exists($id,$this->_ids) || !$this->_ids[$id]) {\n $this->_ids[$id] = self::ACTION_ADD;\n $log->debug(\"Added $id to queue\");\n }\n }", "function createTask( $queue ) {\n\t\t$query = \"SELECT cd.`ticket_id` FROM `\".BIT_DB_PREFIX.\"task_ticket` cd\n\t\t\t\t\t\t WHERE ti.`ticket_ref` BETWEEN TODAY AND TOMORROW AND cd.`room` = $queue + 80\n\t\t\t\t\t\t AND cd.`office` = 1\n\t\t\t\t \t\t ORDER BY cd.`ticket_ref`\";\n\t\t$next = $this->mDb->getOne( $query );\n// Add switch of user state to serving!\n\t\tif ( $next ) return true;\n\t\telse return false;\n\t}", "function queue() {\n\n\t\t$date = false;\n\t\t$queue = new Queued_Event();\n\t\t$queue->set_workflow_id( $this->get_id() );\n\n\t\tswitch( $this->get_timing_type() ) {\n\n\t\t\tcase 'delayed':\n\t\t\t\t$date = new DateTime();\n\t\t\t\t$date->setTimestamp( time() + $this->get_timing_delay() );\n\t\t\t\tbreak;\n\n\t\t\tcase 'scheduled':\n\t\t\t\t$date = $this->calculate_scheduled_datetime();\n\t\t\t\tbreak;\n\n\t\t\tcase 'fixed':\n\t\t\t\t$date = $this->get_fixed_time();\n\t\t\t\tbreak;\n\n\t\t\tcase 'datetime':\n\t\t\t\t$date = $this->get_variable_time();\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$date = apply_filters( 'automatewoo/workflow/queue_date', $date, $this );\n\n\t\tif ( ! $date ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$queue->set_date_due( $date );\n\t\t$queue->save();\n\n\t\t$queue->store_data_layer( $this->data_layer() ); // add meta data after saved\n\n\t\treturn $queue;\n\t}", "public function QueueAdd($queue, $interface, $penalty);", "public function create(Message $message): void\n {\n $this->items[$message->getEventName()][$message->getId()] = $message;\n }", "public function testOne()\n {\n $this->queue->add('first item');\n\n $this->assertEquals('first item', $this->queue->next());\n $this->assertNull($this->queue->next());\n }", "public function add() {\n $this->out('CakePHP Queue Example task.');\n $this->hr();\n $this->out('This is a very simple example of a QueueTask.');\n $this->out('I will now add an example Job into the Queue.');\n $this->out('This job will only produce some console output on the worker that it runs on.');\n $this->out(' ');\n $this->out('To run a Worker use:');\n $this->out('\tbin/cake queue runworker');\n $this->out(' ');\n $this->out('You can find the sourcecode of this task in: ');\n $this->out(__FILE__);\n $this->out(' ');\n\n //$options = getopt('',['id:']);\n /*\n * Adding a task of type 'example' with no additionally passed data\n */\n //if ($this->QueuedJobs->createJob('RemittanceApi', ['id'=>4033, 'batch_id'=>'58e44de0f33a7'])) {\n if ($this->QueuedJobs->createJob('RemittanceApi', null)) {\n $this->out('OK, job created, now run the worker');\n } else {\n $this->err('Could not create Job');\n }\n }", "abstract public function add_item();", "function _addItem ($quantity, $rate, $weight, $length, $width, $height, $description, $readytoship=0) {\r\n $index = $this->items_qty;\r\n $this->item_quantity[$index] = (string)$quantity;\r\n $this->item_weight[$index] = ( $weight ? (string)$weight : '0' );\r\n $this->item_length[$index] = ( $length ? (string)$length : '0' );\r\n $this->item_width[$index] = ( $width ? (string)$width : '0' );\r\n $this->item_height[$index] = ( $height ? (string)$height : '0' );\r\n $this->item_description[$index] = $description;\r\n $this->item_readytoship[$index] = $readytoship;\r\n $this->items_qty ++;\r\n $this->items_price += $quantity * $rate;\r\n }", "public function addQueue(QueueInterface $queue);", "public function testGetQueueUrlQueueCreated()\n {\n $queueUrl = 'my-invoice-queue-message-url';\n $results = [\n new Result(['QueueUrl' => $queueUrl])\n ];\n $sqsQueue = $this->getSqsQueueInstance($results);\n $this->assertEquals($queueUrl, $sqsQueue->getQueueUrl());\n $this->assertEquals(0, $this->getAwsMockHandlerStackCount());\n }", "public function push($item)\n {\n if ($this->getCount() == static::MAX_ITEMS) {\n\n throw new QueueException(\"Queue is full\");\n \n }\n \n $this->items[] = $item;\n }", "public function __construct($queue);", "public function addItemQueue($object, $id_object, $id_shop, $action)\n {\n Db::getInstance()->insert(\n 'doofinder_updates',\n [\n 'id_shop' => $id_shop,\n 'object' => $object,\n 'id_object' => $id_object,\n 'action' => $action,\n 'date_upd' => date('Y-m-d H:i:s'),\n ],\n false,\n true,\n Db::REPLACE\n );\n }", "public function actionSingle() {\n// $conn = $amqp->Connection();\n// $channel = $amqp->Channel($conn);\n// $amqp->Exchange($conn, $channel);\n// $amqp->Queue($channel);\n }", "public function testQueue() {\n $node = $this->node;\n $message = Message::create([\n 'template' => 'foo',\n ]);\n\n $subscribe_options = [];\n $subscribe_options['save message'] = FALSE;\n\n try {\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n $this->fail('Can add a non-saved message to the queue.');\n }\n catch (MessageSubscribeException $e) {\n $this->assertTrue(TRUE, 'Cannot add a non-saved message to the queue.');\n }\n\n // Assert message was saved and added to queue.\n $uids = array_fill(1, 10, new DeliveryCandidate([], [], 1));\n foreach ($uids as $uid => $candidate) {\n $candidate->setAccountId($uid);\n }\n $subscribe_options = [\n 'uids' => $uids,\n 'skip context' => TRUE,\n 'range' => 3,\n ];\n $queue = \\Drupal::queue('message_subscribe');\n $this->assertEquals($queue->numberOfItems(), 0, 'Queue is empty');\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n $this->assertTrue((bool) $message->id(), 'Message was saved');\n $this->assertEquals($queue->numberOfItems(), 1, 'Message added to queue.');\n\n // Assert queue-item is processed and updated. We mock subscription\n // of users to the message. It will not be sent, as the default\n // notifier is disabled.\n $item = $queue->claimItem();\n $item_id = $item->item_id;\n\n // Add the queue information, and the user IDs to process.\n $subscribe_options['queue'] = [\n 'uids' => $uids,\n 'item' => $item,\n 'end time' => FALSE,\n ];\n\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n\n // Reclaim the new item, and assert the \"last UID\" was updated.\n $item = $queue->claimItem();\n $this->assertNotEquals($item_id, $item->item_id, 'Queue item was updated.');\n $this->assertEquals($item->data['subscribe_options']['last uid'], 3, 'Last processed user ID was updated.');\n }", "Public Function CreatejobId()\n {\n \t$DatabaseObj = Zend_Registry::get('Instance/DatabaseObj');\n \t\n\t\t\t$Salt = \"abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ1234567890_\";\n\t\t\tsrand((double)microtime()*1000000);\n\t\t\t$ConfirmationKey = \"\";\n\t\t\tfor ($i=0;$i<8;$i++)\n\t\t\t{\n\t\t\t\t$ConfirmationKey = $ConfirmationKey . substr ($Salt, rand() % strlen($Salt), 1);\n\t\t\t}\n\t\t\t\n\t\t\t$InsertArray = array(\n \t\t\t'jobId' => $ConfirmationKey,\n \t\t);\n \t\t\n \t\t$Sql = \"SELECT id FROM bevomedia_queue WHERE jobId = '$ConfirmationKey'\";\n \t\t$Rows = $DatabaseObj->fetchAll($Sql);\n \t\tif(sizeof($Rows) > 0)\n \t\t{\n \t\t\t$ConfirmationKey = $this->CreatejobId();\n \t\t\treturn $ConfirmationKey;\n \t\t}\n \t\t\n \t\t$DatabaseObj->insert('bevomedia_queue', $InsertArray);\n \t\t\n \t\t$this->jobId = $ConfirmationKey;\n \t\t\n\t\t\treturn $ConfirmationKey;\n \t\n }", "function queue_enqueue(&$queue, $value) { \n // We are just adding a value to the end of the array, so can use the \n // [] PHP Shortcut for this. It's faster than using array_push \n $queue[] = $value; \n}", "public function testReserveQueueJob()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n\n $this->queue->enqueue($queueJobTest1);\n $result = $this->queue->reserve();\n\n $this->assertInstanceOf(Job::class, $result);\n $this->assertTrue($result->isReserved(Queue::EXPIRATION_TIME));\n $this->assertCount(1, $this->queueStorage->queue);\n }", "public function createItem(string $key): CacheItemInterface;", "public function testGetQueueUrlViaQueueCreation()\n {\n $queueUrl = 'my-invoice-queue-message-url';\n\n $sqsClient = $this->getMockedAwsSdk()->createSqs(['version' => '2012-11-05']);\n $cmd = $sqsClient->getCommand('GetQueueUrl', [\n 'QueueName' => 'my-queue-name'\n ]);\n\n $results = [\n # Exception for inital GetQueueUrl command\n new SqsException('No Attribute MD5 found', $cmd, ['code' => 'AWS.SimpleQueueService.NonExistentQueue']),\n # Result for CreateQueue command for creation of dead letter queue\n new Result(['QueueUrl' => 'my-deadletter-queue-url']),\n # Result for GetQueueAttributes command (to fetch ARN of dead letter queue)\n new Result(['Attributes' => ['QueueArn' => 'arn:deadletter-queue']]),\n # Result for creation of invoice message queue\n new Result(['QueueUrl' => $queueUrl])\n ];\n\n $sqsQueue = $this->getSqsQueueInstance($results);\n $this->assertEquals($queueUrl, $sqsQueue->getQueueUrl());\n $this->assertEquals(0, $this->getAwsMockHandlerStackCount());\n }", "public function createQueue(Queue $queue, QueueBind ...$binds): Promise\n {\n return $this->transport->createQueue($queue, ...$binds);\n }", "function createItem($item) {\n\t\tglobal $dbh;\n\t\t$stmt = $dbh->prepare('INSERT INTO ITEM VALUES (NULL, ?, ?, ?, ?)');\n\t\t$success = $stmt->execute(array($item['content'],\n\t\t\t\t\t\t\t\t\t\t$item['image'],\n\t\t\t\t\t\t\t\t\t\t$item['checked'],\n\t\t\t\t\t\t\t\t\t\t$item['listID']));\n\t\treturn $success;\n\t}", "public function push($item): void;", "public function createNewItem() {\n\t\treturn new FeedItem($this->type);\n\t}", "function createOrderItem($orderID, $capID, $qty)\n {\n return $this->data->insertOrderItem($orderID, $capID, $qty);\n }", "public function getNextQueueItem() {\n $select = db_select($this->og_controller->queue_table, 'queue');\n $select->condition('queue.processed', 0);\n $select->fields('queue', array('entity_type', 'entity_id'));\n $select->range(0, 1);\n\n if ($item = $select->execute()->fetchObject()) {\n return new Dumper_Data_QueueItem($this->og_controller->og_node->nid, $item->entity_type, $item->entity_id);\n }\n\n return FALSE;\n }", "public function getQueue();", "public function getQueue();", "function appendNetflixQueue($queueId){\t\t\n\t\t$userId = $this->getUserId();\n\n\t\tif (!$userId) {\n\t\t\t$this->Session->setFlash(__('You must log in.', true));\n\t\t\t$this->redirect(array('controller' => 'queues', 'action' => 'login'));\n\t\t}\n\n\t\t$queue = $this->Queue->find('first', \n\t\t\tarray('conditions' => \n\t\t\t\t\"Queue.id = $queueId AND (Queue.account_number = '$userId' OR Queue.privacy = 'public')\"\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->log(\"Appending queue with id $queueId and owner {$queue['Queue']['account_number']} to netflix queue for user $userId\", LOG_DEBUG);\n\t\t\n\t\t$this->Queue->id = $queueId;\n\t\t$this->Queue->read(null, $queueId);\n\t\t$etag = $this->Queue->field('etag');\n\n\t\tif(!$queue){\n\t\t\t$this->flash(\"The queue does not exist or does not belong to the user.\");\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\texit;\n\t\t}\n\n\t\t$queueMovies = $this->Queue->QueueMovie->find('all', \n\t\t\tarray('conditions' => \"queue_id = $queueId\", \n\t\t\t\t 'order' => 'QueueMovie.position ASC'));\n\t\t$this->set('queueMovies', $queueMovies);\n\n\t\t$netflix = $this->NetflixAccount->getNetflixAPIConsumerForAccountNumber($userId);\n\n\t\t$errors = array();\n\t\t\n\t\tforeach($queueMovies as $movieToAdd){\n\t\t\t$titleURL = $movieToAdd['QueueMovie']['netflix_key'];\n\t\t\t$position = $movieToAdd['QueueMovie']['position'];\n\t\t\t$title = $movieToAdd['QueueMovie']['title'];\n\t\t\t\n\t\t\t$this->log(\"Adding $title at position $position for $userId\", LOG_DEBUG);\n\t\t\t\n\t\t\tif($position == 0){\n\t\t\t\t//Handle movies in the 'saved' queue. They have position 0.\n\t\t\t\t$position = count($queueMovies);\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\t$etag = $netflix->addTitle($titleURL, $position);\n\t\t\t\t$this->Queue->saveField('etag', $etag);\n\t\t\t}\n\t\t\tcatch(Exception $e){\n\t\t\t\t$errors[] = $e->getMessage();\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$this->set('errors', $errors);\n\t}", "function getQueue($id);", "public function addQueue($strName, $iOpen = 0, $bText = false)\n {\n if($bText && !$this->isAllowed('moderator')) return $this->returnText(self::ERR_NO_MOD);\n if(trim($strName) == \"\") return $this->returnText('No queue name specified to add');\n\n $oQueue = Queue::where([\n ['channel_id', '=', $this->c->id],\n ['name', '=', $strName]\n ])->first();\n\n if(!$oQueue)\n {\n $oQueue = Queue::create([\n 'channel_id' => $this->c->id,\n 'name' => $strName,\n 'is_open' => ($iOpen == 0 ? 0 : 1)\n ]);\n }\n elseif($bText) return $this->returnText('Queue \"'. $strName .'\" already exists');\n\n if($bText === false)\n {\n if($oQueue) return $oQueue;\n return false;\n }\n elseif($oQueue)\n {\n return $this->returnText('Successfully added queue \"'. $strName .'\"');\n }\n }", "public function declareSimpleQueue($queueName = '', $type = self::QUEUE_DURABLE);", "public function createNewItem()\n {\n $Item = new FeedItem($this->version);\n return $Item;\n }", "private function addPlaylistItem()\n {\n try\n {\n $request = $_POST;\n\n if( !isset($request['pid']) || $request['pid']==\"\" )\n throw_error_msg(\"playlist id not provided\");\n else if(!is_numeric($request['pid']))\n throw_error_msg(\"invalid playlist id\"); \n else\n $pid = (int)$request['pid'];\n\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"videoid not provided\");\n else if(!is_numeric($request['videoid']))\n throw_error_msg(\"invalid videoid\"); \n else\n $id = (int)$request['videoid']; \n \n global $cbvid; \n $item_id = $cbvid->action->add_playlist_item($pid, $id);\n\n if( error() )\n {\n $error = error();\n throw_error_msg($error[0]); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'item has been added to playlist successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function testReservingReservedQueueJob()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n $queueJobTest2 = new TestQueueJob('product', 'ShopwareProductExport');\n\n $this->queue->enqueue($queueJobTest1);\n $this->queue->enqueue($queueJobTest2);\n $this->queue->reserve();\n $result = $this->queue->reserve();\n\n $this->assertNull($result);\n $this->assertCount(2, $this->queueStorage->queue);\n }", "function addqueueAction() {\n\n // Translate Object ..\n $translate = Zend_Registry::get('Zend_Translate');\n $em = Zend_Registry::get('em');\n\n $queueForm = $this->getQueueForm();\n $conn = $this->dbConnection();\n\n // fetch First 10 tests from DB..\n $res1 = $em->createQueryBuilder()->select('t.TestId,t.TST_Name')->from('Testcreator_Model_Tests', 't')->setMaxResults(10)->getQuery();\n $testResArr = $res1->getResult();\n\n $testArr = array();\n $testArr[0] = 'Select All';\n $testIdStr = '';\n\n foreach($testResArr as $val) {\n $testArr[$val['TestId']] = $val['TST_Name'];\n $testIdStr .= $val['TestId'] . \", \";\n }\n\n $user = new TUsers();\n $importTargets = new TImporttargets();\n\n $this->view->QueueForm = $queueForm;\n\n $logger = Zend_Registry::get('Zend_Log');\n\n $clientObj = $em->getRepository('TClient')->findAll();\n\n $this->view->clientObj =$clientObj;\n\n if ($this->getRequest()->getMethod() == 'POST') {\n $request = $this->getRequest();\n if (!$queueForm->isValid($request->getPost())) {\n\n // Invalid entries\n $this->view->QueueForm = $queueForm;\n return $this->render('addqueue'); // re-render webservice form\n } else {\n $result=$this->saveQueue($request->getPost());\n\n if($result) {\n $this->_redirect('testitemanalysis/index/addqueue');\n } else {\n\n }\n }\n }\n }", "abstract public function push($job, $queue = null);", "public function createQueue(string $name): void\r\n {\r\n $this->queue = $name;\r\n if ($this->connect) {\r\n $this->channel = $this->connect->channel();\r\n $this->channel->queue_declare($this->queue, false, true, false, false);\r\n } else {\r\n throw new \\Exception('Not found RabbitMQ connection');\r\n }\r\n }", "public function pushOn($queue, $job, $data = '');", "public function testAddToQueueNoEmailAddress()\n {\n $Email = new \\EmailTemplate('test');\n \n // Add the message to queue\n $r1 = $Email->queue([], '');\n $r2 = $Email->queue([], 'abc');\n \n // assert false was returned, which means error\n $this->assertFalse($r1);\n $this->assertFalse($r2);\n }", "public static function enqueue();", "public static function push()\n {\n return <<<'LUA'\n-- Push the job onto the queue...\nredis.call('zadd', KEYS[1], 'NX', ARGV[1], ARGV[2])\n-- Push a notification onto the \"notify\" queue...\nredis.call('rpush', KEYS[2], 1)\nLUA;\n }", "abstract public function createItem($name, $type, $description = '', $bizRule = null, $data = null);", "public function createQueue($filterArray, $operations, $offset, $limit, $queueId);", "public function create()\n {\n $form = [\n \"name\" => [\n \"label\" => \"Name\",\n \"type\" => \"text\",\n \"value\" => old(\"name\"),\n \"required\" => true\n\n ],\n \"slug\" => [\n \"label\" => \"Code\",\n \"type\" => \"text\",\n \"value\" => old(\"slug\"),\n \"required\" => true\n ],\n \n \"icon\" => [\n \"label\" => \"Icon\",\n \"type\" => \"file\",\n \"attr\" => [\n \"accept\" => \"image/*\"\n ]\n ],\n \"status\" => [\n \"label\" => \"Status\",\n \"type\" => \"radio\",\n \"value\" => old(\"status\"),\n \"options\" => [[\"id\" => 1 ,\"name\" => \"Active\"],[\"id\" => 0 ,\"name\" => \"Deactive\"]],\n \"options_value\" => \"id\",\n \"options_label\" => \"name\",\n \"required\" => true,\n \"value\" => 1\n ]\n ];\n $this->_DATA[\"_ROUTE\"] = route($this->_ROUTE_FIX.\".\".$this->_ROUTE.\".store\");\n $this->_DATA[\"_PAGETILE\"] = $this->_DATA[\"_PAGETILE\"]; \n return $this->_CreateItem($form);\n }", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "public function getQueue(): Queue;", "function add($item);", "public function getNewItem():Item {\r\n\t\t$item = new Item($this);\r\n\t\t$this->items[] = $item;\r\n\t\treturn $item;\r\n\t}", "public function queue($name = null);", "public static function queue($queue, $key, $data = array()) {\n static::$queued[$queue][$key] = $data;\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function action_create_item($id = NULL)\n {\n if ($id === NULL)\n {\n $id = $this->request->param('id');\n }\n\n $this->action_edit_item(FALSE, $id);\n }", "abstract protected function createItem(string $name): Item;", "private function addToQueue(ItemInterface $item, float $distance)\n {\n if ($distance >= $this->maxQueuedDistance) {\n return;\n }\n\n $this->queue->insert($item, $distance);\n $this->queue->extract();\n\n $this->maxQueuedDistance = $this->queue->current();\n }", "public function createNewItem()\n {\n return new Phone(\n new TouchKeyboardB(),\n new TouchDisplayB(),\n 'Slyva',\n 'S2'\n );\n }", "protected function create_item( $name ) {\n\t\t// Check whether the item name is still available\n\t\tif ( ThumbsUp_Database::item_name_exists( $name ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Initialize the item fields\n\t\t$this->item = array(\n\t\t\t'name' => (string) $name,\n\t\t\t'closed' => 0,\n\t\t\t'date' => time(),\n\t\t);\n\n\t\t// Insert the item into the database\n\t\t/*sqlite_escape_string repalce with mysqli_escape_string PHP7 Compatibility*/\n\t\tThumbsUp_Database::db()->queryExec(\"\n\t\t\tINSERT INTO items (id, name, closed, date)\n\t\t\tVALUES (NULL, '\" . mysqli_escape_string( $this->item['name'] ) . \"', {$this->item['closed']}, {$this->item['date']})\");\n\n\t\t// Load the item id\n\t\t$this->item['id'] = ThumbsUp_Database::db()->lastInsertRowid();\n\n\t\t// All done successfully\n\t\treturn true;\n\t}", "public function addQueue($name, $max_items) {\n if($this->count() >= $this->max_queues) {\n throw new \\Exception(\"can't create more queues\");\n }\n\n if($this->existsQueue($name)) {\n return false;\n } else {\n $this->queues[$name] = $this->createQueue($max_items);\n return true;\n }\n }", "public function enqueue() {\n\t}", "public function createNewItem()\n {\n return new Phone(\n new TouchKeyboardA(),\n new TouchDisplayA(),\n 'Abrykos',\n 'A2'\n );\n }", "private function setQueue() {\n if (count($this->request->q) > 0) {\n try {\n $this->client->setQueue(array($this->request->q));\n $this->view->addParameter(\"result\", \"success\");\n } catch(Exception $e) {\n $this->view->addParameter(\"result\", \"failure\");\n $this->view->addParameter(\"data\", \"Failed to execute '{$this->request->action}' action\");\n }\n } else {\n $this->view->addParameter(\"result\", \"invalid\");\n $this->view->addParameter(\"data\", \"Query array must not be empty\");\n }\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "function create_mailbox($db_array,$form_array,$path) {\n\techo \"<div align='center'>\";\n\tif (preg_match(\"/^([a-z0-9]{1}[a-z0-9\\.+_-]{1,18}[a-z0-9]{1})$/i\",$form_array[\"Boxname\"])) {\n\t\t$dbhandler=\"\";\n\t\topen_db($dbhandler,$db_array);\n\t\t$boxname = $form_array[\"Boxname\"];\n\t\t$creationdate = time();\n\t\t$query = $dbhandler->query(\"SELECT * FROM `mailboxlist` WHERE boxname='\".$boxname.\"'\");\t\n\t\tif (mysqli_num_rows($query)==0){\n\t\t\tmysqli_query($dbhandler,\"INSERT INTO `mailboxlist`(`boxname`, `destination`, `duration`, `comment`) VALUES ('\".$form_array['Boxname'].\"','\".$form_array['Destination'].\"','\".$_POST['ttl'].\"','\".$form_array['Comment'].\"')\");\n\t\t\t$boxname = str_replace(\".\",\":\",$boxname); # replace all dots with colons for qmail handling\n\t\t\techo $GLOBALS[\"text_create_file\"].\": \".$path.\".qmail-\".$boxname.\"<br />\";\n\t\t\t$filehandler = fopen($path.\".qmail-\".$boxname, \"w+\");\n\t\t\t# Create a new Mailbox-File\n\t\t\tfwrite($filehandler, $form_array['Destination']); # Writes the destination-address into the file\n\t\t\techo $GLOBALS[\"text_box_created\"];\n\t\t}\n\t\telse { echo $GLOBALS[\"text_box_exists\"]; }\n\t\tmysqli_close ($dbhandler);\n\t}\n\telse { echo $GLOBALS[\"text_invalid_boxname\"].\": \".$form_array[\"Boxname\"];}\n\techo \"</div>\";\n}", "public function create(array $data): ChainableItemInterface;", "public function push($item)\n {\n $this->items[] = $item;\n }", "public function create_item( \\WP_REST_Request $request ) {\n\t\treturn $this->not_yet_response();\n\t}", "function queueAssignment($name, $email, $phone) {\n\t$detailsArray = array('name' => $name, 'email' => $email, 'phone' => $phone);\n\t$detailsStr = json_encode($detailsArray);\n\twriteFile($detailsArray);\n\t// client code\n\t$client = new GearmanClient();\n\t$client->addServer();\n\t$store = $client->do(\"saveRecord\", $detailsStr);\n}", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "public function add($item);", "public function add($item);", "public function create()\n\t{\n\t\t\n\t\t//\n\t}" ]
[ "0.7421647", "0.7300555", "0.66321045", "0.6618975", "0.65730304", "0.6437945", "0.62842745", "0.6157412", "0.61535954", "0.61033607", "0.6039688", "0.6012637", "0.59975713", "0.5996191", "0.59805894", "0.5965695", "0.59634495", "0.59377694", "0.59298176", "0.5913992", "0.59132123", "0.5878403", "0.5856615", "0.5852648", "0.58442056", "0.58006084", "0.57993084", "0.5741953", "0.57346827", "0.5717593", "0.5714653", "0.56972706", "0.5689888", "0.56890863", "0.5687286", "0.5681368", "0.5669614", "0.5653652", "0.56478983", "0.56282693", "0.56156933", "0.5612893", "0.5565621", "0.55651397", "0.556434", "0.5563295", "0.5562274", "0.55577266", "0.5555735", "0.5549073", "0.55351096", "0.55351096", "0.5532212", "0.5508333", "0.55050457", "0.55042344", "0.550213", "0.5492087", "0.5488575", "0.5470866", "0.5467517", "0.5456422", "0.54553384", "0.54444206", "0.54322296", "0.5426068", "0.54099596", "0.5405315", "0.53941107", "0.5382325", "0.53758", "0.5375445", "0.5365389", "0.5358738", "0.5344535", "0.53433543", "0.53433543", "0.53433543", "0.53433543", "0.53433543", "0.53433543", "0.53414035", "0.53408194", "0.5331976", "0.53180027", "0.5313637", "0.5310772", "0.5306186", "0.5295513", "0.52946967", "0.52865005", "0.5281605", "0.52774465", "0.52736604", "0.52701473", "0.5268106", "0.5265684", "0.5265684", "0.5262958", "0.5262958", "0.5253369" ]
0.0
-1
/ DB CRUD / Add an employee to the table.
function addWebPage($connection, $title, $url) { $t = mysqli_real_escape_string($connection, $title); $u = mysqli_real_escape_string($connection, $url); $query = "INSERT INTO `".TABLE_NAME."` (`title`, `url`) VALUES ('$t', '$u');"; if(!mysqli_query($connection, $query)) echo("<p>Error adding data.</p>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_employee()\n\t{\n\t\t\n\t\n\t\t//this is calling the view page employee_details to insert the employee's details\n\t\t$this->load->view('employee_details');\n\t}", "public function addEmployee()\n {\n // if we have POST data to create a new employee entry\n if (isset($_POST[\"submit_add_employee\"])) {\n // do addEmployee() in model/model.php\n $this->model->addEmployee($_POST[\"firstname\"], $_POST[\"surname\"], $_POST[\"category\"], $_POST[\"email\"], $_POST[\"phone\"], $_POST[\"started\"]);\n }\n\n // where to go after employee has been added\n header('location: ' . URL . 'employees/index');\n }", "public function storeNewEmployee()\n {\n $values = DatabaseHelpers::dbAddAudit(request()->all());\n $values['gender'] = Person::getGender($values['gender']);\n $values['title'] = Person::getTitle($values['title']);\n $person = Person::create($values);\n\n $employee_values['person_id'] = $person->id;\n $employee_values['employee_status_id'] = $values['employee_status_id'];\n $employee_values['employee_classification_id'] = $values['employee_classification_id'];\n $employee_values['start_date'] = $values['start_date'];\n $employee_values['end_date'] = $values['end_date'];\n\n $values = DatabaseHelpers::dbAddAudit($employee_values);\n $employee = Employee::create($values);\n\n ViewHelpers::flash($employee, 'employee');\n\n if ($employee) {\n $employee->searchable();\n\n return redirect()->to('employee/'.$employee->uuid.'/profile');\n }\n\n return redirect()->back()->withInput();\n }", "public function save()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$recordEmp = new Employee();\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tdie(\"Error: {$e->getMessage()}\");\n\t\t\t}\n\n\t\t\t$recordEmp->idEmployee = (int)htmlentities(addslashes($_POST['id']));\n\t\t\t$recordEmp->Name = htmlentities(addslashes($_POST['Name']));\n\t\t\t$recordEmp->Edad = htmlentities(addslashes($_POST['Edad']));\n\t\t\t$recordEmp->idArea = htmlentities(addslashes($_POST['idArea']));\n\n\t\t\t// if it has some phone record to add else it assigns a new empty array \n\t\t\t$recordEmp->telefonos = isset($_POST['Telefonos']) ? $_POST['Telefonos'] : array();\n\n\t\t\tif($recordEmp->uoriEmployee())\n\t\t\t{\n\t\t\t\theader('location: index.php');\n\t\t\t}\n\t\t}", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $employee = new Employee();\n $employee->id = $this->request->getPost(\"id\");\n $employee->name = $this->request->getPost(\"name\");\n $employee->surename = $this->request->getPost(\"surename\");\n $employee->patronymic = $this->request->getPost(\"patronymic\");\n $employee->position = $this->request->getPost(\"position\");\n $employee->departmentId = $this->request->getPost(\"department_id\");\n \n\n if (!$employee->save()) {\n foreach ($employee->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"employee was created successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n }", "public function createEmployee()\n {\n $this->view('employees/create');\n }", "public function add_employee(){\n\n //If not allowed to add redirect;\n if (!isAllowedWriteModule()){\n redirect(base_url(\"employees\"));\n }\n\n $this->load->helper('form');\n\n $this->subViewFolder = \"add\";\n $viewData = array(\n \"viewFolder\" => $this->viewFolder,\n \"subViewFolder\" => $this->subViewFolder,\n \"title\" => \"Add New Employee\"\n );\n $this->load->view(\"{$this->viewFolder}/{$this->subViewFolder}/index\", $viewData);\n }", "public function createEmployeeSave()\n {\n $data = array();\n $data['name'] = $_POST['name'];\n $data['address'] = $_POST['address'];\n $this->model('Employee')->createEmployee($data);\n header(\"Location: \" . URL . \"public/employees/index\");\n }", "public function actionCreate(){\n $model = new Employee();\n $model->load(Yii::$app->request->post());\n $model->save();\n return $this->renderAjax('_employee_row', compact('model'));\n }", "public function actionCreate() {\n $model = new Employee();\n \n $data = $this->data;\n\n if (!empty($data)) {\n $model->employee_code = $data['employee_code'];\n $model->employee_name = $data['employee_name'];\n $model->employee_email = $data['employee_email'];\n $model->status = $data['status'];\n $model->department_id = $data['department_id'];\n }\n\n $errors = $this->EmpDetailsvalidate($data['address']);\n if ($model->validate() && empty($errors)) {\n $model->save();\n\n $this->InsertUpdateEmpAddress($model->id, $data['address']);\n echo $this->messageReturn(\"success\", 200);\n } else {\n $error = $model->getErrors();\n //print_r($errors);\n array_push($error, $errors);\n echo $this->messageReturn(\"error\", 404, \"\", $error);\n }\n exit;\n }", "public function actionCreate()\n {\n $model = new Employe();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', \"Employee created successfully.\");\n } else {\n Yii::$app->session->setFlash('error', \"Employee not saved.\");\n }\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createEmployee(){\n $sqlQuery = \"INSERT INTO \".$this->t_name.\"\n SET\n name= :name,\n email= :email,\n age= :age,\n designation= :designation,\n created= :created\";\n //persiapkan sqlnya dan masukkan ke dalam variabel stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //senitaze\n $this->name=htmlspecialchars(strip_tags($this->name));\n $this->email=htmlspecialchars(strip_tags($this->email));\n $this->age=htmlspecialchars(strip_tags($this->age));\n $this->designation=htmlspecialchars(strip_tags($this->designation));\n $this->created=htmlspecialchars(strip_tags($this->created));\n\n //bind\n $stmt->bindParam(\":name\",$this->name);\n $stmt->bindParam(\":email\",$this->email);\n $stmt->bindParam(\":age\",$this->age);\n $stmt->bindParam(\":designation\",$this->designation);\n $stmt->bindParam(\":created\",$this->created);\n\n //eksekusi \n if ($stmt->execute()){\n return true;\n }\n return false;\n \n }", "public function postAddToEmployee()\n { \n $rules = array(\n 'name' => 'required',\n 'level' => 'required'\n );\n\n $validator = Validator::make(Input::all(), $rules);\n \n if ($validator->fails())\n {\n Session::put('error_messages', $validator->messages());\n Session::put('input_values', Input::all());\n Session::flash('add_skill_failed', 1);\n }\n else\n {\n $values = Input::all();\n \n $skill = new Skill;\n foreach ($values as $key => $value)\n {\n $skill->{$key} = $value;\n }\n $skill->save();\n \n Session::flash('add_skill_success', 1);\n }\n return Redirect::to('admin/employee/qualification/'.Input::get('employee_id'));\n }", "public function store(EmployeeRequest $request)\n {\n //First we need to create a new address column\n //We will need the id of the newly created address to be \n //Inserted into the employees table\n $address = new Address();\n $address->city = $request->input('employeeCity');\n $address->street = $request->input('employeeStreet');\n $address->post_code = $request->input('employeePostcode');\n $address->save();\n\n //Get the id of the newly created address\n $address_id = Address::select('id')->max('id');\n \n //New employee object from the model\n //This will represent the employees table from the database\n //And we will fill in the new employee column with values from inputs\n $emp = new Employee();\n $emp->address_id = $address_id;\n $emp->name = $request->input('employeeName');\n $emp->surname = $request->input('employeeSurname');\n $emp->email = $request->input('employeeEmail');\n $emp->password = Hash::make($request->input('employeePassword'));\n $emp->type = $request->input('types');\n $emp->salary = $request->input('employeeSalary');\n $emp->start_date = Carbon::now()->toDateTimeString();\n $emp->save();\n\n return redirect(\"/employee/create\")->with(\"success\", 'Employee added successfuly');\n \n }", "public function AutomaticCreateBasedAdmin(){\n $resp = employees::find(1);\n if(!$resp){\n employees::create([\n 'emp_name'=>'admin',\n 'emp_password'=>'test',\n 'emp_address'=>'abc',\n 'emp_phone'=>'0000000000',\n 'emp_dob'=> new DateTime(),\n 'pos_id'=>1,\n ]);\n }else{\n $resp->pos_id = 1;\n $resp->save();\n }\n }", "function addedEmployee(Request $req){\n DB::table('emp_proj')\n ->insert(\n [\n 'emp_id'=>$req->emp_id,\n 'proj_id'=>$req->proj_id,\n 'proj_manager'=>$req->proj_manager\n ]\n );\n return redirect('manager/'.$req->id);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $employee = Employee::findFirstByid($id);\n\n if (!$employee) {\n $this->flash->error(\"employee does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $employee->id = $this->request->getPost(\"id\");\n $employee->name = $this->request->getPost(\"name\");\n $employee->surename = $this->request->getPost(\"surename\");\n $employee->patronymic = $this->request->getPost(\"patronymic\");\n $employee->position = $this->request->getPost(\"position\");\n $employee->departmentId = $this->request->getPost(\"department_id\");\n \n\n if (!$employee->save()) {\n\n foreach ($employee->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'edit',\n 'params' => [$employee->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"employee was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n }", "public function store(EmployeeRequest $request)\n {\n // $lastIDEmployee = Employee::select('id_employee')->orderBy('id_employee', 'desc')->first();\n // $lastIDEmployee = (int)substr($lastIDEmployee, 3);\n // Debugbar::debug($lastIDEmployee);\n $lastIDEmployee = IdGenerator::generate(['table' => 'employees', 'field' => 'id_employee', 'length' => 7, 'prefix' =>'IP06']);\n\n $name = $request->name;\n $email = $request->email;\n $address = $request->address;\n $birth_date = $request->birth_date;\n $join_date = $request->join_date;\n\n $data = array(\n 'id_employee' => $lastIDEmployee,\n 'name' => $name,\n 'address' => $address,\n 'birth_date' => $birth_date,\n 'join_date' => $join_date\n );\n\n $data_user = array(\n 'name' => $name,\n 'email' => $email,\n 'password' => Hash::make('12345678'), //set default password\n 'roles' => 'employee',\n 'username' => $lastIDEmployee\n );\n\n Employee::create($data);\n User::create($data_user);\n return redirect()->route('employee.index');\n }", "private function addEmployee()\n\t{\n\t\tif (false === $this->flag)\n\t\t{\n\t\t\tif (isset($this->dataArray))\n\t\t\t{\n\t\t\t\tif ('' === $this->dataArray['pass_employee'])\n\t\t\t\t{\n\t\t\t\t\t$this->error['ERROR_PASS'] = ERROR_EMPTY;\n\t\t\t\t\t$pass = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (false === $this->validatorObj\n\t\t\t\t\t\t\t->checkPass($this->dataArray['pass_employee']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_PASS'] = ERROR_WRONG_DATA;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$pass = $this->dataArray['pass_employee'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ('' === $this->dataArray['name_employee'])\n\t\t\t\t{\n\t\t\t\t\t$this->error['ERROR_NAME'] = ERROR_EMPTY;\n\t\t\t\t\t$name = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (false === $this->validatorObj\n\t\t\t\t\t\t\t->checkForm($this->dataArray['name_employee']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_NAME'] = ERROR_WRONG_DATA;\n\t\t\t\t\t\t$name = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$name = $this->dataArray['name_employee'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ('' === $this->dataArray['email_employee'])\n\t\t\t\t{\n\t\t\t\t\t$this->error['ERROR_EMAIL'] = ERROR_EMPTY;\n\t\t\t\t\t$email = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (false === $this->validatorObj\n\t\t\t\t\t\t\t->checkEmail($this->dataArray['email_employee']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_EMAIL'] = ERROR_WRONG_DATA;\n\t\t\t\t\t\t$email = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$email = $this->dataArray['email_employee'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (false !== $name && false !== $pass && false !== $email)\n\t\t\t\t{\n\t\t\t\t\t$arr = $this->queryToDbObj\n\t\t\t\t\t\t->getEmployeeForCheckExists($email);\n\t\t\t\t\tif (!empty($arr))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error['ERROR_STATUS'] = ERROR_EXISTS;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$key_employee = $this->encodeObj->generateCode($name);\n\t\t\t\t\t\t$pass = md5($key_employee . $pass . SALT);\n\t\t\t\t\t\t$arr = $this->queryToDbObj\n\t\t\t\t\t\t\t->setNewEmployee($name, $pass, $email,\n\t\t\t\t\t\t\t\t$key_employee);\n\t\t\t\t\t\tif ($arr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$success['ADD'] = 'User add';\n\n\t\t\t\t\t\t\treturn $success;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->error))\n\t\t{\n\t\t\treturn $this->error;\n\t\t}\n\t\treturn true;\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'first_name' => 'required',\n 'last_name' => 'required',\n ]);\n\n $add = new Employees;\n $add->id = Uuid::uuid4()->getHex();\n $add->first_name = $request->first_name;\n $add->last_name = $request->last_name;\n $add->company = $request->company;\n $add->email = $request->email;\n $add->phone = $request->phone;\n $add->save();\n\n return redirect('employees')->with('status','Employee has been added');\n }", "public function store(CreateEmployeeRequest $request)\n {\n $this->employeeModel->addNewEmployee($request);\n return redirect()->route('employees.index')->with('success', 'Thêm nhân viên thành công');\n }", "public function successfullyRecordedNewEmployee()\n {\n $payload = [];\n\n $this->post('/', $payload);\n\n $this->assertDatabaseHas('users', $payload);\n }", "public function createEmployee($request){\n\n $form_data = $this->createEmployeeArray($request);\n Employee::create($form_data);\n\n }", "public function addAction(){\n\t\t\t$emp = new Empresa();\n\t\t\t//cargamos el objeto mediantes los metodos setters\n\t\t\t$emp->id = '0';\n\t\t\t$emp->nombre_empresa = $this->getPostParam(\"nombre_empresa\");\n\t\t\t$emp->nit = $this->getPostParam(\"nit\");\n\t\t\t$emp->direccion = $this->getPostParam(\"direccion\");\n\t\t\t$emp->logo = $this->getPostParam(\"imagen\");\n\t\t\t$emp->regimen_id = $this->getPostParam(\"regimen_id\");\n\t\t\t\t\t\t\t\t\n\t\t\tif($emp->save()){\n\t\t\t\tFlash::success(\"Se insertó correctamente el registro\");\n\t\t\t\tprint(\"<script>document.location.replace(\".core::getInstancePath().\"'empresa/mostrar/$emp->id');</script>\");\n\t\t\t}else{\n\t\t\t\tFlash::error(\"Error: No se pudo insertar registro\");\t\n\t\t\t}\n\t\t\t\t\t\n\t }", "public function create()\n {\n //\n return view('employee.add');\n }", "public function store(Request $request)\n {\n \n \n $career_id=$request->input('career_id');\n $employeeFirstName=$request->input('employeeFirstName');\n $employeeMiddleName=$request->input('employeeMiddleName');\n $employeeLastName=$request->input('employeeLastName');\n $employeeBrithday=$request->input('employeeBrithday');\n $employeeFrom=$request->input('employeeFrom');\n $employeeTo=$request->input('employeeTo');\n $employeeMobile=$request->input('employeeMobile');\n $employeePhoneHome=$request->input('employeePhoneHome');\n $employeePhoneJob=$request->input('employeePhoneJob');\n $employeeAddress=$request->input('employeeAddress');\n $employeeCity=$request->input('employeeCity');\n $employeeNational=$request->input('employeeNational');\n $employeeSalary=$request->input('employeeSalary');\n \n\n\n \n $new_employee = New Employee ;\n \n $new_employee->career_id=$career_id;\n $new_employee->employeeFirstName=$employeeFirstName;\n $new_employee->employeeMiddleName=$employeeMiddleName;\n $new_employee->employeeLastName=$employeeLastName;\n $new_employee->employeeBrithday=$employeeBrithday;\n $new_employee->employeeFrom=$employeeFrom;\n $new_employee->employeeTo=$employeeTo;\n $new_employee->employeeMobile=$employeeMobile;\n $new_employee->employeePhoneHome=$employeePhoneHome;\n $new_employee->employeePhoneJob=$employeePhoneJob;\n $new_employee->employeeAddress=$employeeAddress;\n $new_employee->employeeCity=$employeeCity;\n $new_employee->employeeNational=$employeeNational;\n $new_employee->employeeSalary=$employeeSalary;\n \n $new_employee->save();\n\n\n\n\n\n return redirect ('/accountant/employees') ;\n\n }", "public function insert_employee_info()\n\t{\t\n\t\tif (!$this->Admin_model->is_admin_loged_in()) \n\t\t{\n\t\t\tredirect('Adminlogin/?logged_in_first');\n\t\t}else{\n\t\t\tif($this->admin_access('employee_entry') != 1){\n\t\t\t\t$data['warning_msg']=\"You Are Not able to Access this Module...!\";\n\t\t\t\t$this->session->set_flashdata($data);\n\t\t\t\tredirect('hr_payroll/dashboard');\n\t\t\t}\n\t\t\t$data['title'] = 'Add Employee Information'; \n\t\t\t$data['content'] = 'employee/insert_employee';\n\t\t\t$this->load->view('admin/adminMaster', $data);\n\t\t}\n\t}", "public function addEmployee($data)\n { \n try \n {\n $data['password'] = md5($data['password']);\n $result = $this->insert($data);\n \n return $result;\n }\n catch(Exception $e)\n {\n echo $e->getMessage();\n }\n }", "public function create_employee()\n {\n //get dropdown data\n $functional_units = [];\n $data = [];\n $this->get_data($data, $functional_units);\n\n return view('accounts.create_employee')->with([\n 'functional_units' => $functional_units, \n 'data' => $data\n ]);\n }", "public function addEmployees(TeamUpdateEmployeePost $request, $id)\n {\n $team = Team::findOrFail($id);\n $employees = $request->input('users');\n\n\n /*\n | @Begin Transaction\n |---------------------------------------------*/\n \\DB::beginTransaction();\n\n\n /* Update the team employees */\n $team->addEmployees($employees);\n\n\n /*\n | @End Transaction\n |---------------------------------------------*/\n \\DB::commit();\n\n\n return response()->json([\n 'response' => 1,\n 'redirectURL' => route('team.show', $team->id),\n 'title' => 'Add employees',\n 'message' => 'Successfully added ' . count($employees) . ' employee(s) from team ' . $team->name\n ]);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'emp_id' => 'required',\n 'dep_id' => 'required',\n 'hod_id' => 'required',\n 'e_name' => 'required',\n 'e_email' => 'required',\n 'e_designation' => 'required',\n 'e_phoneno' => 'required',\n 'e_address' => 'required',\n 'e_password' => 'required'\n \n \n ]);\n\n $employee = new Employee(\n [\n 'emp_id' => $request->get('emp_id'),\n 'dep_id' => $request->get('dep_id'),\n 'hod_id' => $request->get('hod_id'),\n 'e_name' => $request->get('e_name'),\n 'e_email' => $request->get('e_email'),\n 'e_designation' => $request->get('e_designation'),\n 'e_phoneno' => $request->get('e_phoneno'),\n 'e_address' => $request->get('e_address'),\n 'e_password' => $request->get('e_password')\n \n ]);\n\n $employee ->save();\n return redirect()->route('Employee.index')->with('success','One Record Added Successfully');\n }", "public function store(Request $request)\n {\n Employee::create($request->all());\n }", "public function run()\n {\n DB::table('employees')->insert([\n 'emp_title' => 'employee',\n 'emp_name' => 'Jawad',\n 'emp_fname' => 'MJawad',\n 'emp_address' => 'mingora Swat',\n 'emp_contact' => '03420909974',\n 'emp_dob' => null,\n 'emp_email' => 'aziz@gmail.com',\n 'emp_permanent_address' => 'mingora Swat',\n 'is_married' => 'single',\n 'emp_nationality' => 'pakistani',\n 'emp_gender' => 'male',\n 'is_employee' => 'employee',\n 'emp_religion' => 'islam',\n 'reason_of_resign' => null,\n 'emp_status' => 1,\n 'emp_experience' => '2 Yeaes',\n 'emp_profile_image' => 'no image',\n 'emp_file_attachment' => 'no files',\n 'resig_file' => null,\n ]);\n }", "public function store(StoreEmployeeRequest $request)\n {\n // Send request to RandomUser API to get fake employee data\n $client = new Client();\n $url = \"https://randomuser.me/api/\";\n\n try {\n $response = $client->request(\"GET\", $url);\n } catch (RequestException $e) {\n if ($e->hasResponse()) {\n return [\n 'result' => 'error',\n 'message' => Psr7\\Message::toString($e->getResponse())\n ];\n }\n }\n\n $random_data = json_decode((string)$response->getBody())->results[0];\n\n // Create new employee\n $employee = new Employee();\n $employee['gender'] = $random_data->gender;\n $employee['first_name'] = $random_data->name->first;\n $employee['last_name'] = $random_data->name->last;\n $employee['title'] = $random_data->name->title;\n $employee['address'] = implode(\n \" \",\n [\n $random_data->location->street->number,\n $random_data->location->street->name,\n ]\n );\n $employee['city'] = $random_data->location->city;\n $employee['state'] = $random_data->location->state;\n $employee['country'] = $random_data->location->country;\n $employee['postcode'] = $random_data->location->postcode;\n $employee['email'] = $random_data->email;\n $employee->save();\n $employee_id = $employee->id;\n\n $data = $request->all();\n\n // Create employee experience\n foreach ($data['experience'] as $row) {\n $experience = new Experience([\n 'employee_id' => $employee_id,\n 'company_name' => $row['company_name'],\n 'job_title' => $row['job_title'],\n 'experience' => $row['experience'],\n 'month_from' => $row['month_from'],\n 'year_from' => $row['year_from'],\n 'month_to' => $row['month_to'] ?? null,\n 'year_to' => $row['year_to'] ?? null\n ]);\n $experience->save();\n }\n\n return [\n 'result' => 'success',\n 'message' => 'New employee and experience created',\n 'data' => [\n 'employee_id' => $employee_id,\n 'first_name' => $employee['first_name'],\n 'last_name' => $employee['last_name'],\n 'email' => $employee['email']\n ]\n ];\n }", "public function store(Request $request)\n {\n //validate text filds\n $this->validate($request, [\n 'name' => 'required',\n 'surname' => 'required',\n 'age' => 'required',\n 'salary' => 'required',\n 'position' => 'required',\n 'address' => 'required',\n 'hired_date' => 'required'\n ]);\n\n //insert employee record\n $emp = new Emp;\n $emp->name = $request->input('name');\n $emp->user_id = auth()->user()->id;\n $emp->surname = $request->input('surname');\n $emp->age = $request->input('age');\n $emp->salary = $request->input('salary');\n $emp->position = $request->input('position');\n $emp->address = $request->input('address');\n $emp->hired_date = $request->input('hired_date');\n\n $emp->save();\n\n //redirect to home page\n return redirect('/')->with('success', 'Employee Created');\n }", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function additionEmployee()\n {\n global $dbh;\n \n // INSERT INTO `employee` (`idm`, `namema`, `nameme`, `mobilem`, `countrym`, `carerm`, `noborder`, `noiqama`, `nopassport`, `airportm`, `adressm`, `telem`, `entermsa`, `worktime`, `exiqamam`, `exinsurancem`, `exlincm`, `expassportm`, `premssionm`, `deletm`) VALUES (NULL, '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '2017-01-02', '2017-01-02', '2017-01-02', '2017-01-02', '2017-01-02', '2017-01-02', '0', '0');\n \n $sql = $dbh->prepare(\"INSERT INTO `employee` (`fnamema`, `fnameme`, `namema`, `nameme`, `mobilem`, `countrym`, `carerm`, `noborder`, `noiqama`, `nopassport`, `airportm`,\n `adressm`, `telem`, `entermsa`, `worktime`, `exiqamam`, `exinsurancem`, `exlincm`, `expassportm`, `premssionm`, `statusm`, `deletm`, `password`) VALUES \n ('$this->fnamema', '$this->fnameme', '$this->namema', '$this->nameme', '$this->mobilem', '$this->countrym', '$this->carerm', '$this->noborder', '$this->noiqama',\n '$this->nopassport', '$this->airportm', '$this->adressm', '$this->telem', '$this->entermsa', '$this->worktime', '$this->exiqamam', '$this->exinsurancem', '$this->exlincm', '$this->expassportm', '$this->premssionm', '$this->statusm', '$this->deletm', '$this->password')\");\n $result = $sql->execute();\n $eroro = $sql->errorInfo();\n $id = $dbh->lastInsertId();\n return array ($result,$id,$eroro);\n }", "public function save(\\Admin\\Model\\Employee $employee) {\n if ($employee->employee_id == 0) {\n // set date fields to now\n $d = new \\DateTime();\n $employee->date_created = $d->format(\"Y-m-d H:i:s\");\n $employee->date_modified = $d->format(\"Y-m-d H:i:s\");\n $employee->date_last_visited = \"0000-00-00 00:00:00\";\n if ($this->emailExists($employee->getEmail()))\n throw new \\Admin\\Exception(\"email already exists\");\n\n $this->tableGateway->insert($employee->getArrayCopy());\n $employee->employee_id = $this->tableGateway->lastInsertValue;\n } else {\n\n if ($employee = $this->getEmployee($id)) {\n $d = new \\DateTime();\n $new_employee->setDateCreated($employee->getDateCreated());\n $new_employee->setDateModified($d->format(\"Y-m-d H:i:s\"));\n $this->tableGateway->update($new_employee->toArray(), array('employee_id' => $id));\n }\n }\n }", "public function create()\n {\n return view(\"employees.create\");\n }", "public function create()\n {\n $employee = null;\n $gender = 1;\n $religion = 2;\n $role = 0;\n $shift = 1;\n $roles = Role::whereNotIn('id', [AppHelper::USER_ADMIN, AppHelper::USER_TEACHER, AppHelper::USER_STUDENT, AppHelper::USER_PARENTS])->pluck('name', 'id');\n return view('backend.hrm.employee.add', compact('employee', 'gender', 'religion', 'role', 'roles', 'shift'));\n }", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "public function run()\n {\n Employee::create([\n 'name'=>'Mehdi',\n 'email'=>'mehdi@gmail.com',\n 'password'=>bcrypt('123456'),\n 'role'=>'admin',\n 'phone'=>'0541863592',\n \n ]);\n }", "public function run()\n {\n DB::table('employees')->insert(array(\n array('name'=>'Employee', 'username' => 'employee', 'password' => bcrypt('password'))\n ));\n }", "public function store(StoreEmployee $request)\n {\n try {\n $employee = Employee::create($request->all());\n $company = Company::findOrFail($request->company);\n $employee->company()->associate($company);\n $employee->save();\n } catch (\\Throwable $th) {\n return redirect()->back()->withErrors('Upss! Error - ' . $th->getMessage())->withInput(); \n }\n \n return redirect()->route('employees.index')->with('status', 'Employee created sucessfully.'); \n }", "public function actionCreate()\n\t{\n\t\t$model=new Employe;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Employe']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Employe'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_employe));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function store(StoreEmployeRequest $request)\n {\n employees::create($request->all());\n return redirect()->route('Employees.index')->with(['message' => 'employe create successfully']);;\n }", "public function createEmployee() {\n $newUser = User::create([\n \"name\"=>request('name'),\n \"email\"=>request('email'),\n \"password\"=> '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm',\n \"organizationId\"=>Auth::user()->organizationId,\n \"role\"=>\"employee\",\n \"password_token\"=>\\str_random(100)\n ]);\n\n $headers = request('headers');\n\n if(isset($headers)) {\n for($i = 0; $i < sizeof($headers); $i++) {\n Header::create([\n 'header'=>$headers[$i],\n 'userId'=>$newUser->id\n ]);\n }\n }\n\n return back();\n }", "public function testUpdateEmployee()\n {\n }", "public function storeNewEmployer($input);", "public function store(){\n $name = $_POST['name'];\n $lastName = $_POST['lastName'];\n $address = $_POST['address'];\n $city = $_POST['city'];\n $phone = $_POST['phone'];\n $email = $_POST['email'];\n $country_id = $_POST['country_id'];\n $department_id = $_POST['department_id'];\n\n // Posa-les a la BBDD\n $employee = new Employee;\n $employee->name = $name;\n $employee->lastName = $lastName;\n $employee->address = $address;\n $employee->city = $city;\n $employee->phone = $phone;\n $employee->email = $email;\n $employee->country_id = $country_id;\n $employee->department_id = $department_id;\n\n // Guarda les dades a employee\n $employee->save();\n\n return redirect()->route('employees.index');\n }", "public function store(Request $request)\n {\n $request-> validate([\n 'firstname' => 'required|max:50',\n 'lastname' => 'required|max:50',\n 'email' => 'required|email|max:50',\n 'phone' => 'required|integer',\n 'gender' => 'required|max:1',\n 'empNo' => 'required|integer'\n\n ]);\n \n DB::table(\"employee\")->insert ([\n 'firstname'=>$request['firstname'],\n 'lastname'=>$request['lastname'],\n 'email'=>$request['email'],\n 'phone'=>$request['phone'],\n 'gender'=>$request['gender'],\n 'empNo'=>$request['empNo']\n ]);\n \n Session::flash(\"msg\",\"Created Successfully\");\n \n return redirect (route(\"employees.index\"));\n }", "public function store(Request $request)\n {\n $this->validate($request , [\n 'fullName' => 'required',\n 'role' => 'required',\n 'email' => 'required',\n 'completedTasks' => 'required',\n 'onProgressTasks' => 'required',\n 'missedDeadline' => 'required'\n ]);\n \n $employee = new Employee;\n $employee->fullName = $request->input('fullName');\n $employee->role = $request->input('role');\n $employee->email = $request->input('email');\n $employee->completedTasks = $request->input('completedTasks');\n $employee->onProgressTasks = $request->input('onProgressTasks');\n $employee->missedDeadline = $request->input('missedDeadline');\n $employee->user_id = auth()->user()->id;\n $employee->save();\n return redirect('/employees')->with('success','Employee Added');\n }", "public function run()\n {\n //\n DB::table('employees')->insert([\n 'forename'=>'Selcuk',\n 'surename'=>'Karateke',\n// 'role_id'=>1,\n ]);\n }", "function createEmployee( Request $request )\n\t\t\t{\n\t\t\t\t$validated = $request->validate( [ 'username' =>'required|unique:employees' ] );\n\n\t\t\t\tif ( ! empty( $validated ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$employee = new Employee();\n\n\t\t\t\t\t\t$employee->status = empty( $request->status ) ? 0 : 1;\n\t\t\t\t\t\t// we can also create a function where we can validate if $request->dept_id exisist in DB to be double sure before any insertion of a foreign key\n\t\t\t\t\t\t$employee->department_id = $request->dept_id;\n\t\t\t\t\t\t$employee->name = $request->name;\n\t\t\t\t\t\t$employee->username = $request->username;\n\t\t\t\t\t\t// Password should never be stored in plain format, so we will encrypt and store it in DB, you may use any other encryption methid like md5 / sha, etc\n\t\t\t\t\t\t$employee->password = bcrypt( $request->password );\n\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$result = $employee->save();\n\n\t\t\t\t\t\t\t\tif ( $result )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn [ $this->finalResponse( 'success', 'User created!', 'Pleae login to continue.', [ 'emp_id' => $employee->id ] ) ];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn [ $this->finalResponse() ];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch ( Exception $e )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->finalResponse();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn [ $this->finalResponse( 'info', 'User already exists!', 'Please choose a different username.' ) ];\n\t\t\t\t\t}\n\t\t\t}", "public function addEmployee()\n {\n return view('empmodel');\n }", "function CreateEmployee($username) {\r\n $conn = conn();\r\n $sql = \"INSERT INTO employee(Natregno,LastName,FirstName,Initial,Title,AddressLine1,AddressLine2,AddressLine3,AddressLine4,Parish,PostalCode,WorkPhone,HomePhone,CellNo,Ext,FaxNum,Email,RoleName,RateCode,NISNo,Notes,EmpStatus,RecEntered,RecEnteredBy,RecModified,RecModifiedBy,DelFlg,DateOfBirth,Age,Gender) \r\n VALUES('$this->Natregno','$this->LastName','$this->FirstName','$this->Initial','$this->Title','$this->AddressLine1','$this->AddressLine2','$this->AddressLine3','$this->AddressLine4','$this->Parish','$this->PostalCode','$this->WorkPhone','$this->HomePhone','$this->CellNo','$this->Ext',\r\n '$this->FaxNum','$this->Email','$this->RoleName','$this->RateCode','$this->NISNo','$this->Notes','$this->EmpStatus',NOW(),'$username',NULL,NULL,'$this->DelFlg',NOW(),'$this->Age','$this->Gender')\";\r\n if ($conn->exec($sql)) {\r\n $this->auditok = 1;\r\n } else {\r\n $this->auditok = 0;\r\n }\r\n $conn = NULL;\r\n }", "public function store(EmployeeStore $request)\n {\n Employee::create($request->all());\n\n return redirect(route('app.employee'));\n }", "public function create()\n {\n //\n return view('admin.employees.create');\n }", "public function store(Request $request){\n\n $employees = new Employee;\n $employees->id_karyawan = $request->id_karyawan;\n $employees->sap = $request->sap;\n $employees->nama_karyawan = $request->nama_karyawan;\n $employees->id_gender = $request->id_gender;\n $employees->tgl_lahir = $request->tgl_lahir;\n $employees->tgl_daftar = $request->tgl_daftar;\n $employees->id_agama = $request->id_agama;\n $employees->alamat = $request->alamat;\n $employees->telp = $request->telp;\n $employees->save();\n // dd('kesini');\n\n return redirect('employee')->with('pesan', 'Data berhasil ditambahkan');\n }", "public function store(EmployeeStoreRequest $request)\n {\n $inputs = $request->validated();\n if ($inputs){\n\n // store\n $employee = new Employees();\n $employee->company_id = $request->company_id;\n $employee->firstname = $request->firstname;\n $employee->lastname = $request->lastname;\n $employee->email = $request->email;\n $employee->phone = $request->phone;\n $employee->save();\n\n // redirect\n Session::flash('message', 'Successfully created employee!');\n\n return Redirect::to('admin/employee');\n }\n }", "public function saveAction($id=null)\n {\n header('Access-Control-Allow-Origin: *'); //Not secure, but enough for this test scope\n header(\"Access-Control-Allow-Methods: POST\");\n\n if($id){\n $employee = Employees::findFirst(\"id=$id\");\n }else{\n $employee = new Employees();\n $employee->group_id = $this->request->getQuery(\"department_id\");\n }\n\n $employee->name = $this->request->getPost(\"name\");\n $employee->surname = $this->request->getPost(\"surname\");\n $employee->email = $this->request->getPost(\"email\");\n $employee->address = $this->request->getPost(\"address\");\n $employee->risk = $this->request->getPost(\"risk\");\n\n if($success){\n $employee = EmployeeEmployees::findFirst(\"employee_id=$employee->id\");\n if(!$employee){\n //no previous employee\n if($this->request->getPost(\"employee_boss_id\")){\n //Create\n $employee = new EmployeeEmployees();\n $employee->employee_id=$employee->id;\n $employee->employee_subordinate_id=$this->request->getPost(\"employee_boss_id\");\n $success = $employee->save();\n }\n }else{\n //Existent previous employee\n if($this->request->getPost(\"employee_boss_id\")){\n //Update\n $employee->employee_id=$employee->id;\n $employee->employee_subordinate_id=$this->request->getPost(\"employee_boss_id\");\n $success = $employee->save();\n }else{\n //remove\n $success = $employee->delete();\n }\n }\n }\n\n if ($success) {\n return json_encode([\"ok\"=>true]);\n } else {\n return json_encode([\"ok\"=>false]);\n }\n }", "public function create()\n {\n \n $employee = DB::table('employees')->get();\n return view('post.create',compact('employee'));\n }", "public function singlestore(Request $request)\n {\n $employee = new Employee();\n $employee->emp_name = $request->name;\n $employee->emp_id = $request->empid;\n $employee->enrolment_id = $request->enrolid;\n $employee->nid = $request->nid;\n $employee->save();\n\n //displaying notification message to user after adding employee\n Toastr::success('Employee Created Successfully','Success');\n return redirect()->back();\n }", "public function store(CreateEmployeeRequest $request)\n {\n $this->employee->create($request->all());\n\n return redirect()->route('admin.employee.employee.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('employee::employees.title.employees')]));\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function edit(Employee $employee)\n {\n //\n }", "public function insert()\n\t{\n\t\t$crud = $this->crud->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->insert();\n\t\t$this->redirect('crud');\n\t}", "function newEmployee($conn){\n\t\t$name = mysqli_real_escape_string($conn, $_POST['name']);\n\t\t$email = mysqli_real_escape_string($conn, $_POST['email']);\n\t\t$password = mysqli_real_escape_string($conn, $_POST['password']);\n\t\t$contact = mysqli_real_escape_string($conn, $_POST['contact']);\n\t\t$dept = mysqli_real_escape_string($conn, $_POST['dept']);\n\t\t$type = mysqli_real_escape_string($conn, $_POST['choice']);\n\n\t\t$sql = \"SELECT * FROM employee WHERE employee.email='$email'\";\n\t\t$result = mysqli_query($conn, $sql);\n\t\t$check = mysqli_num_rows($result);\n\t\tif($check == 1){\n\t\t\t// Employee with this email already exists\n\t\t\theader('Location: ../addEmployee.php?user_exists=true');\n\t\t}else{\n\t\t\t// Create new Employee\n\t\t\tif($type == \"normal\"){\n\t\t\t\t// Permanent Employee\n\t\t\t\t$salary = mysqli_real_escape_string($conn, $_POST['ann_salary']);\n\n\t\t\t\t$sql = \"INSERT INTO employee(name,email,password,contact,department,salary) VALUES('$name','$email','$password','$contact','$dept','$salary')\";\n\n\t\t\t\t$result = mysqli_query($conn, $sql);\n\t\t\t\tif($result){\n\t\t\t\t\t$last_id = mysqli_insert_id($conn);\n\t\t\t\t\t$sql = \"INSERT INTO permanent_trainer(emp_id) VALUES($last_id)\";\n\t\t\t\t\t$result2 = mysqli_query($conn, $sql);\n\t\t\t\t\t\n\t\t\t\t\theader('Location: ../admin.php?p_emp_added=true');\n\t\t\t\t}\n\t\t\t}elseif($type == \"temp\"){\n\t\t\t\t// Temporary Employee\n\t\t\t\t$salary = mysqli_real_escape_string($conn, $_POST['mon_salary']);\n\n\t\t\t\t$sql = \"INSERT INTO employee(name,email,password,contact,department) VALUES('$name','$email','$password','$contact','$dept')\";\n\t\t\t\t$result = mysqli_query($conn, $sql);\n\t\t\t\tif($result){\n\t\t\t\t\t$last_id = mysqli_insert_id($conn);\n\t\t\t\t\t$sql = \"INSERT INTO temporary_trainer(emp_id,monthly_salary) VALUES($last_id,$salary)\";\n\t\t\t\t\t$result2 = mysqli_query($conn, $sql);\n\t\t\t\t\theader('Location: ../admin.php?t_emp_added=true');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function add_employee(Request $request)\n {\n \t$data=array();\n \t\t$data['unit_id']=$request->unit_id;\n \t\t$data['designation_id']=$request->designation_id;\n \t\t$data['grade_id']=$request->grade_id;\n $data['employee_name']=$request->employee_name;\n \t\t$data['employee_phone']=$request->employee_phone;\n \t\t$data['employee_email']=$request->employee_email;\n \t\t$data['employee_date_of_birth']=$request->employee_date_of_birth;\n \t\t$data['employee_join_date']=$request->employee_join_date;\n \t\t$data['employee_nid']=$request->employee_nid;\n \t\t$data['employee_father_name']=$request->employee_father_name;\n \t\t$data['employee_mother_name']=$request->employee_mother_name;\n \t\t$data['employee_parmanent_address']=$request->employee_parmanent_address;\n \t\t$data['employee_present_address']=$request->employee_present_address;\n \t\t$data['employee_status']='1';\n \t\t$data['shift_name']=$request->shift_id;\n \t\t$image=$request->file('employee_photo');\n \t\tif ($image) {\n \t\t\t$image_name=str_random(20);\n \t\t\t$ext=strtolower($image->getClientOriginalExtension());\n \t\t\t$image_full_name=$image_name. '.' .$ext;\n \t\t\t$upload_path='employee/';\n \t\t\t$image_url=$upload_path.$image_full_name;\n \t\t\t$success=$image->move($upload_path,$image_full_name);\n \t\tif($success){\n \t\t\t$data['employee_photo']=$image_url;\n \t\t\t\tDB::table('tbl_employee')->insert($data);\n \t\t\t\tSession::put('message','Employee added successfully');\n \t\t\t\t\treturn redirect::back();\t\n \t\t}\n \t\t}\n \t\t$data['employee_photo']='';\n \t\tDB::table('tbl_employee')->insert($data);\n \t\t\t\tSession::put('message','Employee added successfully without image');\n \t\t\t\treturn redirect::back();\t\n }", "public function store(Request $request)\n {\n //validations\n $rule=['first_name'=> 'required','last_name' => 'required'];\n $custom_message=['first_name.required' => 'Employee first name is required.',\n 'last_name.required' => 'Employee last name is required.'\n ];\n $this->validate($request,$rule,$custom_message);\n //insert employee\n $employee=new Employee();\n $employee->first_name=$request->first_name;\n $employee->last_name=$request->last_name;\n $employee->email=$request->email;\n $employee->phone=$request->phone;\n $employee->company=$request->selected;\n $employee->save();\n Session::flash('success', 'Employee added successfuly.');\n return redirect()->back();\n }", "public function run()\n {\n DB::table('employees')\n ->insert([\n 'name' => 'Administrator',\n 'email' => 'genephillip222@gmail.com',\n 'phone' => 154898456984,\n 'role' => 'Super Admin',\n 'created_at' => now()\n ]);\n }", "public function create()\n {\n //\n return view('employees.create');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'name' => 'required',\n 'designation' => 'required',\n 'email' => 'required|email|unique:employees,email',\n 'phone' => 'required|numeric',\n 'address' => 'required',\n ]);\n $db_employee = new Employee();\n $db_employee->name = $request->name;\n $db_employee->designation = $request->designation;\n $db_employee->email = $request->email;\n $db_employee->phone = $request->phone;\n $db_employee->address = $request->address;\n $db_employee->total = 22;\n $db_employee->save();\n return new EmployeeResource($db_employee);\n }", "public function create()\n {\n return view('pages.employees.add');\n }", "public function create()\n {\n //\n return view('employees.create');\n }", "public function store(StoreEmployee $request)\n {\n try{\n \n $employeeRole = Role::where('name', 'employee')->firstOrFail(); \n $data = [\n \"name\" => $request->get(\"name\"),\n \"designation\" => $request->get(\"designation\"),\n \"email\" => $request->get(\"email\"),\n \"password\" => Hash::make($request->get(\"password\")),\n \"manager_id\" => $request->get(\"manager_id\"),\n \"date_of_birth\" => $request->get(\"date_of_birth\"),\n \"joining_date\" => $request->get(\"joining_date\"),\n ];\n $employee = User::create($data);\n $employee->assignRole($employeeRole);\n return response()->json($employee, 201);\n } catch (ModelNotFoundException $ex) {\n return response()->json(['errors'=>['role'=>'Employee Role Not Exists']], 404);\n }\n }", "public function testCreateEmployee()\n {\n }", "public function store(EmployeeRequest $request)\n {\n $attr = $request->validated();\n $attr['company_id'] = $request->company;\n $employees = Employee::create($attr);\n\n event(new EmployeeCreated($employees));\n\n session()->flash('success', __('Employee has been created.'));\n return redirect('employees');\n }", "public function store(Request $request)\n {\n Employee::updateOrCreate(['id' => $request->Employee_id],\n ['name' => $request->name, 'description' => $request->description]); \n \n return response()->json(['success'=>'Employee saved successfully.']);\n }", "public function create()\n {\n //\n return view('employee.create');\n }", "public function create()\n {\n return view('Employee.AddEmp');\n }", "public function updateEmployee()\n {\n // if we have POST data to create a new employee entry\n if (isset($_POST[\"submit_update_employee\"])) {\n // do updateEmployee() from model/model.php\n $this->model->updateEmployee($_POST[\"firstname\"], $_POST[\"surname\"], $_POST[\"email\"], $_POST[\"phone\"], $_POST[\"category\"], $_POST[\"started\"], $_POST[\"left\"],$_POST['employee_id']);\n }\n\n // where to go after employee has been added\n header('location: ' . URL . 'employees/index');\n }", "public function add($EmployeeID, $NationalIDNumber, $ContactID, \n $Title, $BirthDate, $Gender, $HireDate)\n {\n $requete=\"INSERT INTO `employee` (`EmployeeID`, `NationalIDNumber`, `ContactID`,`Title`, `BirthDate`, `Gender`, `HireDate`)\n VALUES ('$EmployeeID', '$NationalIDNumber', '$ContactID', '$Title', '$BirthDate', '$Gender', '$HireDate')\";\n //print_r($requete);\n try{\n $db=new pdo('mysql:host=localhost;dbname=adw;charset=utf8','root','');\n $resultat=$db->prepare($requete); \n \n return $resultat->execute();\n }\n catch(PDOException $Ex)\n {\n print \"Erreur !: \" . $e->getMessage() . \"<br/>\";\n die();\n } \n \n }", "public function run()\n {\n DB::table('employees')->insert([\n [\n 'fullname' => 'John Wich',\n 'gender' => 'Male',\n 'email' => 'johnwich@emai.com',\n 'tel' => '089-123-456',\n 'age' => 45,\n 'address' => '123 Soi 4578 BKK TH',\n 'avatar' => 'noavatar.jpg',\n 'status' => 1,\n ],\n [\n 'fullname' => 'Somchai Jaidee',\n 'gender' => 'Male',\n 'email' => 'Somchaij@emai.com',\n 'tel' => '089-234-5678',\n 'age' => 35,\n 'address' => '486 Soi 789 BKK TH',\n 'avatar' => 'somchaij.jpg',\n 'status' => 2,\n ],\n [\n 'fullname' => 'Siriwan Vadee',\n 'gender' => 'Female',\n 'email' => 'siriwanv@emai.com',\n 'tel' => '062-789-5687',\n 'age' => 35,\n 'address' => '486 Soi 789 BKK TH',\n 'avatar' => 'somchaij.jpg',\n 'status' => 2,\n ],\n ]);\n }", "public function addNewHospital()\n {\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'firstname'=>'required',\n 'lastname'=>'required',\n 'email'=>'required',\n 'phone'=>'required',\n 'age'=>'required',\n 'position_id'=>'required'\n ]);\n\n //get post data\n\n $empData = $request->all();\n //insert post data\n $empData = new Employee([\n 'firstname' => $request->get('firstname'),\n 'lastname' => $request->get('lastname'),\n 'email' => $request->get('email'),\n 'phone' => $request->get('phone'),\n 'age' => $request->get('age'),\n 'position_id' => $request->get('position_id')\n ]);\n if($empData->save()){\n// Session::flash('success_msg','Employee Added successfully !!');\n return redirect()->route('index');\n }else{\n// Session::flash('fail_msg','Fail adding employee !!');\n return redirect()->route('index');\n }\n }", "public function create()\n {\n return view('employees.create'); \n }", "function addemployee($empyname,$empymbl,$empemail,$empdesignation)\n\t{\n\t\t$names = array('name' => $empyname ,'mobile' =>$empymbl,'\temail' => $empemail, 'designation' => $empdesignation);\n\t\t$add_query = $this->insert( 'payrentz_employees', $names );\n\t\tif( $add_query )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function store (Request $request) {\n try {\n $input = $request->all();\n $input['id'] = \\Helpers::generateId();\n $input['password'] = \\Hash::make($input['password']);\n // $input['creator_id'] = \\Auth::user()->id;\n $employee = User::create($input);\n if(!empty($employee))\n return response()->json(['success' => __('New employee had been created.')], 200);\n else\n return response()->json(['error' => 'System error, please contact administrator.'], 200);\n } catch(\\Exception $ex) {\n return response()->json(['error' => $ex->getMessage()], 200);\n }\n }", "public function store(StoreEmployeeRequest $request)\n {\n $password = Hash::make($request->password);\n $data = $request->all();\n $data['password'] = $password;\n\n $employee = Employee::create($data);\n\n return EmployeeResource::collection($employee);\n }", "function add_employee( $empl_name, $pre_address, $per_address, $date_of_birth, $age, $mobile_phone, $email, $grade, $department, $designation, $gross_salary, $basic, $date_of_join){\n\t \t\n\t\t$date_of_birt = date2sql($date_of_birth); \n\t\t$date_of_joint = date2sql($date_of_join); \n\t\t$sql = \"INSERT INTO \".TB_PREF.\"kv_empl_info ( empl_name, pre_address, per_address, date_of_birth, age, mobile_phone, email, grade, department, designation, gross_salary, basic, date_of_join) VALUES (\"\n\t\t\n\t\t.db_escape($empl_name).\", \"\n\t\t.db_escape($pre_address).\", \"\n\t\t.db_escape($per_address).\", \"\t\t\n\t\t.db_escape($date_of_birt).\", \"\n\t\t.db_escape($age).\", \"\n\t\t.db_escape($mobile_phone).\", \" \n\t\t.db_escape($email).\", \" \n\t\t.db_escape($grade).\", \" \n\t\t.db_escape($department).\", \" \n\t\t.db_escape($designation).\", \" \n\t\t.db_escape($gross_salary).\",\"\n\t\t.db_escape($basic).\",\"\n\t\t.db_escape($date_of_joint).\")\";\n\n\tdb_query($sql,\"The employee could not be added\");\n\treturn db_insert_id(); \n}", "public function run()\n {\n Employee::forceCreate([\n 'last_name' => 'Harangozó',\n 'first_name' => 'Dóra',\n 'birth' =>'1994-04-20',\n 'image' =>'default.jpg',\n 'email' =>'doraharangozo1994@example.hu',\n 'address' => 'Sopron, Kőszegi út 20.',\n 'phone_number' => '06306089097',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'mérnök',\n 'comment'=> null,\n 'user_id'=>1,\n 'site_id'=>1,\n ]);\n Employee::forceCreate([\n 'last_name' => 'Nagy',\n 'first_name' => 'Péter',\n 'birth' =>'1980-08-08',\n 'image' =>'default.jpg',\n 'email' =>'nagy.peter@example.hu',\n 'address' => 'Sopron, Kossuth út 20.',\n 'phone_number' => '06301234569',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'menedzser',\n 'comment'=> null,\n 'user_id'=>2,\n 'site_id'=>1,\n ]);\n\n Employee::create([\n 'last_name' => 'Nagy',\n 'first_name' => 'Luca',\n 'birth' =>'1990-11-24',\n 'image' =>'default.jpg',\n 'email' =>'nagy.luca@example.hu',\n 'address' => 'Sopron, Baross út 20.',\n 'phone_number' => '06306666666',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'telephely vezető',\n 'comment'=> null,\n 'user_id'=>4,\n 'site_id'=>2,\n ]);\n Employee::create([\n 'last_name' => 'Nagy',\n 'first_name' => 'Lili',\n 'birth' =>'1990-07-01',\n 'image' =>'default.jpg',\n 'email' =>'nagy.lili@example.hu',\n 'address' => 'Sopron, Szív utca 20.',\n 'phone_number' => '06303333333',\n 'month_salary' => 123456789,\n 'recruitment_date'=>'2018-10-10',\n 'job'=>'adminisztrátor',\n 'comment'=> null,\n 'user_id'=>3,\n 'site_id'=>2,\n ]);\n }", "public function testEmployeeCreate()\n {\n $user = factory(User::class)->create();\n $company_id = factory(Company::class)->create()->id;\n\n $response = $this->actingAs($user)->JSON('POST', '/employees', ['first_name' => 'Adam', 'last_name' => 'Kovalski','email' => 'testing@user.com', 'phone' => '+48123456789', 'company_id' => $company_id]);\n $response->assertStatus(302);\n }", "public function create()\n {\n //\n return view('hr/employee/create');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'name'=>'required',\n 'email'=>'required|email|unique:employee',\n 'phone'=>'required|min:10',\n 'address'=>'required|min:300',\n ]);\n\n $employee = new Employee([\n 'name' => $request->name,\n 'email' => $request->email,\n 'phone' => $request->phone,\n 'address' => $request->address,\n 'salary' => $request->salary,\n ]);\n $employee->save();\n return redirect('/employee')->with('success', 'Employee Added!');\n }", "public function store(Request $request, $emp_id)\n {\n\n $employees = User::find($emp_id);\n if(!User::hasAccess($employees))\n {\n return redirect('/dashboard')->with([\n 'success' => 'You are not authorized to view this page!'\n ]);\n }\n $this->validate($request, [\n 'subject' => 'required',\n 'subject.*' => 'required',\n ]);\n\n if (isset($request->number)) {\n for ($count = 0; $count < count($request->number); $count++) {\n if (!empty($request->number[$count])) {\n $t_details = new TeachingDetail();\n $t_details->number = $request->number[$count];\n $t_details->subject = $request->subject[$count];\n $t_details->class = $request->class[$count];\n $t_details->periods = $request->periods[$count];\n $t_details->employee_id = $emp_id;\n $t_details->save();\n }\n }\n }\n if ($request->submit == 'Save') {\n return redirect()->back()->with([\n 'success' => 'Added Successfully',\n ]);\n }\n if (Auth::user()->usertype == 'user') {\n if (Auth::user()->employee_id != $emp_id) {\n return redirect('/dashboard')->with([\n 'success' => 'You are not authorized to view this page!'\n ]);\n }\n }\n return view('edit.edit-result_history')->with([\n 'employee_id' => $emp_id,\n 'employee' => $employees\n ]);\n }", "public function store(Request $request, Employee $employee)\n {\n $input = Input::all();\n\t$input['employee_id'] = $employee->id;\n\n\tEmpskill::create($input);\n\n\treturn Redirect::route('admin.employee.list.skills.index', $employee->id)->withFlashSuccess('Employee skill was successfully created.');\n }" ]
[ "0.72512496", "0.7188457", "0.6973452", "0.6914408", "0.69084024", "0.6899327", "0.6882726", "0.68605936", "0.68451166", "0.67640877", "0.67030746", "0.66066146", "0.65935266", "0.654297", "0.65407604", "0.65288746", "0.6522167", "0.6519799", "0.6487992", "0.6448178", "0.64479154", "0.64395404", "0.64364696", "0.641521", "0.63863367", "0.6384752", "0.63769186", "0.6376415", "0.63740903", "0.6365189", "0.6325916", "0.63239574", "0.6305656", "0.6297176", "0.6296299", "0.6268871", "0.6262043", "0.6259728", "0.6230966", "0.6230821", "0.62068266", "0.62017745", "0.6199741", "0.6196916", "0.6195881", "0.6181033", "0.61775887", "0.61688006", "0.616166", "0.61574185", "0.61504006", "0.6144943", "0.61418706", "0.6141399", "0.61330086", "0.6072309", "0.6063481", "0.6053609", "0.60376394", "0.60244626", "0.6021267", "0.6018471", "0.6015176", "0.60135293", "0.6002077", "0.6002077", "0.6002077", "0.6002077", "0.6002077", "0.6002077", "0.60019314", "0.59957576", "0.5987134", "0.5984172", "0.59824485", "0.59794366", "0.5975868", "0.5975709", "0.5968867", "0.59652096", "0.5959597", "0.59587234", "0.5958392", "0.59574854", "0.59507287", "0.5948948", "0.5944629", "0.5943001", "0.5936915", "0.59327704", "0.5931315", "0.5929496", "0.5926668", "0.59207577", "0.59174603", "0.5913981", "0.5909741", "0.59059", "0.59018385", "0.5901245", "0.5900307" ]
0.0
-1
/ Check whether the table exists and, if not, create it.
function verifyTable($connection) { if(!tableExists($connection)) { $query = "CREATE TABLE `".TABLE_NAME."` ( `id` int(11) not null auto_increment, `title` varchar(255) not null, `url` varchar(511) not null, primary key (`id`));"; if(!mysqli_query($connection, $query)) echo("<p>Error creating table.</p>"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function ensureTableExists() {\n try {\n $database_schema = $this->connection->schema();\n $schema_definition = $this->schemaDefinition();\n $database_schema->createTable(static::TABLE_NAME, $schema_definition);\n }\n // If another process has already created the batch table, attempting to\n // recreate it will throw an exception. In this case just catch the\n // exception and do nothing.\n catch (DatabaseException $e) {\n }\n catch (\\Exception $e) {\n return FALSE;\n }\n return TRUE;\n }", "public function ensureTableExists()\n {\n $_tableName = DB_PREFIX . \"wr360product\";\n $sqlCreateTable = <<<SQL\nCREATE TABLE IF NOT EXISTS `$_tableName` (\n `product_id` INT NOT NULL ,\n `root_path` VARCHAR(255) NULL DEFAULT NULL ,\n `config_file_url` VARCHAR(255) NULL DEFAULT NULL ,\n `wr360_enabled` TINYINT(1) NOT NULL DEFAULT '1' ,\n PRIMARY KEY (`product_id`) )\nENGINE = MyISAM\nDEFAULT CHARACTER SET = utf8;\nSQL;\n\n $this->db->query($sqlCreateTable);\n }", "private function checkOrCreateTable(){\n $this->pdo->query(\"CREATE TABLE IF NOT EXISTS k_UserDean(wp_id BIGINT UNSIGNED PRIMARY KEY, dean_id BIGINT UNSIGNED);\");\n }", "public function table_check() {\n\t // check if tables exist then create if not\n\t global $wpdb;\n\t \n\t $required_tables = array (\n\t \"$wpdb->prefix\" . \"tr_ratting_data\",\n\t \"$wpdb->prefix\" . \"tr_characters\",\n\t \"$wpdb->prefix\" . \"tr_structures_income\",\n\t \"$wpdb->prefix\" . \"tr_pvp_chars_kills\",\n\t \"$wpdb->prefix\" . \"tr_users_chars\",\n\t )\n\t \n\t ;\n\t foreach ( $required_tables as $table ) {\n\t $val = $wpdb->get_var ( \"SHOW TABLES LIKE '$table'\" );\n\t if ($val == $table) {\n\t // exists//\n\t } else {\n\t // create non existing\n\t $this->create_table ( $table );\n\t }\n\t }\n\t}", "public function ensureExists() {\n\t\t$sql = <<<SQL\nCREATE TABLE IF NOT EXISTS $this->tableName (\n id int(10) NOT NULL AUTO_INCREMENT,\n title varchar(300) NOT NULL UNIQUE,\n year int(4) NOT NULL,\n rating int(2),\n PRIMARY KEY (id));\n\n insert into $this->tableName(title, year, rating)\n values(\"The Maltese Falcon\", 1941, 10),\n (\"Felis Noir\", 2016, 8)\nSQL;\n\n\t\t$this->site->pdo()->query($sql);\n\t}", "public static function create_missing_table( $table_name ) {\n\n\t\tif ( self::table_exists( $table_name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::create_table( $table_name );\n\t}", "public function create_table($table_name)\n {\n \t/*\n\t * if($this->table_exists($table_name)) return false;\n\t * if (mysqli_query($this->mysql, \"CREATE DATABASE $table_name;\"));\n\t */\n\t return true;\n }", "function VerifyEmployeesTable($connection, $dbName) {\n if(!TableExists(\"employee\", $connection, $dbName)) \n { \n $query = \"CREATE TABLE `employee` (\n `ID` int(11) NOT NULL AUTO_INCREMENT,\n `Name` varchar(45) DEFAULT NULL,\n `Address` varchar(90) DEFAULT NULL,\n PRIMARY KEY (`ID`),\n UNIQUE KEY `ID_UNIQUE` (`ID`)\n ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1\";\n\n if(!mysqli_query($connection, $query)) echo(\"<p>Error creating table.</p>\");\n }\n}", "public function testTableIsCreated()\n {\n $this->assertFalse($this->connection->tableExists('insight_accounts'));\n $this->insight->getTableName('accounts');\n $this->assertTrue($this->connection->tableExists('insight_accounts'));\n }", "private function createIfNotExists()\n {\n $table = new Table('schema_migration');\n if ($this->info->isTableExists($table)) {\n return;\n }\n $primaryKey = new PrimaryKey(array('version'));\n $primaryKey->disableAutoIncrement();\n\n $table->addConstraint($primaryKey);\n $table\n ->addColumn(new BigIntegerColumn('version'))\n ->addColumn(new DateTimeColumn('created_at', array('nullable' => false, 'default' => 'now()')));\n $this->manipulation->create($table);\n }", "function CreateTable($tableName, $tableDefinition)\n{\n $stmt = SQL_CREATE_TABLE . \" IF NOT EXISTS $tableName ($tableDefinition);\";\n return mysql_query($stmt);\n}", "public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}", "function ensureUsersTable(){\n if($this->connection){\n // create table if it doesn't exist.\n $table = $this->getTableConstant();\n $query_createTable = \"CREATE TABLE IF NOT EXISTS $table (\n `id` INT(5) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n `user` VARCHAR(20) NOT NULL,\n `password` VARCHAR(200) NOT NULL\n )\";\n // prepare the statement\n $statement = $this->connection->prepare($query_createTable);\n // execute the query\n $statement->execute();\n }\n }", "public function testCheckTableExist() {\n\n\t}", "function testTableExist()\n{\n\tglobal $db,$conf,$langs;\n\t\n\t$checktable = $db->query(\"SHOW TABLES LIKE '\".MAIN_DB_PREFIX.\"materiels'\");\n\tif (($checktable)&&($db->num_rows($checktable)<=0))\n\t{\n\t\t$db->query(\"CREATE TABLE \".MAIN_DB_PREFIX.\"materiels (rowid INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,ref VARCHAR(50) NOT NULL,socid INT(6),marque VARCHAR(50),model VARCHAR(50),noserie VARCHAR(50),options TEXT,note_public TEXT,date_achat DATE,garantie INT(1))\");\n\t}\n}", "private function createNewTable() {\n //generate the create table statement\n $sql = \"create table $this->tableName(\";\n $comma = \"\";\n $keyNameList = [];\n foreach ($this->columns as $column /* @var $column DbColumn */) {\n $sql .= \" $comma $column->columnName $column->dataType $column->extraStuff\";\n $comma = \",\";\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n //generate the primary key list, if any are present\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \",$primaryKeySql)\";\n }\n\n //constraints\n $cSql = \"\";\n //we are assuming that there is at least one table. otherwise, the query would fail anyway.\n $comma = \",\";\n foreach ($this->constraints as $c) {\n $cSql .= \" $comma\";\n switch ($c->constraintType) {\n case \"foreign key\":\n $cSql .= \" FOREIGN KEY($c->columnName) REFERENCES $c->referencesTableName($c->referencesColumnName)\";\n break;\n }\n }\n $sql = \"$sql $primaryKeySql $cSql)\";\n return DbManager::nonQuery($sql);\n }", "function tableExists($tablename);", "function checkIfDatabaseIsCreated(){\n\tglobal $connect;\n\t$query1 = \"create table if not exists Register(id INT AUTO_INCREMENT PRIMARY KEY,firstname VARCHAR(20),lastname VARCHAR(20),email VARCHAR(30),password VARCHAR(20));\";\n\tmysqli_query($connect, $query1) or die (mysqli_error($connect));\n}", "private function createDBTables(){\n\t\tif (!$this['db']->getSchemaManager()->tablesExist('bookings')){\n\t\t\t$this['db']->executeQuery(\"CREATE TABLE bookings (\n\t\t\t\tid INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tfirstName VARCHAR(40) NOT NULL,\n\t\t\t\tlastName VARCHAR(40) NOT NULL,\n\t\t\t\tphone VARCHAR(10) NOT NULL,\n\t\t\t\temail VARCHAR(20) DEFAULT NULL,\n\t\t\t\tbirthday DATE NOT NULL,\n\t\t\t\tstartDate DATE NOT NULL,\n\t\t\t\tendDate DATE NOT NULL,\n\t\t\t\tarrivalTime TIME DEFAULT NULL,\n\t\t\t\tadditionalInformation TEXT,\n\t\t\t\tnrOfPeople INT NOT NULL,\n\t\t\t\tpayingMethod VARCHAR(10) NOT NULL\n\t\t\t\t);\");\n\t\t}\n\t}", "public function create_missing_tables() {\n\n\t\t/* Create the network snippets table if it doesn't exist */\n\t\tif ( is_multisite() && ! self::table_exists( $this->ms_table ) ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t/* Create the table if it doesn't exist */\n\t\tif ( ! self::table_exists( $this->table ) ) {\n\t\t\t$this->create_table( $this->table );\n\t\t}\n\t}", "public function tableExists()\n {\n /**\n * Here we check to see if a table with that name already exists.\n */\n $mysqli = $this->getMysqli();\n $SQL = \"SHOW TABLES LIKE '\".$this->vars['db']['table'].\"'\";\n // echo $SQL;\n if (!$result = $mysqli->query($SQL)) {\n echo $mysqli->error;\n exit();\n }\n return !($result->num_rows == 0);\n }", "function tableExists($table);", "function maybe_create_table($table_name, $create_ddl)\n {\n }", "function check_db(){\n if( ! $this->database_exists() ){\n $this->create_table();\n }\n }", "public function tableExists( $tablename );", "private function _createTables()\r\n {\r\n return true;\r\n }", "function createTable() {\n print \"\\nCreate table: \".$dbtable.\"\\n\";\n if (createDB()) {\n print \"OK\\n\";\n }\n interceptExit();\n }", "public function checkIfTablesExist()\n {\n foreach (self::DB_TABLE_INFO as $tableName => $createSql) {\n try {\n $result = $this->connection->query('SELECT 1 FROM turns LIMIT 1');\n } catch (Exception $e) {\n $result = false;\n }\n\n if ($result === false) {\n $this->connection->exec($createSql);\n }\n }\n }", "function createTable ($name, $query)\n\t{\n\t\tqueryMysql(\"CREATE TABLE IF NOT EXISTS $name($query)\");\n\t\techo \"Table $name created or already exists.<br>\";\n\t}", "public function createTable()\n\t{\n\t\tphpCAS::traceBegin();\n\n\t\t// initialize the PDO object for this method\n\t\t$pdo = $this->getPdo();\n\t\t$this->setErrorMode();\n\n\t\ttry {\n\t\t\t$pdo->beginTransaction();\n\n\t\t\t$query = $pdo->query($this->_createTableSQL());\n\t\t\t$query->closeCursor();\n\n\t\t\t$pdo->commit();\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\t// attempt rolling back the transaction before throwing a phpCAS error\n\t\t\ttry {\n\t\t\t\t$pdo->rollBack();\n\t\t\t}\n\t\t\tcatch(PDOException $e) {}\n\t\t\tphpCAS::error('error creating PGT storage table: ' . $e->getMessage());\n\t\t}\n\n\t\t// reset the PDO object\n\t\t$this->resetErrorMode();\n\n\t\tphpCAS::traceEnd();\n\t}", "public function createTable() {\n global $database;\n $SQL = \"CREATE TABLE IF NOT EXISTS `\".self::getTableName().\"` ( \".\n \"`lang_id` INT(11) NOT NULL AUTO_INCREMENT, \".\n \"`lang_iso` VARCHAR(2) NOT NULL DEFAULT 'nn', \".\n \"`lang_local` VARCHAR(64) NOT NULL DEFAULT '-undefined-', \".\n \"`lang_english` VARCHAR(64) NOT NULL DEFAULT '-undefined-', \".\n \"PRIMARY KEY (`lang_id`), KEY (`lang_iso`, `lang_english`)\".\n \" ) ENGINE=MyIsam AUTO_INCREMENT=1 DEFAULT CHARSET utf8 COLLATE utf8_general_ci\";\n if (null == $database->query($SQL)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $database->get_error()));\n return false;\n }\n return true;\n }", "function tableExists($db, $table = 'settings') {\n try {\n $result = $db->query(\"SELECT 1 FROM $table LIMIT 1\"); \n } catch (Exception $e) {\n return false;\n }\n return $result == true;\n }", "function table_creation($conn, $dbname, $table)\n{\n connection($conn);\n $query = \"CREATE DATABASE IF NOT EXISTS $dbname\";\n if (mysqli_query($conn, $query)) {\n echo \"Success creating database $dbname.\\n\";\n } else {\n echo \"Failure creating database $dbname.\\n\";\n }\n\n $db_selected = mysqli_select_db($conn, $dbname);\n if (!$db_selected) {\n die('Cannot use the selected database');\n }\n $sql = \"CREATE TABLE IF NOT EXISTS $table (\n name VARCHAR(30) NOT NULL,\n surname VARCHAR(30) NOT NULL,\n email VARCHAR(50) NOT NULL,\n UNIQUE (email)\n )\";\n\n\n if (mysqli_query($conn, $sql)) {\n echo \"Table $table created successfully.\\n\";\n } else {\n echo \"Error: \" . mysqli_error($conn) . \"\\n\";\n }\n}", "public function createTable() {\n global $database;\n $SQL = \"CREATE TABLE IF NOT EXISTS `\".self::getTableName().\"` ( \".\n \"`src_id` INT(11) NOT NULL AUTO_INCREMENT, \".\n \"`i18n_id` INT(11) NOT NULL DEFAULT '-1', \".\n \"`src_file` VARCHAR(64) NOT NULL DEFAULT '', \".\n \"`src_path` TEXT, \".\n \"`src_module` VARCHAR(64) NOT NULL DEFAULT '', \".\n \"`src_line` INT(11) NOT NULL DEFAULT '-1', \".\n \"`src_status` ENUM('ACTIVE','BACKUP') NOT NULL DEFAULT 'ACTIVE', \".\n \"`src_timestamp` TIMESTAMP, \".\n \"PRIMARY KEY (`src_id`), KEY (`i18n_id`, `src_module`)\".\n \" ) ENGINE=MyIsam AUTO_INCREMENT=1 DEFAULT CHARSET utf8 COLLATE utf8_general_ci\";\n if (null == $database->query($SQL)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $database->get_error()));\n return false;\n }\n return true;\n }", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "function checkTableExists($table_name) {\n $sql = sprintf(\"SELECT count(*) FROM sqlite_master WHERE type='table' AND name='%s'\", $table_name);\n\n $ret = $this->query($sql);\n // echo \"<br>\";\n // echo print_r($ret, $return=true);\n // echo \"<br>\";\n if ($ret) {\n $ary = $ret->fetchArray(SQLITE3_NUM);\n if ($ary[0] > 0) {\n return True;\n } else {\n return False;\n }\n }\n }", "public function createTable() {\n global $database;\n $SQL = \"CREATE TABLE IF NOT EXISTS `\".self::getTableName().\"` ( \".\n \"`i18n_id` INT(11) NOT NULL AUTO_INCREMENT, \".\n \"`i18n_key` TEXT, \".\n \"`i18n_description` TEXT, \".\n \"`i18n_status` ENUM('ACTIVE','BACKUP','IGNORE') NOT NULL DEFAULT 'ACTIVE', \".\n \"`i18n_last_sync` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', \".\n \"`i18n_timestamp` TIMESTAMP, \".\"PRIMARY KEY (`i18n_id`)\".\n \" ) ENGINE=MyIsam AUTO_INCREMENT=1 DEFAULT CHARSET utf8 COLLATE utf8_general_ci\";\n if (null == $database->query($SQL)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $database->get_error()));\n return false;\n }\n return true;\n }", "private function tableExist($name)\n {\n if(!Schema::hasTable($name))\n throw new \\Exception('Table not found.');\n }", "function createTable(){\n \n $conn = $this->connect();\n \n $sql = 'CREATE TABLE IF NOT EXISTS ' . $this->dbtable . \n\t\t\t\t\t'( codigo INTEGER NOT NULL AUTO_INCREMENT, email VARCHAR(100), CONSTRAINT pk_' . $this->dbtable . \n\t\t\t\t\t' PRIMARY KEY (codigo)) ENGINE=INNODB CHARSET=utf8';\n $ret = mysql_query( $sql, $conn);\n mysql_close( $conn );\n\t\t\treturn $ret;\n }", "function createTable($name, $query)\n{\nqueryMysql(\"CREATE TABLE IF NOT EXISTS $name($query)\");\necho \"Table '$name' created or already exists.<br>\";\n}", "public function createTable() {\n global $database;\n $SQL = \"CREATE TABLE IF NOT EXISTS `\".self::getTableName().\"` ( \".\n \"`trans_id` INT(11) NOT NULL AUTO_INCREMENT, \".\n \"`i18n_id` INT(11) NOT NULL DEFAULT '-1', \".\n \"`trans_language` VARCHAR(2) NOT NULL DEFAULT 'EN', \".\n \"`trans_translation` TEXT, \".\n \"`trans_usage` ENUM('TEXT','MESSAGE','ERROR','HINT','LABEL','BUTTON') NOT NULL DEFAULT 'TEXT', \".\n \"`trans_type` ENUM('REGULAR','CUSTOM') NOT NULL DEFAULT 'REGULAR', \".\n \"`trans_status` ENUM('ACTIVE','BACKUP') NOT NULL DEFAULT 'ACTIVE', \".\n \"`trans_author` VARCHAR(64) NOT NULL DEFAULT '- unknown -', \".\n \"`trans_quality` FLOAT NOT NULL DEFAULT '0', \".\n \"`trans_is_empty` TINYINT NOT NULL DEFAULT '0', \".\n \"`trans_timestamp` TIMESTAMP, \".\"PRIMARY KEY (`trans_id`), KEY (`i18n_id`, `trans_language`)\".\n \" ) ENGINE=MyIsam AUTO_INCREMENT=1 DEFAULT CHARSET utf8 COLLATE utf8_general_ci\";\n if (null == $database->query($SQL)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $database->get_error()));\n return false;\n }\n return true;\n }", "public function createTableIfNotExists(): Closure\n {\n return function (string $table_name, $callback) {\n if (!Schema::hasTable($table_name)) {\n Schema::create($table_name, $callback);\n }\n };\n }", "function checkTableExists($tableName)\n{\n $mdb2 =& GetMDB2();\n $SQL = \"SELECT count(*) FROM `$tableName` WHERE 1 = 0\";\n $res = $mdb2->queryOne($SQL);\n $err = mdb2ErrorCheck($res, false, false, -18);\n switch($err['code']){\n case 0:\n return true;\n break;\n case -18:\n return false;\n break;\n default:\n mdb2ErrorCheck($res);\n die(\"Error when checking table $tableName.\\n\");\n }\n}", "protected function ensureTableExists()\n {\n $adapter = $this->getAdapter();\n $sql = \"CREATE TABLE IF NOT EXISTS `\".self::VERSION_TABLE.\"` (\n `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,\n `version` BIGINT UNSIGNED NOT NULL,\n `applied` TIMESTAMP NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin\";\n $adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\n return $this;\n }", "function Ensuretable()\n {\n $result = mysqli_query(\"SHOW COLUMNS FROM $this->tablename\"); \n if(!$result || mysqli_num_rows($result) <= 0)\n {\n return $this->CreateTable();\n }\n return true;\n }", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}", "public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}", "public function createTable( $table ) {\n\t\t$rawTable = $this->safeTable($table,true);\n\t\t$table = $this->safeTable($table);\n\n\t\t$sql = ' CREATE TABLE '.$table.' (\n \"id\" integer AUTO_INCREMENT,\n\t\t\t\t\t CONSTRAINT \"pk_'.$rawTable.'_id\" PRIMARY KEY(\"id\")\n\t\t )';\n\t\t$this->adapter->exec( $sql );\n\t}", "public function tableExists($table) {\n if (array_key_exists($table, $this->schema) && is_writable($this->directories['data']['core']['dir'].$table)) {\n return true;\n }\n else return false;\n }", "public function createTable( $table ) {\n\t\t$idfield = $this->getIDfield($table, true);\n\t\t$table = $this->safeTable($table);\n\t\t$sql = \"\n CREATE TABLE $table ( $idfield INTEGER PRIMARY KEY AUTOINCREMENT )\n\t\t\t\t \";\n\t\t$this->adapter->exec( $sql );\n\t}", "abstract public function tableExists($tableName);", "public function createTable(string $table_name): bool\n {\n if (!$this->tableExists($table_name)) {\n $this->data[$table_name] = [];\n\n return true;\n }\n\n return false;\n }", "private function tableExist($name)\n {\n if (!Schema::hasTable($name))\n throw new TableDiffException(\"Table '$name' not found\");\n }", "private function checkTable()\n\t{\n\t\t$erreur = array();\n\t\tinclude (dirname(__FILE__).'/sql/sql-install.php');\n\t\t// the array is called $sql;\n\n\t\tforeach ($sql as $key => $s)\n\t\t{\n\t\t\t// We check if the table allready exist\n\t\t\t$table_exist_sql = 'SHOW TABLES LIKE \\''._DB_PREFIX_.$key.'\\';';\n\t\t\tif (!Db::getInstance()->executeS($table_exist_sql))\n\t\t\t{\n\t\t\t\t//If the table not exist we install it\n\t\t\t\tDb::getInstance()->execute($s);\n\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t$erreur[] = $erreur_sql;\n\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t// If the table exist we verify the structure\n\t\t\t\tpreg_match_all('/`(\\w+)`/mi', $s, $matches); // We catch all the columns name of the table\n\t\t\t\t$final_columns = array_unique($matches[1]); // We erase the duplicate entry\n\t\t\t\t// We search in the array an entry who could be the name of the table\n\t\t\t\t$key_to_unset = array_search(_DB_PREFIX_.$key,$final_columns);\n\t\t\t\tif ($key_to_unset !== FALSE)\n\t\t\t\t\tunset($final_columns[(int)$key_to_unset]); // We unset it\n\t\t\t\t$final_columns = array_values($final_columns);\n\n\t\t\t\t$describe_sql = 'DESCRIBE '._DB_PREFIX_.$key;\n\t\t\t\t$existing_columns = Db::getInstance()->executeS($describe_sql);\n\t\t\t\t$existing_columns = array_column($existing_columns, 'Field');\n\t\t\t\t$nfinal_columns = count($final_columns);\n\t\t\t\tfor ($i = 0; $i < $nfinal_columns; $i++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($final_columns[$i],$existing_columns)) // If we don't find the item in existing table, we create it\n\t\t\t\t\t{\n\t\t\t\t\t\t$pattern = '/`'.(string)$final_columns[$i].'`(.+),\\n/i';\n\t\t\t\t\t\tpreg_match($pattern, $s, $columns_spec);\n\t\t\t\t\t\t$sql_append_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` ADD `'.(string)$final_columns[$i].'` '.$columns_spec[1];\n\t\t\t\t\t\tDb::getInstance()->execute($sql_append_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We check if in the existing table is there columns that need to be removed\n\t\t\t\t$nexisting_columns = count($existing_columns);\n\t\t\t\tfor ($j = 0; $j < $nexisting_columns; $j++)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($existing_columns[$j],$final_columns)) // If an existing column is not in the futur table, we delete this field form the db\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_erase_fields = 'ALTER TABLE `'._DB_PREFIX_.$key.'` DROP `'.(string)$existing_columns[$j].'`';\n\t\t\t\t\t\tDb::getInstance()->execute($sql_erase_fields);\n\t\t\t\t\t\t$erreur_sql = Db::getInstance()->getMsgError();\n\t\t\t\t\t\tif (!empty($erreur_sql))\n\t\t\t\t\t\t\t$erreur[] = $erreur_sql;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public function createSchemaTable();", "public function assertUserTableExists()\n {\n $this->assertTrue(Schema::hasTable('users'));\n }", "private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }", "public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n User::create_table();\n }", "protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }", "public function createTable()\n {\n $sql = \"\n CREATE TABLE IF NOT EXISTS `\".self::TABLE.\"`(\n `migration` VARCHAR(20) NOT NULL,\n `up` VARCHAR(1000) NOT NULL,\n `down` VARCHAR(1000) NOT NULL\n ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\n \";\n\n $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n }", "function VerifySurvivorsTable($connection, $dbName) {\n if(!TableExists(\"SURVIVORS\", $connection, $dbName))\n {\n $query = \"CREATE TABLE SURVIVORS(\n ID int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n NAME VARCHAR(45),\n ADDRESS VARCHAR(90),\n SSN VARCHAR(12),\n AGE VARCHAR(3),\n GENDER VARCHAR(4)\n )\";\n\n if(!mysqli_query($connection, $query)) echo(\"<p>Error creating table.</p>\");\n }\n}", "abstract public function createTable();", "public function testDBTablesExist() {\n\n $tables = array(\n 'pheno_plant',\n 'pheno_plantprop',\n 'pheno_scale_member',\n 'pheno_measurements',\n 'pheno_project_cvterm',\n 'pheno_plant_project',\n 'pheno_project_user',\n 'pheno_backup_file',\n );\n \n foreach($tables as $table) {\n $exists = db_table_exists($table);\n $this->assertTrue($exists, \"Checking that $table table exists.\");\n }\n\n }", "public function createTable()\n {\n $this->dbInstance->query(\"CREATE TABLE IF NOT EXISTS Image\n (\n ImageID int NOT NULL AUTO_INCREMENT,\n Name varchar(255) NOT NULL,\n File varchar(255) NOT NULL,\n Thumb varchar(255) NOT NULL,\n uploadDate DATETIME DEFAULT CURRENT_TIMESTAMP,\n UserFK int,\n PRIMARY KEY (ImageID),\n FOREIGN KEY (UserFK) REFERENCES User(UserID) ON DELETE CASCADE\n )\n \");\n }", "public static function tableExists() {\n self::init();\n return self::$wpdb->get_var(self::$wpdb->prepare(\"SHOW TABLES LIKE '%s'\", self::$table)) === self::$table;\n }", "private function createDBTable() {\n\t\tglobal $wpdb;\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '\" . $this->debug_table . \"'\" ) !== $this->debug_table ) {\n\t\t\t$sql = 'CREATE TABLE `' . $this->debug_table . '` (\n\t\t\t\t`id` INT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t`timestamp` TIMESTAMP NOT NULL,\n\t\t\t\t`blog` INT(9) NOT NULL,\n\t\t\t\t`message` text NOT NULL\n\t\t\t);';\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\tdbDelta( $sql );\n\t\t}\n\t}", "protected function createTables()\n {\n $sql = $this->create_table;\n $this->connection->query($sql);\n\n // create again in schema 2\n $sql = str_replace($this->table, \"{$this->schema2}.{$this->table}\", $sql);\n $this->connection->query($sql);\n }", "public function createUsersTable()\n {\n $query = \"CREATE TABLE IF NOT EXISTS users (\n id INT(4) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n firstname VARCHAR(30),\n lastname VARCHAR(30)\n )\";\n \n $this->execQuery($query);\n return true;\n }", "public function tableExists($tableName, $schemaName=null){ }", "protected function checkTable()\n\t{\n if (isset(Yii::$app->db->schema->db->tablePrefix))\n $this->table = Yii::$app->db->schema->db->tablePrefix.$this->table;\n \n\t\tif (Yii::$app->db->schema->getTableSchema($this->table, true) === null) {\n\t\t\tYii::$app->db->createCommand()\n ->createTable(\n $this->table,\n \t\t\t\tarray(\n \t\t\t\t\t'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY',\n \t\t\t\t\t'ip' => 'varchar(20) DEFAULT NULL',\n \t\t\t\t\t'time' => 'int(10) unsigned DEFAULT NULL',\n \t\t\t\t\t'rfc822' => 'varchar(50) DEFAULT NULL',\n \t\t\t\t\t'uri' => 'varchar(255) DEFAULT NULL',\n \t\t\t\t\t'get' => 'text',\n \t\t\t\t\t'post' => 'text',\n \t\t\t\t\t'cookies' => 'text',\n \t\t\t\t\t'session' => 'text',\n \t\t\t\t\t'method' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'scheme' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'protocol' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'port' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'browser' => 'text',\n \t\t\t\t\t'language' => 'text',\n \t\t\t\t),\n 'ENGINE=InnoDB DEFAULT CHARSET=utf8'\n )\n ->execute();\n\t\t\tYii::$app->db->createCommand()\n ->createIndex(\n 'idx_ip',\n $this->table,\n \t\t\t\t'ip',\n false\n )\n ->execute();\n\t\t\tYii::$app->db->createCommand()\n ->createIndex(\n 'idx_time',\n $this->table,\n \t\t\t\t'time',\n false\n )\n ->execute();\n\t\t\tYii::$app->db->createCommand()\n ->createIndex(\n 'idx_uri',\n $this->table,\n \t\t\t\t'uri',\n false\n )\n ->execute();\n\t\t}\n\t}", "public function compileTableExists()\n {\n return \"select * from sqlite_master where type = 'table' and name = ?\";\n }", "public function createTable($tableName)\n {\n $query=\"CREATE TABLE \".$tableName.\" ( `productID` INT NOT NULL AUTO_INCREMENT , `product_name` VARCHAR(255) NOT NULL , `product_description` TEXT NOT NULL , `product_quantity` INT NOT NULL , `product_price` INT NOT NULL , `product_color` VARCHAR(255) NOT NULL , `product_status` INT NOT NULL , `product_picture` TEXT NOT NULL , `post_status` INT NOT NULL , `categoryID` INT NOT NULL , `subCategoryID` INT NOT NULL , `ownerID` INT NOT NULL , `owner_type` INT NOT NULL , `itID` INT NOT NULL , `c_date` DATETIME NOT NULL , PRIMARY KEY (`productID`)) ENGINE = InnoDB;\";\n $validate=$this->db->query($query);\n return $validate?true:false;\n }", "private function check_db() {\n if (ee()->db->table_exists($this->table_name)) {\n return true;\n }\n return $this->make_db();\n }", "function lti_maybe_create_db() {\n\tglobal $wpdb;\n\n\tget_lti_hash(); // initialise the remote login hash\n\n\t$wpdb->ltitable = $wpdb->base_prefix . 'lti';\n\tif ( lti_site_admin() ) {\n\t\t$created = 0;\n\t\tif ( $wpdb->get_var(\"SHOW TABLES LIKE '{$wpdb->ltitable}'\") != $wpdb->ltitable ) {\n\t\t\t$wpdb->query( \"CREATE TABLE IF NOT EXISTS `{$wpdb->ltitable}` (\n\t\t\t\t`id` bigint(20) NOT NULL auto_increment,\n\t\t\t\t`consumer_key` varchar(255) NOT NULL,\n\t\t\t\t`secret` varchar(255) NOT NULL,\n\t\t\t\t`active` tinyint(4) default '1',\n\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t);\" );\n\t\t\t$created = 1;\n\t\t}\n\t\tif ( $created ) {\n\t\t\t?> <div id=\"message\" class=\"updated fade\"><p><strong><?php _e( 'LTI database table created.', 'wordpress-mu-lti' ) ?></strong></p></div> <?php\n\t\t}\n\t}\n\n}", "public function create_table()\n {\n $sql = \"CREATE TABLE IF NOT EXISTS `whollycoders`.`table_contacts_171005_1207` (\n `contact_ID` INT NOT NULL AUTO_INCREMENT , \n `contact_firstname` VARCHAR(50) NOT NULL , \n `contact_lastname` VARCHAR(50) NOT NULL , \n `contact_phone` VARCHAR(20) NOT NULL , \n `contact_email` VARCHAR(100) NOT NULL , \n `contact_date_added` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP , \n PRIMARY KEY (`contact_ID`)\n ) ENGINE = InnoDB;\";\n $result = $this->process_query($sql);\n }", "function CreateTable()\n {\n $qry = \"Create Table $this->tablename (\".\n \"id_user INT NOT NULL AUTO_INCREMENT ,\".\n \"name VARCHAR( 128 ) NOT NULL ,\".\n \"email VARCHAR( 64 ) NOT NULL ,\".\n \"phone_number VARCHAR( 16 ) NOT NULL ,\".\n \"username VARCHAR( 16 ) NOT NULL ,\".\n \"password VARCHAR( 32 ) NOT NULL ,\".\n \"confirmcode VARCHAR(32) ,\".\n \"PRIMARY KEY ( id_user )\".\n \")\";\n \n if(!mysqli_query($this->connection, $qry))\n {\n $this->HandleDBError(\"Fout bij toevoegen van de data in de database \\nquery was\\n $qry\");\n return false;\n }\n return true;\n }", "function sql_table_exists($table) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\ttry {\n\t\t$result = $sql->query(sql_select($table, '1'));\n\t} catch (Exception $e) {\n\t\treturn FALSE;\n\t}\n\treturn $result !== FALSE;\n}", "function tableExists($tableName) {\n\t\t$siteDao =& DAORegistry::getDAO('SiteDAO');\n\t\t$dict = NewDataDictionary($siteDao->getDataSource());\n\n\t\t// Check whether the table exists.\n\t\t$tables = $dict->MetaTables('TABLES', false);\n\t\treturn in_array($tableName, $tables);\n\t}", "public function test_create_table()\n\t{\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\t\t\n\t\t$handler->run( \"DROP TABLE IF EXISTS people\" );\n\t\t\n\t\t$handler->run( \n\t\t\"CREATE TABLE people ( \n\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT, \n\t\t\tname VARCHAR, \n\t\t\tage INTEGER\n\t\t);\");\n\t}", "public function createTable()\n {\n $table = self::$table_name;\n $SQL = <<<EOD\n CREATE TABLE IF NOT EXISTS `$table` (\n `communication_usage_id` INT(11) NOT NULL AUTO_INCREMENT,\n `communication_usage_name` VARCHAR(32) NOT NULL DEFAULT '',\n `communication_usage_description` VARCHAR(255) NOT NULL DEFAULT '',\n PRIMARY KEY (`communication_usage_id`),\n UNIQUE (`communication_usage_name`)\n )\n COMMENT='The communication usage definition 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 'contact_communication_usage'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "protected function createLoadTables()\n {\n // foreach table, replace it with an empty table\n $tables = $this->schema->getTables();\n foreach ($tables as $table) {\n $this->dbcon->replaceTable($table);\n\n $msg = \"Created table '\".$table->name.\"'\";\n\n // If this table uses the Lookup table, create a view\n if ($table->usesLookup === true) {\n $this->dbcon->replaceLookupView($table, $this->schema->getLookupTable());\n $msg .= '; Lookup table created';\n }\n\n $this->log($msg);\n }\n return true;\n }", "private function createDummyTable() {}", "public static function maybe_create_table() {\n\t\tif ( ! function_exists( 'get_current_screen' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( get_current_screen()->id ) && false === strpos( get_current_screen()->id, 'page_smush' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::directory_smush_table();\n\t}", "function _createCacheTable(){\n\t\t$res = mysql_query(\"create table IF NOT EXISTS `\".addslashes($this->tableName).\"`(\n\t\t\t`GenID` INT(11) auto_increment,\n\t\t\t`PageID` VARCHAR(64),\n\t\t\t`Language` CHAR(2),\n\t\t\t`UserID` VARCHAR(32),\n\t\t\t`Dependencies` TEXT,\n\t\t\t`LastModified` TIMESTAMP,\n\t\t\t`Expires` DateTime,\n\t\t\t`Data` LONGTEXT,\n\t\t\t`Data_gz` LONGBLOB,\n\t\t\t`Headers` TEXT,\n\t\t\tPRIMARY KEY (`GenID`),\n\t\t\tINDEX `LookupIndex` (`Language`,`UserID`,`PageID`)\n\t\t\t)\", $this->app->db());\n\t\tif ( !$res ){\n\t\t\treturn PEAR::raiseError('Could not create cache table: '.mysql_error($this->app->db()));\n\t\t}\t\n\t\t\n\t}", "private static function checkIfTodoListTableExists()\n {\n $query = \"SELECT 1 FROM Todo_List\";\n $result = mysqli_query(Core_DbConnectionModel::getInstance(), $query);\n\n //this part allows you to do something if the result is false or just return $result, however, you should check for MySQL error just in-case.\n $tableExistStatus = ($result !== false) ? true : false;\n\n return $tableExistStatus;\n }", "private function _checkTXNTableExists() {\n $curTable = readSetting( $this->settings['DataFile'], 'txnTable' );\n $txnTable = $this->settings['txnTable'];\n $rVal = false;\n\n // If the Transaction Table is Not the Same as Expected, then Create It\n if ( $curTable != $txnTable ) {\n $sqlStr = $this->_readTXNTableDefinitions();\n if ( $sqlStr ) {\n $rslt = doSQLExecute( $sqlStr );\n }\n\n // Confirm the Table Exists, and Save the TXN Name if Appropriate\n if ( $this->_confirmTXNTables() ) {\n $rVal = saveSetting( $this->settings['DataFile'], 'txnTable', $txnTable );\n writeNote( \"Saved Transaction Table Record: \" . BoolYN($rVal) );\n }\n }\n\n // Return the Boolean Response\n return $rVal;\n }", "public function newTaxTableExists() {\n \n static $alreadyChecked = false;\n static $tableExists = false; // remember result of check if already done (prevents multiple checks per script execution)\n \n if ($alreadyChecked == false) {\n $tableExists = tx_pttools_div::dbTableExists($this->getTableName('BHSTEUER'), $this->gsaDbObj);\n $alreadyChecked = true;\n }\n \n return $tableExists; \n \n }", "function create_table($table_name, $field_name, $field_type, $field_length){\n // $sql_chk = db::query(\"SELECT COUNT(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='\".strtoupper(db::$_dbName).\"' AND TABLE_NAME = '\".$table_name.\"'\");\n // $rec_chk = db::fetch_array($sql_chk);\n // if($rec_chk['TOTAL'] > 0)\n // {\n // echo \"<script>alert('ตาราง \".$table_name.\" ถูกใช้งานแล้ว กรุณาตรวจสอบ'); window.location.href='\".$_SERVER['HTTP_REFERER'].\"';</script>\";\n // db::db_close();\n // exit;\n // }\n\n $field_length = $field_length == \"\" ? \"\" : \"(\".$field_length.\")\";\n\n $sql_create = \" CREATE TABLE [dbo].[\".$table_name.\"]([\".$field_name.\"] \".$field_type.\" \".$field_length.\" NOT NULL, PRIMARY KEY ([\".$field_name.\"]))\";\n\n }", "abstract public function create_table($table_name, $fields, $primary_key = TRUE);", "public function create($if_not_exists = false) {\n $db = DB::getInstance();\n\n $query = [];\n $query[] = 'CREATE TABLE';\n if ($if_not_exists) {\n $query[] = 'IF NOT EXISTS';\n }\n $query[] = $db->quoteIdentifier($this->prefix . $this->name);\n\n $fields = [];\n foreach ($this->fields as $item) {\n $fields[] = ' ' . $item;\n }\n foreach ($this->keys as $item) {\n $fields[] = ' ' . $item;\n }\n\n $query[] = \"(\\n\" . implode(\",\\n\", $fields) . \"\\n)\";\n\n return implode(' ', $query);\n }", "public function tableExists(string $tableName): bool;", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection,\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection,\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "public static function checkIfHasTable($table)\n\t {\n\t \t if(is_null($table))\n {\n exit('Table name is required!');\n }\n\t }", "public function createTable($table, $file){\n if ($result = $this->query(\"SHOW TABLES LIKE '\".$table.\"'\")) {\n if($result->num_rows == 1) {\n // echo \"Table exists. Skipping Creating table. Moving on to insertion\";\n return true;\n }\n }\n\n $file = fopen($file,'r');\n $column = fgetcsv($file);\n for($i=0;$i<sizeof($column);$i++){\n $this->columnName = implode(\" varchar(20),\",$column);\n }\n $createTable = \"CREATE TABLE \".$table.\"(id INT(11) NOT NULL AUTO_INCREMENT ,\".$this->columnName.\" varchar(20), PRIMARY KEY (`id`))\";\n echo $createTable;\n if($this->query($createTable)){\n // echo \"Created \";\n return true;\n } else {\n // echo \"Not Created\".$this->error;\n return false;\n }\n }", "function table_exists()\r\n{\r\n\t$tables = $this->_db->getTableList();\r\n\t$table = self::replaceDbPrefix('#__flexicontact_log');\r\n\tif (self::in_arrayi($table,$tables))\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection, \n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "function TableExists($tableName, $connection, $dbName) {\r\n $t = mysqli_real_escape_string($connection, $tableName);\r\n $d = mysqli_real_escape_string($connection, $dbName);\r\n\r\n $checktable = mysqli_query($connection, \r\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\r\n\r\n if(mysqli_num_rows($checktable) > 0) return true;\r\n\r\n return false;\r\n}", "public function acfedu_check_table() {\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\tob_start();\n\t\t\t\tglobal $wpdb;\n\t\t\t\t?>\n\t\t\t\tCREATE TABLE <?php echo $wpdb->prefix; ?>faculty (\n\t\t\t\t\tid int(6) unsigned NOT NULL auto_increment,\n\t\t\t\t\tfaculty_name varchar(50) NULL,\n\t\t\t\t\tuniv_code varchar(10) NULL,\n\t\t\t\t\tuniv_name varchar(50) NULL,\n\t\t\t\t\tcountry_code varchar(2) NULL,\n\t\t\t\t\tcountry varchar(50) NULL,\n\t\t\t\t\tprice decimal(10) NULL,\n\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t)\n COLLATE <?php echo $wpdb->collate; ?>;\n\t\t\t\t<?php\n\t\t\t\t$sql = ob_get_clean();\n\t\t\t\tdbDelta( $sql );\n\n\t\t\t}", "function createTableToTemplates(){\n\n\tglobal $mysqli,$templatesTableName;\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$templatesTableName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `clienteName` varchar(100) NOT NULL,\n\t `method` text NOT NULL,\n\t `created` TIMESTAMP,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1\";\t\n\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\treturn true;\n}" ]
[ "0.82859814", "0.82326454", "0.7863021", "0.76533073", "0.75855774", "0.7497424", "0.7436059", "0.74158704", "0.7415295", "0.7393919", "0.73633426", "0.73388255", "0.73050445", "0.730502", "0.72423613", "0.717199", "0.7151869", "0.7089884", "0.7087377", "0.7082934", "0.7075343", "0.70598686", "0.70516235", "0.7043072", "0.6972037", "0.6959682", "0.69415146", "0.6922288", "0.6916756", "0.6897037", "0.68805593", "0.68697894", "0.6867722", "0.6850581", "0.68493664", "0.68395275", "0.6808694", "0.67587686", "0.67584866", "0.67544466", "0.6732771", "0.67221403", "0.67204815", "0.6711672", "0.67033094", "0.669558", "0.66819715", "0.6672685", "0.6672295", "0.6654187", "0.6653941", "0.6646001", "0.6633079", "0.66220236", "0.6616647", "0.66166115", "0.66025937", "0.6572903", "0.6567152", "0.65556544", "0.65323395", "0.6522845", "0.6507709", "0.65018874", "0.6494138", "0.6492619", "0.64867026", "0.6480465", "0.64794415", "0.6479211", "0.6470438", "0.6467352", "0.6459861", "0.6458394", "0.64549166", "0.64462763", "0.6440595", "0.64392877", "0.6438837", "0.6433819", "0.6432111", "0.6424691", "0.6413826", "0.6408026", "0.6407395", "0.640175", "0.6400554", "0.63984627", "0.6398275", "0.63980263", "0.63934153", "0.6391018", "0.6391018", "0.638859", "0.63815826", "0.63694185", "0.6361617", "0.63540643", "0.6353518", "0.63491625" ]
0.6996112
24
/ Check for the existence of a table.
function tableExists($connection) { $t = mysqli_real_escape_string($connection, TABLE_NAME); $d = mysqli_real_escape_string($connection, DB_DATABASE); $checktable = mysqli_query($connection, "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'"); if(mysqli_num_rows($checktable) > 0) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tableExists($table);", "function tableExists($tablename);", "function tableExists($db, $table = 'settings') {\n try {\n $result = $db->query(\"SELECT 1 FROM $table LIMIT 1\"); \n } catch (Exception $e) {\n return false;\n }\n return $result == true;\n }", "public function tableExists( $tablename );", "function checkTableExists($table_name) {\n $sql = sprintf(\"SELECT count(*) FROM sqlite_master WHERE type='table' AND name='%s'\", $table_name);\n\n $ret = $this->query($sql);\n // echo \"<br>\";\n // echo print_r($ret, $return=true);\n // echo \"<br>\";\n if ($ret) {\n $ary = $ret->fetchArray(SQLITE3_NUM);\n if ($ary[0] > 0) {\n return True;\n } else {\n return False;\n }\n }\n }", "public function tableExists()\n {\n /**\n * Here we check to see if a table with that name already exists.\n */\n $mysqli = $this->getMysqli();\n $SQL = \"SHOW TABLES LIKE '\".$this->vars['db']['table'].\"'\";\n // echo $SQL;\n if (!$result = $mysqli->query($SQL)) {\n echo $mysqli->error;\n exit();\n }\n return !($result->num_rows == 0);\n }", "function tableExists($table){\n global $db;\n $table_exit = $db->query('SHOW TABLES FROM '.DB_NAME.' LIKE \"'.$db->escape($table).'\"');\n if($table_exit) {\n if($db->num_rows($table_exit) > 0)\n return true;\n else\n return false;\n }\n }", "public function testCheckTableExist() {\n\n\t}", "public function table_check() {\n\t // check if tables exist then create if not\n\t global $wpdb;\n\t \n\t $required_tables = array (\n\t \"$wpdb->prefix\" . \"tr_ratting_data\",\n\t \"$wpdb->prefix\" . \"tr_characters\",\n\t \"$wpdb->prefix\" . \"tr_structures_income\",\n\t \"$wpdb->prefix\" . \"tr_pvp_chars_kills\",\n\t \"$wpdb->prefix\" . \"tr_users_chars\",\n\t )\n\t \n\t ;\n\t foreach ( $required_tables as $table ) {\n\t $val = $wpdb->get_var ( \"SHOW TABLES LIKE '$table'\" );\n\t if ($val == $table) {\n\t // exists//\n\t } else {\n\t // create non existing\n\t $this->create_table ( $table );\n\t }\n\t }\n\t}", "function tableExists($table){\n global $db;\n $table_exit = $db->query('SHOW TABLES FROM '.DB_NAME.' LIKE \"'.$db->escape($table).'\"');\n if($table_exit) {\n if($db->num_rows($table_exit) > 0)\n return TRUE;\n else\n return FALSE;\n }\n}", "public static function tableExists() {\n self::init();\n return self::$wpdb->get_var(self::$wpdb->prepare(\"SHOW TABLES LIKE '%s'\", self::$table)) === self::$table;\n }", "function sql_table_exists($table) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\ttry {\n\t\t$result = $sql->query(sql_select($table, '1'));\n\t} catch (Exception $e) {\n\t\treturn FALSE;\n\t}\n\treturn $result !== FALSE;\n}", "public function tableExists($table){\n $sql = \"show tables like '\".$this->prefix.$table.\"'\";\n $res = $this->getQuery($sql)->row();\n return $res != false;\n }", "function tableExists($table)\n\t{\n\t\t$this->connect('r');\n\t\tif (strpos($table, '.') !== false)\n\t\t{\n\t\t\tlist($dbname, $tablename) = explode(\".\", $table);\n\t\t\t$id = $this->_query(\"SHOW TABLES FROM `\". $dbname .\"` LIKE '\". $tablename .\"'\", true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$id = $this->_query(\"SHOW TABLES LIKE '\" .$table .\"'\", true);\n\t\t}\n\t\t\t\n\t\t$result = @mysqli_num_rows($id) > 0;\n\t\tatkdebug(\"Table exists? $table => \".($result ? 'yes' : 'no'));\n\t\treturn $result;\n\t}", "function tep_db_table_exists($table, $link = 'db_link') {\n $result = tep_db_query(\"show table status from `\" . DB_DATABASE . \"`\");\n while ($list_tables = tep_db_fetch_array($result)) {\n if ($list_tables['Name'] == $table) {\n return true;\n }\n }\n return false;\n }", "public static function checkIfHasTable($table)\n\t {\n\t \t if(is_null($table))\n {\n exit('Table name is required!');\n }\n\t }", "protected function tableExists (Sql $db, string $table) : bool {\n return !empty($db->exec('SHOW TABLES LIKE :table', [':table' => $table]));\n }", "abstract public function tableExists($tableName);", "function tableExists($tableName) {\n\t\t$siteDao =& DAORegistry::getDAO('SiteDAO');\n\t\t$dict = NewDataDictionary($siteDao->getDataSource());\n\n\t\t// Check whether the table exists.\n\t\t$tables = $dict->MetaTables('TABLES', false);\n\t\treturn in_array($tableName, $tables);\n\t}", "public function tableExists(string $tableName): bool;", "private function tableExists($table){\n $tablesInDb = $this->myconn->query('SHOW TABLES FROM '.$this->db_name.' LIKE \"'.$table.'\"');\n if($tablesInDb){\n if($tablesInDb->num_rows == 1){\n return true;\n }else{\n array_push($this->result,$table.\" does not exist in this database\");\n return false;\n }\n }\n }", "public function checkIfTablesExist()\n {\n foreach (self::DB_TABLE_INFO as $tableName => $createSql) {\n try {\n $result = $this->connection->query('SELECT 1 FROM turns LIMIT 1');\n } catch (Exception $e) {\n $result = false;\n }\n\n if ($result === false) {\n $this->connection->exec($createSql);\n }\n }\n }", "private static function checkIfTodoListTableExists()\n {\n $query = \"SELECT 1 FROM Todo_List\";\n $result = mysqli_query(Core_DbConnectionModel::getInstance(), $query);\n\n //this part allows you to do something if the result is false or just return $result, however, you should check for MySQL error just in-case.\n $tableExistStatus = ($result !== false) ? true : false;\n\n return $tableExistStatus;\n }", "function tableExists($pdo, $table) {\n \n // Try a select statement against the table\n // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.\n try {\n $result = $pdo->query(\"SELECT 1 FROM $table LIMIT 1\");\n } catch (Exception $e) {\n // We got an exception == table not found\n return FALSE;\n }\n // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)\n return $result !== FALSE;\n \n }", "function table_exists()\r\n{\r\n\t$tables = $this->_db->getTableList();\r\n\t$table = self::replaceDbPrefix('#__flexicontact_log');\r\n\tif (self::in_arrayi($table,$tables))\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "public function tableExists($tableName) {\n $check = $this->con->query(\"SELECT 1 FROM $tableName\");\n if($check !== false && $check->num_rows > 0) {\n return true;\n } else {\n return false;\n }\n }", "function checkTableExists($tableName)\n{\n $mdb2 =& GetMDB2();\n $SQL = \"SELECT count(*) FROM `$tableName` WHERE 1 = 0\";\n $res = $mdb2->queryOne($SQL);\n $err = mdb2ErrorCheck($res, false, false, -18);\n switch($err['code']){\n case 0:\n return true;\n break;\n case -18:\n return false;\n break;\n default:\n mdb2ErrorCheck($res);\n die(\"Error when checking table $tableName.\\n\");\n }\n}", "public function _table_exists($dbname,$tablename){\n \t$table_files=$this->_table_files($dbname,$tablename);\n foreach ($table_files as $file){\n if (!file_exists($file))\n return FALSE;\n }\n return TRUE;\n }", "public function table_exists($table){\r\n\t\t$exists=0;\r\n\t\t$result = mysqli_query($this->conn,\"SHOW TABLES LIKE '$table'\");// or die ('error reading database while looking for a specific table');\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\tif (mysqli_num_rows($result)>0) $exists=1;\r\n\t\t}\r\n\t\t//return $exists;\r\n\t\treturn ($result && $exists>0);\r\n\r\n\t}", "public function tableExists( $table, $fname = __METHOD__ ) {\n\t\t$table = $this->tableName( $table );\n\t\t$old = $this->ignoreErrors( true );\n\t\t$res = $this->query( \"SELECT 1 FROM $table LIMIT 1\", $fname );\n\t\t$this->ignoreErrors( $old );\n\n\t\treturn (bool)$res;\n\t}", "function table_exists($table){\n\t\t$table = strtolower($table);\n\t\t$num = $this->fetch_one(\"select count(*) from information_schema.tables where table_schema = 'public' and table_name='$table'\");\n\t\treturn $num[0];\n\t}", "private function tableExists($table) {\n\t\t$tablesInDb = $this->myconn->query('SHOW TABLES FROM ' . $this->db_name . ' LIKE \"' . $table . '\"');\n\t\tif ($tablesInDb) {\n\t\t\tif ($tablesInDb->num_rows == 1) {\n\t\t\t\treturn true; // The table exists\n\t\t\t} else {\n\t\t\t\tarray_push($this->result, $table . \" does not exist in this database\");\n\t\t\t\treturn false; // The table does not exist\n\t\t\t}\n\t\t}\n\t}", "private function doTablesExist()\n {\n $query = \"SELECT COUNT(*) AS count FROM sqlite_master WHERE name IN ('games', 'events') AND type = 'table'\";\n $result = $this->oDB->getFirst($query);\n\n return $result['count'] == 2;\n }", "private function tableExists($tablename)\t{\n\t\t$query = \"show table status where Name=\\\"\".$tablename.\"\\\"\";\n if ($result = $this->db_conn->query($query))\t{\n return $result->num_rows > 0;\n\t\t}\n\t\telse\t{\n\t\t\tdie (\"Error sending the query '\".$query.\"' to MySQL: \".$this->db_conn->error.\"\\n\");\n\t\t}\n\t}", "public function tableExists($table) {\n\t\t$table = $this->tablePrefix . trim($table);\n\t\t$table = $this->quoteIdentifier($table);\n\t\t$schema = $this->getSchemaManager();\n\t\treturn $schema->tablesExist([$table]);\n\t}", "protected function table_exists($table) {\n\t\t$r = $this->query(\"SHOW TABLES LIKE '\" . $table . \"'\");\n\t\tif( $r->size() == 1 ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function sql_existTableName($tablename)\n {\n global $SQL_DBH;\n if (!$SQL_DBH) return FALSE;\n\n $drivername = $SQL_DBH->getAttribute(PDO::ATTR_DRIVER_NAME);\n $input_parameters = array(':name' => $tablename);\n if ($drivername == 'sqlite')\n {\n $sql = \"SELECT name FROM sqlite_master WHERE type='table' AND name = :name\";\n }\n else\n {\n // mysql\n $sql = 'SHOW TABLES LIKE :name ';\n }\n $res = array();\n $stmt = $SQL_DBH->prepare($sql);\n if ( $stmt && $stmt->execute($input_parameters) )\n $res = $stmt->fetch();\n if ($res && count($res)>0)\n return TRUE;\n return FALSE;\n }", "function testTableExist()\n{\n\tglobal $db,$conf,$langs;\n\t\n\t$checktable = $db->query(\"SHOW TABLES LIKE '\".MAIN_DB_PREFIX.\"materiels'\");\n\tif (($checktable)&&($db->num_rows($checktable)<=0))\n\t{\n\t\t$db->query(\"CREATE TABLE \".MAIN_DB_PREFIX.\"materiels (rowid INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,ref VARCHAR(50) NOT NULL,socid INT(6),marque VARCHAR(50),model VARCHAR(50),noserie VARCHAR(50),options TEXT,note_public TEXT,date_achat DATE,garantie INT(1))\");\n\t}\n}", "public static function tableExists($table)\n {\n $s = DBI::prepare('SELECT * FROM pg_tables WHERE tablename=:table');\n $s->execute(array(':table' => strtolower($table)));\n return (bool)$s->fetch();\n }", "function checkTableExist( $conn, $table_name )\n {\n return mysqli_query( $conn, 'select 1 from ' . $table_name );\n }", "function tableExists($link, $tableName)\n{\n $retval = false;\n $result = mysql_list_tables(DBNAME, $link);\n if ($result) \n {\n $max = mysql_num_rows($result);\n for ($i = 0; $i < $max ; $i++) \n {\n if (strcmp(mysql_tablename($result, $i), $tableName) == 0) \n {\n $retval = true;\n $break;\n }\n }\n }\n return $retval;\n}", "function table_exists($table){\n\t$table = mysql_escape_string($table);\n\t$query = \"SELECT * FROM $table\";\n\t$result = mysql_query($query);\n\treturn(mysql_errno() != 1146);\n}", "public function tableExists( $table )\n\t{\n\t\treturn $this->writer->tableExists( $table );\n\t}", "public function tableExists($table) {\n if (array_key_exists($table, $this->schema) && is_writable($this->directories['data']['core']['dir'].$table)) {\n return true;\n }\n else return false;\n }", "public function checkForTable( $table );", "function table_exists( $db, $the_table_name )\n{\n if (empty($the_table_name))\n return null;\n\n // NOTE: there must be a better & more robust \n // way to do this, but this works for now\n $table_check_result = $db->query( \"SHOW TABLES LIKE '$the_table_name'\" );\n if ($table_check_result)\n {\n $row = $table_check_result->fetch_row();\n $found_table_name = $row[0];\n if ( $found_table_name == $the_table_name )\n $exists = true;\n else\n $exists = false;\n $table_check_result->close();\n return $exists;\n }\n else\n {\n return null;\n }\n}", "function tableExists($pdo, $table) {\r\n // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.\r\n try {\r\n $result = $pdo->query(\"SELECT 1 FROM $table LIMIT 1\");\r\n } catch (Exception $e) {\r\n // We got an exception == table not found\r\n return FALSE;\r\n }\r\n\r\n // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)\r\n return $result !== FALSE;\r\n}", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection,\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection,\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "public function tableExists($tag) {}", "public function tableExists(string $table_name): bool\n {\n if (isset($this->getData()[$table_name])) {\n return true;\n }\n\n return false;\n }", "function table_exists($table, $schema=''){\n\t\t$table = addslashes(strtolower($table));\n\t\tif(strpos($table, \".\")){\n\t\t\tlist($schema, $table) = explode(\".\", $table);\n\t\t}\n\t\tif($schema==''){\n\t\t\t$num = $this->fetch_one(\"SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'public' AND TABLE_NAME ='$table'\");\n\t\t} else {\n\t\t\t$schema = addslashes(strtolower($schema));\n\t\t\t$num = $this->fetch_one(\"SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$schema' AND TABLE_NAME ='$table'\");\n\t\t}\n\t\treturn $num[0];\n\t}", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection, \n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "final public static function tableExists( $chrTable ) {\n\n\t\t$objQuery = DB::prepare(\"SELECT * FROM information_schema.tables WHERE TABLE_NAME = ? AND ? LIKE(CONCAT('%', TABLE_SCHEMA, '%'))\");\n\t\t$objQuery->execute(array($chrTable, Config::get('database:dsn')));\n\t\t$arrResults = $objQuery->fetchAll();\n\t\t\n\t\tif(sizeof($arrResults) > 0){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "function TableExists($tableName, $connection, $dbName) {\r\n $t = mysqli_real_escape_string($connection, $tableName);\r\n $d = mysqli_real_escape_string($connection, $dbName);\r\n\r\n $checktable = mysqli_query($connection, \r\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\r\n\r\n if(mysqli_num_rows($checktable) > 0) return true;\r\n\r\n return false;\r\n}", "public function testDBTablesExist() {\n\n $tables = array(\n 'pheno_plant',\n 'pheno_plantprop',\n 'pheno_scale_member',\n 'pheno_measurements',\n 'pheno_project_cvterm',\n 'pheno_plant_project',\n 'pheno_project_user',\n 'pheno_backup_file',\n );\n \n foreach($tables as $table) {\n $exists = db_table_exists($table);\n $this->assertTrue($exists, \"Checking that $table table exists.\");\n }\n\n }", "public function isTableExists(): bool\n {\n $sql = 'SHOW TABLES LIKE :table_name;';\n $stmt = $this->pdo->prepare($sql);\n $result = $stmt->execute([':table_name' => $this->tableName]);\n if (!$result) {\n $errorInfo = print_r($stmt->errorInfo(), true);\n throw new \\RuntimeException(\"Couldn't check if Log table exists. Query string: `{$stmt->queryString}`, table name: `{$this->tableName}`, error info: `{$errorInfo}`.\");\n }\n\n return 1 === $stmt->rowCount();\n }", "public function tableExists($table)\n {\n return $this->db_instance->table_exists($table);\n }", "public function _tableExist($table, $db)\n {\n /* Check to see if the database exists */\n if (!empty($db)) {\n if (!$this->selectDb($db)) {\n return false;\n }\n }\n\n /* Check to see if the table exists */\n $filename = \"$this->_LIBPATH/$this->_SELECTEDDB/$table\";\n\n if (is_file($filename . '.MYD') && is_file($filename . '.FRM')) {\n return true;\n }\n\n return false;\n }", "public function hasTable($table);", "public function table_exists($table) {\n\t\t\t// check in the cache first\n\t\t\treturn true; // Assume that table exists\n\t\t\tif(isset(self::$cache['table_exists'][$table])) return true;\n\t\t\t$query = \"SELECT object_name FROM user_objects WHERE OBJECT_TYPE IN ('TABLE', 'VIEW') AND LOWER(object_name)='\".strtolower($table).\"'\";\n\t\t\t$result = $this->query($query);\n\t\t\tself::$cache['table_exists'][$table] = count($result) ? true : false;\n\t\t\treturn self::$cache['table_exists'][$table];\n\t\t}", "function tableExist($connection,$database,$tableName) {\n\t\n\t$query = \"SELECT table_name\n\tFROM information_schema.tables\n\tWHERE table_schema = '$database'\n\tAND table_name = '$tableName'\";\n\n\t$result = consult($connection,$query);\n\t\n\treturn $result;\n}", "public function table_exists($table, $schema=''){\n\t\t$table = strtoupper(addslashes(\"$table\"));\n\t\t//NOT LIKE 'RDB\\$%'\n\t\t$num = $this->fetch_one(\"SELECT COUNT(*) FROM rdb\\$relations WHERE rdb\\$relation_name = '$table'\");\n\t\treturn $num[0];\n\t}", "public function hasTable($tableName);", "public function hasTable($tableName);", "public function compileTableExists()\n {\n return \"select * from sqlite_master where type = 'table' and name = ?\";\n }", "public function tableExists($tableName)\n {\n $this->init();\n $result = $this->Execute(\"show tables\");\n while ($row = $result->FetchRow()) {\n if (in_array($tableName, $row)) {\n return true;\n }\n }\n return false;\n }", "protected function tableExists($table)\n {\n try {\n $query = $this->app['db']->query(\"SHOW TABLES LIKE '$table'\");\n return (false !== ($row = $query->fetch())) ? true : false;\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public static function table_exists( $table_name ) {\n\t\t/** @var wpdb $wpdb */\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_var( sprintf( \"SHOW TABLES LIKE '%s'\", $table_name ) ) === $table_name;\n\t}", "function dormTableExists($dormTable) {\n $sql = \"SELECT * FROM $dormTable\";\n if (query($sql) !== FALSE) \n return true;\n else \n return false; \n }", "public function tableExists($name)\n {\n return (bool)$this->fetchValue(\"SHOW TABLES LIKE ?\", $name);\n }", "public function exists()\n\t{\n\t\treturn in_array($this->name, $this->driver->getTables());\n\t}", "abstract public function hasTable($tableName);", "function tableExist($table, $database=false){\n if(empty($database)){\n $result = $this->query(\"SELECT DATABASE()\");\n $row = $this->fetchArray($result);\n $database = $row[0];\n }\n $result = $this->query(\"SELECT `table_name` FROM `information_schema`.`tables` WHERE `table_schema` = '{$database}' AND `table_name` = '{$table}'\");\n $numRows = $this->numRows($result);\n return $numRows > 0;\n }", "private function TableExists($tableName)\r\n\t{\r\n\t\t$isTableName = false;\r\n if (!self::$_tables || !count(self::$_tables) || !isset(self::$_tables[$this->_dbCatalog]))\r\n {\r\n $this->UpdateStorageLocations();\r\n }\r\n\t\tif (isset(self::$_tables[$this->_dbCatalog][$tableName]))\r\n\t\t{\r\n\t\t\t$isTableName = true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$isTableName = false;\r\n\t\t\tforeach (self::$_tables[$this->_dbCatalog] as $testTableName => $tableValue)\r\n\t\t\t{\r\n\t\t\t\tif (strcasecmp($testTableName, $tableName) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$isTableName = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $isTableName;\r\n\t}", "protected function ensureTableExists() {\n try {\n $database_schema = $this->connection->schema();\n $schema_definition = $this->schemaDefinition();\n $database_schema->createTable(static::TABLE_NAME, $schema_definition);\n }\n // If another process has already created the batch table, attempting to\n // recreate it will throw an exception. In this case just catch the\n // exception and do nothing.\n catch (DatabaseException $e) {\n }\n catch (\\Exception $e) {\n return FALSE;\n }\n return TRUE;\n }", "public function isExistTable($name)\r\n\t{\r\n\t\tif ($this->db->query('SHOW TABLES LIKE %like~', $name)->fetch() ? TRUE : FALSE) {\r\n\t\t\tthrow new Exception('Sorry, but collide in a database table names.', self::COLLIDE_TABLE);\r\n\t\t}\r\n\t}", "function check_if_table_exists_in_schema($table,$schema) {\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\tEXISTS(\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t1\n\t\t\t\t\tFROM\n\t\t\t\t\t\tinformation_schema.tables\n\t\t\t\t\tWHERE \n\t\t\t\t\t\ttable_name = '\" . $table . \"'\n\t\t\t\t\tAND\n\t\t\t\t\t\ttable_schema = '\" . $schema . \"'\n\t\t\t\t\tAND\n\t\t\t\t\t\ttable_catalog = '\" . POSTGRES_DBNAME . \"'\n\t\t\t\t)\n\t\t\t;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_row($ret[1]);\n\t\treturn ($result[0] === 't');\n\t}", "public function exists() : bool {\n return DB::tableExists($this->_name);\n }", "public function tableExists($table)\n {\n return $this->query($table);\n }", "static function check_exist($table){\n\t\t$db = JFactory::getDbo();\n\t\t$table_name = str_replace('#__', $db->getPrefix(),$table);\n\t\treturn in_array($table_name,$db->getTableList());\t\t\n\t}", "public function isTable ($table) {\n\n\t// get and send query\n\t$sql = \"SHOW TABLES LIKE '\".mysql_real_escape_string($table).\"';\";\n\t$result = $this->_sendQuery($sql);\n\n\t// check, if table exists\n\tif ($result AND mysql_num_rows($result) > 0)\n\t //table exists\n\t return true;\n\telse\n\t //table doesn't exist\n\t return false;\n }", "public function tableExists($tableName, $schemaName=null){ }", "public function tableExists($name)\n {\n $tables = $this->listTables();\n foreach ($tables as $tableName) {\n if ($tableName == $name) {\n return true;\n }\n }\n \n return false;\n }", "function checkTables($pdo, $tablename)\n{\n $tableCheck = $pdo->query(\"SELECT * FROM $tablename\");\n if(!empty($tableCheck))\n {\n echo \"Table created\\n\";\n }\n else\n {\n echo \"ERROR: Table not created\\n\";\n }\n}", "public function hasTable(string $table): bool\n {\n $table = $this->getTablePrefixName($table);\n\n return $this->getConnection()->statement($this->grammar->compileTableExists(), [$table]);\n }", "public function has_Table(string $nameTable): bool\n {\n return $this->is_Table($nameTable);\n }", "static public function hasTable($table)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function tableExists($table, $db)\n {\n return $this->_tableExist($table, $db);\n }", "public function hasTable(string $table): bool\n {\n $table = $this->getTablePrefixName($table);\n $connection = $this->getConnection();\n\n return count($connection->select(\n $this->grammar->compileTableExists(), [$this->getDatabaseName(), $table], false\n )) > 0;\n }", "public static function checkTableExists($table)\n {\n $sql = 'SHOW TABLES LIKE \\'' . _DB_PREFIX_ . $table . '\\'';\n try {\n $result = Db::getInstance()->executeS($sql);\n return !empty($result) ? true : false;\n } catch (PrestaShopDatabaseException $e) {\n return true;\n }\n }", "function _cacheTableExists(){\n\t\tif ( isset($this->_cacheTableExists) ) return $this->_cacheTableExists;\n\t\t$res = mysql_query(\"SHOW TABLES LIKE '\".addslashes($this->tableName).\"'\", $this->app->db());\n\t\tif ( !$res ){\n\t\t\ttrigger_error(mysql_error($this->app->db()), E_USER_ERROR);\n\t\t}\n\t\treturn (mysql_num_rows($res) > 0);\n\t}", "protected function tableExists($pdo, $table) {\n // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.\n try {\n $result = $pdo->query(\"SELECT 1 FROM $table LIMIT 1\");\n } catch (Exception $e) {\n // We got an exception == table not found\n return FALSE;\n }\n\n // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)\n return $result !== FALSE;\n }", "public function tableExists($tableName)\n {\n $db = \\Db::getInstance();\n $sql = 'SELECT * FROM ' . _DB_PREFIX_ . $tableName;\n try {\n $db->getValue($sql);\n } catch (\\Exception $e) {\n $this->logger->error(sprintf('Table %s does not exist', _DB_PREFIX_ . $tableName));\n\n return false;\n }\n\n return true;\n }", "public function hasTable($table) {\r\n\r\n $this->database->rawQuery(\"SHOW TABLES LIKE '\". $this->database->prefix.$table.\"'\");\r\n\r\n if($this->database->count >= 1)\r\n return TRUE;\r\n else\r\n return FALSE;\r\n }", "public function checkIfTableExists($tableName, OutputInterface $o)\n {\n $db = new db;\n\n \n try\n\t {\n $db->limit(1)->get($tableName);\n }\n\tcatch(\\Shadowapp\\Sys\\Exceptions\\Db\\WrongQueryException $e)\n\t{\n $o->writeln(\" \\033[41m Table \".$tableName.\" does not exists \\033[0m \"); \n\t}\n }", "public function database_exists()\n\t{\n\t\t\n\t\t$mysqli = $this->connect();\n\t\t\n\t\tif($stmt = $mysqli->prepare(\"\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM information_schema.TABLES\n\t\t\tWHERE table_schema = ?\n\t\t\tAND table_name = ?\"))\n\t\t{\n\t\t\n\t\t\t//Workaround since bind_param doesn't accept constants\n\t\t\t$db_name = DB_NAME;\n\t\t\t\n\t\t\t$stmt->bind_param('ss', $db_name, $this->table_name);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->bind_result($table_count);\n\t\t\t$stmt->fetch();\n\t\t\t$stmt->close();\n\t\t\n\t\t}else{\n\t\t\tdie('Error: Could not prepare statement');\n\t\t}\n\t\t\n\t\t$table_exists = ($table_count >= 1) ? true : false;\n\t\t\n\t\tif ($table_exists) :\n\t\t\treturn true;\n\t\telse :\n\t\t\treturn false;\n\t\tendif;\n\t}", "public function table_exists($table_name, $dbname = null)\n {\n $tables = $this->tables($dbname);\n return sizeof(array_intersect($tables, (array) $table_name)) === sizeof((array) $table_name);\n }", "private function _checkTXNTableExists() {\n $curTable = readSetting( $this->settings['DataFile'], 'txnTable' );\n $txnTable = $this->settings['txnTable'];\n $rVal = false;\n\n // If the Transaction Table is Not the Same as Expected, then Create It\n if ( $curTable != $txnTable ) {\n $sqlStr = $this->_readTXNTableDefinitions();\n if ( $sqlStr ) {\n $rslt = doSQLExecute( $sqlStr );\n }\n\n // Confirm the Table Exists, and Save the TXN Name if Appropriate\n if ( $this->_confirmTXNTables() ) {\n $rVal = saveSetting( $this->settings['DataFile'], 'txnTable', $txnTable );\n writeNote( \"Saved Transaction Table Record: \" . BoolYN($rVal) );\n }\n }\n\n // Return the Boolean Response\n return $rVal;\n }", "function f_tableExists($link, $tablename, $database = false) {\r\n if (!$database) {\r\n $res = mysqli_query($link, \"SELECT DATABASE()\");\r\n $database = mysqli_result($res, 0);\r\n }\r\n $res = mysqli_query($link, \"SHOW TABLES LIKE '$tablename'\");\r\n return mysqli_num_rows($res) > 0;\r\n}" ]
[ "0.85756624", "0.8473791", "0.844161", "0.8400328", "0.8355641", "0.83013916", "0.82501996", "0.81919605", "0.8170477", "0.8170232", "0.8122496", "0.801555", "0.8003814", "0.800375", "0.7994581", "0.79738116", "0.7955232", "0.79526347", "0.7937994", "0.7934513", "0.79276365", "0.79027843", "0.7884471", "0.7872882", "0.7867211", "0.785845", "0.7856833", "0.7844959", "0.7830215", "0.7791669", "0.77821314", "0.7775142", "0.7769666", "0.77670014", "0.7748708", "0.7743911", "0.772624", "0.7721062", "0.77183014", "0.7710993", "0.77103025", "0.7707439", "0.76925254", "0.7692394", "0.76903695", "0.76828295", "0.7680067", "0.7671083", "0.7671083", "0.76459175", "0.7645567", "0.7644745", "0.76398844", "0.7635498", "0.7628208", "0.76229465", "0.7615357", "0.7600889", "0.75866956", "0.7553903", "0.7519698", "0.7519346", "0.7517604", "0.7516709", "0.7516709", "0.74803823", "0.7475661", "0.7474621", "0.7464986", "0.7452551", "0.74292326", "0.7428994", "0.7422902", "0.74212855", "0.741326", "0.74097145", "0.7400429", "0.73952615", "0.73867995", "0.73828083", "0.73791355", "0.73766017", "0.7360413", "0.7348755", "0.73451555", "0.73153275", "0.7312756", "0.731078", "0.73088413", "0.73053336", "0.7300479", "0.72969073", "0.7293659", "0.7292433", "0.7276758", "0.72712755", "0.72700894", "0.72624564", "0.72604907", "0.725612" ]
0.7465074
68
Display a listing of the resource.
public function index() { // $users = User::get()->all(); $users = User::latest()->paginate(3); return view('user', compact('users')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "function listing() {\r\n\r\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446838", "0.7361646", "0.7299749", "0.7246801", "0.7163394", "0.7148201", "0.71318537", "0.7104601", "0.7101873", "0.709985", "0.70487136", "0.69936216", "0.6988242", "0.69347453", "0.68989795", "0.68988764", "0.68909055", "0.68874204", "0.68650436", "0.6848891", "0.6829478", "0.6801521", "0.67970383", "0.6794992", "0.678622", "0.67595136", "0.67416173", "0.6730242", "0.67248064", "0.6724347", "0.6724347", "0.6724347", "0.6717754", "0.67069757", "0.67046493", "0.67045283", "0.66652155", "0.6662764", "0.6659929", "0.6659647", "0.665744", "0.6653796", "0.66483474", "0.6620148", "0.6619058", "0.66164845", "0.6606442", "0.66005665", "0.65998816", "0.6593891", "0.6587057", "0.6584887", "0.65822107", "0.65806025", "0.6576035", "0.65731865", "0.6571651", "0.65702003", "0.6569641", "0.6564336", "0.65618914", "0.65526754", "0.6552204", "0.6545456", "0.653638", "0.65332466", "0.65329266", "0.65268785", "0.6525191", "0.652505", "0.65196913", "0.6517856", "0.6517691", "0.65152586", "0.6515112", "0.6507232", "0.65038383", "0.65013176", "0.64949673", "0.6491598", "0.6486873", "0.64857864", "0.6484881", "0.6483896", "0.64777964", "0.6476692", "0.64711976", "0.6469358", "0.64685416", "0.64659655", "0.6462483", "0.6461606", "0.6459046", "0.6457556", "0.6454214", "0.6453915", "0.64524966", "0.64499927", "0.6448528", "0.6447461", "0.6445687" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('creatUSER'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.7594873", "0.7594873", "0.75862724", "0.7577369", "0.75727355", "0.7500874", "0.74348205", "0.74339336", "0.7389178", "0.73531044", "0.73364365", "0.73124814", "0.7296061", "0.72818893", "0.7274119", "0.72423935", "0.72292763", "0.72266877", "0.7187332", "0.717915", "0.7174258", "0.7150343", "0.7144378", "0.7144238", "0.7134942", "0.7128289", "0.71236694", "0.7115823", "0.7115823", "0.7115823", "0.7112145", "0.70943975", "0.70857024", "0.70802104", "0.70800203", "0.7057187", "0.7057187", "0.7055648", "0.7039616", "0.7039533", "0.7036246", "0.70346695", "0.70305556", "0.7027626", "0.7026509", "0.70199776", "0.7017972", "0.70049554", "0.7003876", "0.7000925", "0.69973546", "0.6994639", "0.69937307", "0.69898754", "0.6986977", "0.69664884", "0.6965616", "0.69563985", "0.6951776", "0.69510984", "0.69472855", "0.69444585", "0.6942343", "0.69411284", "0.69378203", "0.69378203", "0.6936664", "0.69344825", "0.69317704", "0.69282645", "0.69263744", "0.6924216", "0.6918314", "0.6915855", "0.69128567", "0.6911424", "0.6910289", "0.69085616", "0.6903973", "0.6901382", "0.6901172", "0.6900354", "0.6895054", "0.6893486", "0.6893189", "0.68918854", "0.6891604", "0.6891604", "0.6889186", "0.6888053", "0.6887076", "0.6884677", "0.68822217", "0.6880916", "0.6875967", "0.68739045", "0.6873874", "0.6870332", "0.6869766", "0.68696475", "0.6868746" ]
0.0
-1
Store a newly created resource in storage.
public function store() { request()->validate([ 'name'=>['required'], 'email' => ['required','email'], 'password'=>['required','confirmed','min:8'], 'password_confirmation'=>['required'], ]); $users = User::create([ 'name'=>request('name'), 'email'=>request('email'), 'password'=> password_hash(request('password'), PASSWORD_DEFAULT), ]); return redirect()->route('users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $users = User::findOrFail($id); return view ('editUSER', compact('users')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78561044", "0.7695814", "0.72755414", "0.72429216", "0.71737534", "0.7064628", "0.7056257", "0.69859976", "0.6949863", "0.6948435", "0.6942811", "0.69298875", "0.69032556", "0.6900465", "0.6900465", "0.6880163", "0.6865618", "0.68620205", "0.6859499", "0.6847944", "0.6837563", "0.6812879", "0.68089813", "0.6808603", "0.68049484", "0.67966837", "0.6795056", "0.6795056", "0.67909557", "0.6787095", "0.67825735", "0.67783386", "0.6771208", "0.67658216", "0.67488056", "0.67488056", "0.67481846", "0.67474896", "0.67430425", "0.6737776", "0.67283165", "0.6715326", "0.66959506", "0.66939133", "0.6690822", "0.6690126", "0.66885006", "0.6687302", "0.6685716", "0.6672116", "0.6671334", "0.6667436", "0.6667436", "0.6664605", "0.6663487", "0.6662144", "0.6659632", "0.6658028", "0.66556853", "0.6645572", "0.66350394", "0.66338056", "0.6630717", "0.6630717", "0.66214246", "0.66212183", "0.661855", "0.6617633", "0.6612846", "0.66112465", "0.66079855", "0.65980226", "0.6597105", "0.6596064", "0.6593222", "0.65920717", "0.6589676", "0.6582856", "0.65828097", "0.6582112", "0.6578338", "0.65776545", "0.65774703", "0.6572131", "0.65708333", "0.65703875", "0.6569249", "0.6564464", "0.6564464", "0.65628386", "0.6560576", "0.6559898", "0.65583706", "0.6558308", "0.6557277", "0.65571105", "0.6557092", "0.6556115", "0.655001", "0.6549598", "0.6547666" ]
0.0
-1
Update the specified resource in storage.
public function update($id) { $attributes = request()->validate([ 'name'=>['required'], 'email' => ['required','email'], ]); $users = User::findOrFail($id); $users->update($attributes); return redirect()->route('users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", "0.58618903", "0.5855116", "0.5855116", "0.58517504", "0.5816175", "0.5807103", "0.5753658", "0.5753658", "0.57354003", "0.5724066", "0.5714874", "0.56957984", "0.5692136", "0.5688278", "0.5670771", "0.5656715", "0.5651525", "0.5647887", "0.563695", "0.5635239", "0.5633743", "0.5633203", "0.56296664", "0.5622203", "0.56089646", "0.5602395", "0.55937296", "0.55837464", "0.5582684", "0.55814886", "0.5575469", "0.5572433", "0.55668694", "0.556366", "0.5562336", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.5560869", "0.55574787", "0.55562645", "0.5554329", "0.5553793", "0.5553788", "0.55448633", "0.55448294", "0.5541889", "0.55402213", "0.5537772", "0.55359083", "0.55358595", "0.55248064", "0.5520229", "0.5517453", "0.5513332", "0.5511126", "0.55085385", "0.5508433", "0.5503835", "0.5502763", "0.5501662", "0.5500294", "0.5498694", "0.5496697", "0.5496697", "0.5495247", "0.5494445", "0.5494331", "0.549349", "0.5492967", "0.5484066", "0.5480196", "0.5479421", "0.54788667", "0.546669", "0.5464114", "0.54621613", "0.5458347" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $user = User::findOrFail($id); $user->delete(); return redirect()->route('users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Show the form for editing the specified resource.
public function editPASSE($id) { $users = User::findOrFail($id); return view ('editPASSE', compact('users')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
(Request $request, $id) Update the specified resource in storage.
public function updatePASSE($id) { $attributes = request()->validate([ 'password'=>['required','confirmed','min:4'], 'password_confirmation'=>['required'], ]); $users = User::findOrFail($id); $users->update([ 'password'=> password_hash(request('password'), PASSWORD_DEFAULT), ]); return redirect()->route('users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(\\Illuminate\\Http\\Request $request, $id);", "public function update($request, $id);", "public function update(Request $request, $id)\n {\n // New & Update made in the store function above\n }", "public function update(Request $request, $id){}", "public function update(Request $request, $id)\n {\n //put (post+get)\n }", "public function update(Request $request, $id) {\n \n }", "public function update(Request $request, $id) {\n \n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n\n \n }", "public function update(Request $request, $id) {\n\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\n {\n }", "public function update(Request $request, $id)\r\n {\r\n\r\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update( Request $request, $id )\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n\n \n }", "public function update($id, Request $request)\n {\n }", "public function update(Request $request, $id) {\n\t\t//\n\t}", "public function update(Request $request, $id) {\n\t\t//\n\t}", "public function update(Request $request, $id) {\n\t\t//\n\t}", "public function update(Request $request, $id) {\n\t\t//\n\t}", "public function update(Request $request, $id) {\n\t\t//\n\t}", "public function update(Request $request, $id) {\n\t\t//\n\t}", "public function update(Request $request, $id)\n {\n \n }", "public function update(Request $request, $id)\n {\n \n }", "public function update(Request $request, $id)\n { }", "public function update($request, $id)\n {\n //\n }", "public function update(Request $request, $id)\r\r\n {\r\r\n //\r\r\n }", "public function update(Request $request, $id)\r\r\n {\r\r\n //\r\r\n }", "public function update(Request $request, $id) {\n\t\t\n\t\t\n\n\t}", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id) {\n //\n }", "public function update(Request $request, $id)\n {\n //\n \n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n }" ]
[ "0.8357611", "0.83039623", "0.8193506", "0.8181391", "0.8156849", "0.8091202", "0.8091202", "0.80602217", "0.80602217", "0.80541134", "0.80541134", "0.80541134", "0.80541134", "0.8041012", "0.803819", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.8033446", "0.80327475", "0.80320555", "0.80305374", "0.80305374", "0.80305374", "0.8026738", "0.8020499", "0.80193436", "0.801377", "0.8011479", "0.80093026", "0.80093026", "0.80093026", "0.80093026", "0.80093026", "0.80093026", "0.80055344", "0.80055344", "0.8004816", "0.80047905", "0.80040747", "0.80040747", "0.8003225", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8002588", "0.8000417", "0.7997494", "0.7997494", "0.7997494", "0.7997494", "0.7997494", "0.7997494", "0.7997494", "0.7997494", "0.7997494" ]
0.0
-1
/ To save created, modified user & date time
public function behaviors() { return parent::behaviors(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afterSave($created) \n\t{\n\t\tif(!$this->inAfterSave)\n\t\t{\n\t\t\t$this->inAfterSave = true;\n\t\t\t\n\t\t\t$userId = $this->controller->Cauth->user('id');\n\n\t\t\t// Cake saves these fields automatically, but in local time rather than GMT\n\t\t\t// time, so here we save them in GMT\n\t\t\t/*if($this->hasField('created'))\n\t\t\t{\n\t\t\t\t$this->saveField('created', date('Y-m-d H:i:s', time() - date(\"Z\")));\n\t\t\t}\n\t\t\t\n\t\t\tif($this->hasField('updated'))\n\t\t\t{\n\t\t\t\t$this->saveField('updated', date('Y-m-d H:i:s', time() - date(\"Z\")));\n\t\t\t}*/\n\n\t\t\tif($userId)\n\t\t\t{\n\t\t\t\tif($created && $this->hasField('created_by'))\n\t\t\t\t{\n\t\t\t\t\t$this->saveField('created_by', $userId);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->hasField('updated_by'))\n\t\t\t\t{\n\t\t\t\t\t$this->saveField('updated_by', $userId);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->inAfterSave = false;\n\t\t}\n\t\n\t}", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "public function save() {\n\t\tif (!$this->created)\n\t\t\t$this->created = date('Y-m-d H:i:s');\n\t\treturn parent::save();\n\t}", "function save_timestamp() {\n\t\t$this->timestamp = date('Y-m-d', time());\n\t}", "public function save()\n\t{\n\t\tif ( ! isset($this->object['date_created']))\n\t\t\t$this->date_created = time();\n\n\t\treturn parent::save();\n\t}", "public function save($data)\r\n {\r\n if( empty($data['created']) )\r\n {\r\n // Create new email entity with created time and author\r\n $data['created'] = date('Y-m-d H:i:s');\r\n $data['created_by'] = JFactory::getUser()->get('id');\r\n\r\n }else{\r\n\r\n // Save the user who changed the email entity\r\n $data['modified_by'] = JFactory::getUser()->get('id');\r\n }\r\n\r\n // Save the modify time for existed email entity\r\n $data['modified'] = date('Y-m-d H:i:s');\r\n\r\n return parent::save($data);\r\n }", "public function save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save()\n\t\t{\n\t\treturn isset($this->userguid) ? $this->update() : $this->create();\n\t\t}", "function save() {\n $modified_fields = $this->modified_fields;\n $is_new = $this->isNew();\n\n if($is_new && ($this->getToken() == '')) {\n $this->resetToken();\n } // if\n\n $save = parent::save();\n if($save && !is_error($save)) {\n if($is_new || in_array('email', $modified_fields) || in_array('first_name', $modified_fields) || in_array('last_name', $modified_fields)) {\n $content = $this->getEmail();\n if($this->getFirstName() || $this->getLastName()) {\n $content .= \"\\n\\n\" . trim($this->getFirstName() . ' ' . $this->getLastName());\n } // if\n\n search_index_set($this->getId(), 'User', $content);\n cache_remove_by_pattern('object_assignments_*_rendered');\n } // if\n\n // Role changed?\n if(in_array('role_id', $modified_fields)) {\n clean_user_permissions_cache($this);\n } // if\n } // if\n\n return $save;\n }", "private function __saveBasicInfo() {\n\t\t$postData = $this->request->data['User'];\n\n\t\t$fields = array('username', 'first_name', 'last_name', 'email', 'gender', 'timezone');\n\t\t$data = array();\n\t\tforeach ($fields as $field) {\n\t\t\t$data[$field] = $postData[$field];\n\t\t}\n\n\t\t// convert dob\n\t\t$dob = $postData['date_of_birth'];\n\t\tlist($dobMonth, $dobDay, $dobYear) = explode('-', $dob);\n\t\t$formattedDob = sprintf('%s-%s-%s', $dobYear, $dobMonth, $dobDay);\n\t\t$data['date_of_birth'] = $formattedDob;\n\n\t\t$data['id'] = $userId = $this->Auth->user('id');\n\t\tif ($this->User->save($data)) {\n\t\t\t// save user photo\n\t\t\t$this->__saveUserPhoto($userId, $this->request->data['cropfileName']);\n\n\t\t\t// send email change notification if email is changed\n\t\t\t$sendEmailChangeNotification = ($postData['email'] !== $postData['old_email']) ? true : false;\n\t\t\tif ($sendEmailChangeNotification === true) {\n\t\t\t\t$this->__sendEmailChangeNotification($postData);\n\t\t\t}\n\n\t\t\t// set new data on session\n\t\t\t$this->Session->write('Auth', $this->User->read(null, $userId));\n\n\t\t\t// redirect with success message\n\t\t\t$this->Session->setFlash(__('Successfully updated the details.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t// redirect with error message\n\t\t\t$this->Session->setFlash(__('Failed to update the details.'), 'error');\n\t\t}\n\t}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save($entity, $context) {\n if (empty($entity->cid)) {\n $entity->created = REQUEST_TIME;\n }\n\n $entity->changed = REQUEST_TIME;\n\n parent::save($entity, $context);\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save()\n {\n return $this->service->saveTimeEntry($this);\n }", "public function save() \n {\n\t\t$this->setLastUpdateTime(date(MYSQL_DATETIME_FORMAT));\n\n\t\tif($this->getId() ) {\n\t\t\treturn $this->_update();\n\t\t} else {\n\t\t\treturn $this->_insert();\n\t\t}\n\t}", "public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save_date( $user_id ) {\n\t\tupdate_user_meta( $user_id, '_bpfm_featured_at_time', time() );\n\t}", "public function getSavedAt()\n {\n return $this->savedAt;\n }", "function save_user_object($user){\r\n\r\n}", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "function __saveLog() {\n $this->__UserLog->save($this->__UserLog->data,false);\n }", "public static function save(User $user)// statiska funkcija, lai nevajadzetu taisit klases objektu\n {\n }", "public function touch() {\n\t\t$this->timestamp();\n\t\t$this->save();\n\t}", "public function save() {}", "public function save() {}", "public function save() {}", "public function save()\n {\n $now = new DateTime();\n $this->timestamp = $now->getTimestamp();\n self::setClassAndTable();\n parent::saveModel();\n\n $this->id = parent::getLastID();\n\n // Send notification to watchers\n $post = Post::find([\"id\" => $this->post_id]);\n $owner = $post->user();\n $watchers = $post->watchers();\n foreach ($watchers as $user) {\n $notif = new Notification();\n $notif->user_id_from = $owner->id;\n $notif->user_id_to = $user->id;\n $notif->type = Notification::WATCHLIST_UPDATE;\n $notif->link = \"/posts/view.php?post_id=$post->id\";\n $notif->save();\n }\n }", "public function setCreationTime()\n {\n $this->userDateCreation = new \\DateTime(\"now\");\n $this->userDateLastConnection = new \\DateTime(\"now\");\n $this->userActive = 'true';\n $this->userAdmin = $this->userAdmin == 'true' ? 'true' : 'false';\n }", "public function insert() {\n $this->data['creation_datetime']=date('Y-m-d H:i:s');\n $this->data['last_login_datetime']=date('Y-m-d H:i:s');\n if (array_key_exists('expiresIn', $this->rawData) && $this->rawData['expiresIn'] != '') {\n $this->data['expires_datetime']=date('Y-m-d H:i:s', time()+$this->rawData['expiresIn']); \n }\n parent::insert();\n }", "function save() {\n\n $record = new stdClass;\n $record->username = $this->username;\n $record->firstname = addslashes($this->firstname);\n $record->lastname = addslashes($this->lastname);\n $record->idnumber = $this->idnumber;\n $record->update_flag = $this->update_flag;\n $record->reg_status = $this->reg_status;\n $record->college = $this->college;\n $record->year = $this->year;\n $record->classification = $this->classification;\n $record->keypadid = $this->keypadid;\n $record->ferpa= $this->ferpa;\n $record->anonymous = $this->anonymous;\n $record->degree_candidacy = $this->degree_candidacy;\n\n if ($this->hidden != null) {\n $record->hidden = $this->hidden;\n }\n if ($this->numsections != null) {\n $record->numsections = $this->numsections;\n }\n if ($this->format != null) {\n $record->format= $this->format;\n }\n if ($this->cr_delete != null) {\n $record->cr_delete = $this->cr_delete;\n }\n if ($this->moodleid != null) {\n $record->moodleid = $this->moodleid;\n }\n\n if (!$this->id) {\n\n $this->id = insert_record('block_courseprefs_users', $record, true);\n\n if (!$this->id) {\n throw new Exception('Unable to create new courseprefs user within database');\n }\n\n } else {\n\n $record->id = $this->id;\n\n if (!update_record('block_courseprefs_users', $record)) {\n throw new Exception('Unable to update existing courseprefs user within database');\n }\n }\n }", "public function saved(User $user)\n {\n //\n }", "public function save() {\n\t\t// Reset primary key so we don't break Modeler\n\t\t$this->primary_key = 'user_token_id';\n\t\t\t\n\t\t// Add the user_agent\n\t\tif(str::e($this->user_agent)) {\n\t\t\t$this->user_agent = sha1(Eight::$user_agent);\n\t\t}\n\t\t\n\t\t// Add the created time\n\t\tif(str::e($this->created)) {\n\t\t\t$this->created = time();\n\t\t}\n\t\t\n\t\tself::db()->use_master(YES);\n\t\treturn parent::save();\n\t}", "function savtb() {\n\t\tif (strlen($this->haslo)<40) $this->haslo=sha1($this->haslo);\n\t\t$this->llog=time();\n\t\tif (!$this->id) {\n\t\t\t$qstr='INSERT INTO users VALUES (NULL,\\''.$this->login.'\\',\\''.$this->haslo.'\\',\\''.$this->email.'\\',time())';\n\t\t\t$ret=db_exec($qstr);\n\t\t\t$id = db_lastInsertID();\n\t\t}\n\t\tif ($ret) return true;\n\t\treturn false;\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "private function _timestamp()\n \t{\n \t\t$this->updated_at = time();\n \t\tif (!$this->exists) $this->created_at = $this->updated_at;\n \t}", "public function save() {\n if($this->hasUid){\n //Create new uid, and varify that it hasn't been used.\n //This might take a bit of overhead, but useful for ensuring you don't have duplicate UID's in any table\n $uniqueID = new uniqueID();\n $UID = $uniqueID->shorten($uniqueID->generate()); //final shortened userId\n\n while (!checkUidIsUnique($UID)) {\n $uniqueID = new uniqueID();\n $UID = $uniqueID->shorten($uniqueID->generate()); //final shortened userId\n }\n\n $this->uid = $UID;\n }\n \n //Check if we are creating a new object\n if ($this->uid == \"\" && $this->id == \"\") {\n $newFields = array();\n foreach ($this as $key => $value) {\n //Skip disregarded fields\n foreach($this->disregard as $disregard){\n if($key == $disregard){\n continue 2;\n }\n }\n \n $ins[] = ':' . $key;\n array_push($newFields, $key);\n }\n $ins = implode(',', $ins);\n $fields = implode(',', $newFields);\n \n //Get the current database time\n $NetworkConnection = new NetworkConnection();\n $PDO = $NetworkConnection->getNewDbConnection();\n \n $stmt = $PDO->prepare(\"SELECT NOW() today\");\n $stmt->execute();\n $dateTime = $stmt->fetch();\n $this->created_at = $dateTime[0]->today;\n $NetworkConnection->closeConnection();\n \n\n try {\n $NetworkConnection = new NetworkConnection();\n $PDO = $NetworkConnection->getNewDbConnection();\n \n $stmt = $PDO->prepare(\"INSERT INTO \" . $this->tableName .\" ($fields) VALUES ($ins)\");\n foreach ($this as $key => $value) {\n //Skip disregarded fields\n foreach($this->disregard as $disregard){\n if($key == $disregard){\n continue 2;\n }\n }\n $stmt->bindValue(':' . $key, $value);\n \n }\n var_dump($stmt);exit();\n $result = $stmt->execute();\n \n $NetworkConnection->closeConnection();\n \n if ($result && $this->hasUid) {\n //Created new lead entry\n $newUID = new UID(array(\"uid\" => $UID, \"table_name\" => $this->tableName));\n $newUID->save();\n return $this;\n }else{\n return $this;\n }\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n } else {\n \n $fields = array();\n $set = '';\n $x = 1;\n\n //TODO:: JMJ think this is reminent of old code, consider for removal\n //$this->created_at = date(\"Y-m-d H:i:s\");\n\n foreach ($this as $key => $value) {\n //Skip disregarded fields\n foreach($this->disregard as $disregard){\n if($key == $disregard){\n continue 2;\n }\n }\n array_push($fields, $key);\n }\n\n for ($x = 0; $x < count($fields); $x++) {\n $set .= \"{$fields[$x]} = ?\";\n if ($x < count($fields) - 1) {\n $set .= ', ';\n }\n }\n\n //Update existing entry\n $NetworkConnection = new NetworkConnection();\n $PDO = $NetworkConnection->getNewDbConnection();\n \n if(!$this->hasUid){\n $stmt = $PDO->prepare(\"UPDATE \" . $this->tableName .\" SET {$set} WHERE id=?\");\n }else{\n $stmt = $PDO->prepare(\"UPDATE \" . $this->tableName .\" SET {$set} WHERE uid=?\");\n }\n for ($i = 0; $i < count($fields); $i++) {\n\n $stmt->bindParam($i + 1, $this->{$fields[$i]});\n if ($i + 1 == count($fields)) {\n if(!$this->hasUid){\n $stmt->bindParam($i + 2, $this->id);\n }else{\n $stmt->bindParam($i + 2, $this->uid);\n }\n \n }\n }\n\n $result = $stmt->execute();\n \n $NetworkConnection->closeConnection();\n \n if ($result) {\n return $this;\n }\n }\n }", "public function save() {\n\t\t\t\n\t\t}", "public function saveMetadata($args){\n $_post = $args['_post'];\n\n // Controllo che ci sia un nonce settato\n if ( ! isset( $_post[$this->prefix.'nonce'] ) ) {\n return;\n }\n\n // Controllo che il nonce sia quello che mi aspetto\n if ( ! wp_verify_nonce( $_post[$this->prefix.'nonce'], $this->nonce_phrase ) ) {\n return;\n }\n\n if(!current_user_can('edit_user', $args['user_id'])){\n return;\n }\n\n /* OK, its safe for us to save the data now. */\n if(!isset($_post[$this->model->getOptionName()]))\n return;\n\n $this->model->import($_post[$this->model->getOptionName()]);\n\n update_user_meta( $args['user_id'], $this->model->getOptionName(), $this->model->toArray() );\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function beforeSave()\n {\n $this->created = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public function save() {\n\t\t\n\t\treturn isset($this->members_id) ? $this->update() : $this->create(); //and this one??\n\t\t\n\t}", "public function updateLoginTimestamp($id){\n $current_time = date('Y-m-d H:i:s');\n $user_info = User::find($id);\n $user_info->last_login_timestamp = $current_time;\n return $user_info->save();\n }", "public function timestamp() {\n\t\t$this->updated_at = new \\DateTime;\n\n\t\tif ( ! $this->exists) $this->created_at = $this->updated_at;\n\t}", "function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }", "public function beforeSave() {\r\n\t\tif ($this->isNew) {\r\n\t\t\t$this->created = date(\"Y-m-d H:i:s\");\r\n\t\t\t$this->modified = $this->created;\r\n\t\t\t$this->user = Auth::User()->id;\r\n\t\t} else {\r\n\t\t\t$this->modified = date(\"Y-m-d H:i:s\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function setCreateDates(){\n $t = date_create(date('Y-m-d H:i:s'));\n $this->created = $t;\n $this->modified = $t;\n }", "public function saving(User $user)\n {\n //\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n \n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n UserModel::load()->store($user);\n }", "protected function saveUpdate()\n {\n }", "public function updateTimestamps() {\r\n $this->setModifiedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n\r\n if ($this->getCreatedAt() == null) {\r\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n }\r\n }", "function insert_users_info($data = array()) {\n $data += array(\n \"created_on\" => $this->current_dts,\n );\n return $this->create_data($data);\n }", "function save() {\n //save the added fields\n }", "public function users_save() {\n if ($this->id) {\n return $this->users_update();\n } else {\n return $this->users_insert();\n }\n }", "public function store()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t $data = array(\r\n\t\t\t'username'=> $this->user->username,\r\n\t\t\t'post'=> $this->post,\r\n\t\t\t'date'=> $this->date,\r\n\t );\r\n\r\n\t\tarray_unshift($jsonData, $data);\r\n\r\n\t\t$this->save($jsonData);\r\n\t}", "protected function _syncCreationDate() {}", "public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function touchLogin() {\n $this->last_login = date( 'Y-m-d H:i:s' );\n $this->save();\n }", "function save($keys=null,$extra_where=null)\n\t{\n\t\tif (is_array($keys) && count($keys)) $this->data_merge($keys);\n\n\t\t// check if data contains user timezone during read AND user changed timezone since then\n\t\t// --> load old timezone for the rest of this request\n\t\t// this only a grude hack, better handle this situation in app code:\n\t\t// history logging eg. depends on old data read before calling save, which is then in new timezone!\n\t\t// anyway it's better fixing it here then not fixing it at all ;-)\n\t\tif (isset($this->data[self::USER_TIMEZONE_READ]) && $this->data[self::USER_TIMEZONE_READ] != egw_time::$user_timezone->getName())\n\t\t{\n\t\t\t//echo \"<p>\".__METHOD__.\"() User change TZ since read! tz-read=\".$this->data[self::USER_TIMEZONE_READ].' != current-tz='.egw_time::$user_timezone->getName().\" --> fixing</p>\\n\";\n\t\t\terror_log(__METHOD__.\"() User changed TZ since read! tz-read=\".$this->data[self::USER_TIMEZONE_READ].' != current-tz='.egw_time::$user_timezone->getName().\" --> fixing</p>\");\n\t\t\t$GLOBALS['egw_info']['user']['preferences']['common']['tz'] = $this->data[self::USER_TIMEZONE_READ];\n\t\t\tegw_time::setUserPrefs($this->data[self::USER_TIMEZONE_READ]);\n\t\t\t$this->set_times();\n\t\t}\n\t\t$this->data2db();\n\n\t\tif ((int) $this->debug >= 4) { echo \"so_sql::save(\".print_r($keys,true).\") autoinc_id='$this->autoinc_id', data=\"; _debug_array($this->data); }\n\n\t\tif ($this->autoinc_id && !$this->data[$this->db_key_cols[$this->autoinc_id]])\t// insert with auto id\n\t\t{\n\t\t\tforeach($this->db_cols as $db_col => $col)\n\t\t\t{\n\t\t\t\tif (!$this->autoinc_id || $db_col != $this->autoinc_id)\t// not write auto-inc-id\n\t\t\t\t{\n\t\t\t\t\tif (!array_key_exists($col,$this->data) && \t// handling of unset columns in $this->data\n\t\t\t\t\t\t(isset($this->table_def['fd'][$db_col]['default']) ||\t// we have a default value\n\t\t\t\t\t\t !isset($this->table_def['fd'][$db_col]['nullable']) || $this->table_def['fd'][$db_col]['nullable']))\t// column is nullable\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\t// no need to write that (unset) column\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->table_def['fd'][$db_col]['type'] == 'varchar' &&\n\t\t\t\t\t\tstrlen($this->data[$col]) > $this->table_def['fd'][$db_col]['precision'])\n\t\t\t\t\t{\n\t\t\t\t\t\t// truncate the field to mamimum length, if upper layers didn't care\n\t\t\t\t\t\t$data[$db_col] = substr($this->data[$col],0,$this->table_def['fd'][$db_col]['precision']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$data[$db_col] = (string) $this->data[$col] === '' && $this->empty_on_write == 'NULL' ? null : $this->data[$col];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->db->insert($this->table_name,$data,false,__LINE__,__FILE__,$this->app);\n\n\t\t\tif ($this->autoinc_id)\n\t\t\t{\n\t\t\t\t$this->data[$this->db_key_cols[$this->autoinc_id]] = $this->db->get_last_insert_id($this->table_name,$this->autoinc_id);\n\t\t\t}\n\t\t}\n\t\telse // insert in table without auto id or update of existing row, dont write colums unset in $this->data\n\t\t{\n\t\t\tforeach($this->db_data_cols as $db_col => $col)\n\t\t\t{\n\t\t\t\t// we need to update columns set to null: after a $this->data[$col]=null:\n\t\t\t\t// - array_key_exits($col,$this->data) === true\n\t\t\t\t// - isset($this->data[$col]) === false\n\t\t\t\tif (!array_key_exists($col,$this->data) &&\t// handling of unset columns in $this->data\n\t\t\t\t\t($this->autoinc_id ||\t\t\t// update of table with auto id or\n\t\t\t\t\t isset($this->table_def['fd'][$db_col]['default']) ||\t// we have a default value or\n\t\t\t\t\t !isset($this->table_def['fd'][$db_col]['nullable']) || $this->table_def['fd'][$db_col]['nullable']))\t// column is nullable\n\t\t\t\t{\n\t\t\t\t\tcontinue;\t// no need to write that (unset) column\n\t\t\t\t}\n\t\t\t\t$data[$db_col] = !is_object($this->data[$col]) && (string) $this->data[$col] === '' && $this->empty_on_write == 'NULL' ? null : $this->data[$col];\n\t\t\t}\n\t\t\t// allow to add direct sql updates, eg. \"etag=etag+1\" with int keys\n\t\t\tif (is_array($keys) && isset($keys[0]))\n\t\t\t{\n\t\t\t\tfor($n=0; isset($keys[$n]); ++$n)\n\t\t\t\t{\n\t\t\t\t\t$data[] = $keys[$n];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$keys = $extra_where;\n\t\t\tforeach($this->db_key_cols as $db_col => $col)\n\t\t\t{\n\t\t\t\t$keys[$db_col] = $this->data[$col];\n\t\t\t}\n\t\t\tif (!$data && !$this->autoinc_id)\t// happens if all columns are in the primary key\n\t\t\t{\n\t\t\t\t$data = $keys;\n\t\t\t\t$keys = False;\n\t\t\t}\n\t\t\tif ($this->autoinc_id)\n\t\t\t{\n\t\t\t\t$this->db->update($this->table_name,$data,$keys,__LINE__,__FILE__,$this->app);\n\t\t\t\tif (($nothing_affected = !$this->db->Errno && !$this->db->affected_rows()) && $extra_where)\n\t\t\t\t{\n\t\t\t\t\treturn true;\t// extra_where not met, eg. etag wrong\n\t\t\t\t}\n\t\t\t}\n\t\t\t// always try an insert if we have no autoinc_id, as we dont know if the data exists\n\t\t\tif (!$this->autoinc_id || $nothing_affected)\n\t\t\t{\n\t\t\t\t$this->db->insert($this->table_name,$data,$keys,__LINE__,__FILE__,$this->app);\n\t\t\t}\n\t\t}\n\t\t$this->db2data();\n\n\t\treturn $this->db->Errno;\n\t}", "public function addCreated()\n {\n try {\n $date = new DateTime();\n $this->created_at = $date->format('Y-m-d H:i:s');\n $this->created_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }", "public function onSaved($user)\n {\n if (! $this->isLocaltimeEnabled()) {\n return ;\n }\n\n $userId = $user->getAttribute('id');\n $meta = $this->memory->make('user');\n\n $meta->put(\"timezone.{$userId}\", Input::get('meta_timezone'));\n }", "protected function beforeSave() {\n \n # set time on creating posts\n $this->USER_idUser=Yii::app()->user->getId();\n \n \n return true;\n }", "protected function beforeSave()\n {\n if ($this->isNewRecord) \n $this->date_created = date('Y-m-d H:i:s');\n \n return parent::beforeSave();\n }", "public function save(array $options = array())\n {\n $this->upd_date = Carbon::now()->format('Y-m-d H:i:s');\n return parent::save($options);\n }", "public abstract function save();", "public function set()\n\t{\n\t\t$this->created_at = date(TIMESTAMP_FORMAT);\n $user = new SessionUser();\n\t\t$this->created_by = $user->getID();\t\t\n\t}", "public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive,\n $this->userId);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function save(){\r\n\t\t\t$query = DB::connection()->prepare(\r\n\t\t\t\t\"INSERT INTO Logs (comp_id, user_id, datum) \r\n\t\t\t\tVALUES (:comp_id, :user_id, :datum)\"\r\n\t\t\t);\r\n\t\t\t$query->execute(array(\r\n\t\t\t\t'comp_id' \t=>\t$this->comp_id,\r\n\t\t\t\t'user_id'\t=>\t$this->user_id,\r\n\t\t\t\t'datum' \t=>\t$this->datum\r\n\t\t\t));\r\n\t\t}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n $start_date = strtotime($start_date);\n $this->setData(\"start_date\", date(\"Y-m-d\", $start_date));\n\n // We only need to do end dates if they are provided.\n if ($end_date = $this->getData(\"end_date\"))\n {\n $end_date = strtotime($end_date);\n $this->setData(\"end_date\", date(\"Y-m-d\", $end_date));\n }\n else\n {\n $this->setData(\"end_date\", NULL);\n }\n\n parent::save();\n }", "public function getCreate_time()\r\n {\r\n return $this->create_time;\r\n }", "public function save()\r\n {\r\n \r\n }", "public function save()\n\t{\n\n\t}", "protected function beforeSave() {\n if (parent::beforeSave()) {\n if ($this->isNewRecord) {\n $this->created_date = $this->updated_date = date('Y-m-d');\n $this->created_by = Yii::app()->user->id;\n } else {\n $this->updated_by = Yii::app()->user->id;\n $this->updated_date = date('Y-m-d');\n }\n return true;\n } else\n return false;\n }", "public function beforeSave()\n {\n $this->createdAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `tours` values('\".addslashes($this->id).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->duration).\"' , '\".addslashes($this->description).\"' , '\".addslashes($this->tcid).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "public static function save()\n\t{\n//\t\t{\n//\t\t\techo static::$error;\n//\t\t\treturn false;\n//\t\t}\n\n\t\t$instance = static::$_instance[static::_getTable()];\n\t\t$columns = DB::getColumnListing(static::$_table);\n\n\t\tif (@$instance->id)\n\t\t{\n\t\t\tDB::where($instance->id);\n\n\t\t\tif (in_array('updated', $columns))\n\t\t\t\t$instance->updated = date('Y-m-d H:i:s');\n\n\t\t\tif (in_array('updater', $columns))\n\t\t\t\t$instance->updater = (int)Auth::identity()->id;\n\n\t\t\tDB::table(static::$_table)->update($instance);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (in_array('ordering', $columns))\n\t\t\t\t$instance->ordering = DB::table(static::$_table)->getNewOrdering();\n\n\t\t\tif (in_array('created', $columns))\n\t\t\t\t$instance->created = date('Y-m-d H:i:s');\n\n\t\t\tif (in_array('creator', $columns))\n\t\t\t\t$instance->creator = (int)Auth::identity()->id;\n\n\t\t\tDB::table(static::$_table)->insert($instance);\n\t\t\t$instance->id = DB::getLastInsertId();\n\t\t}\n\n\t\treturn true;\n\t}" ]
[ "0.69934356", "0.6973144", "0.6904347", "0.6785733", "0.67454296", "0.6726917", "0.6720559", "0.66125286", "0.654957", "0.65082896", "0.6421783", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6388061", "0.6328543", "0.631798", "0.630773", "0.62364334", "0.623314", "0.6231965", "0.6219129", "0.62041366", "0.6200296", "0.6194008", "0.619193", "0.615459", "0.61542684", "0.61415064", "0.61415064", "0.6140089", "0.612801", "0.6116667", "0.6106523", "0.61046016", "0.61020464", "0.60982347", "0.608689", "0.60845107", "0.60845107", "0.6068519", "0.6055693", "0.6044528", "0.60360086", "0.60297394", "0.60208493", "0.6017533", "0.60085166", "0.5993987", "0.59877133", "0.59825146", "0.5981489", "0.5980737", "0.59802026", "0.59802026", "0.59802026", "0.59802026", "0.59802026", "0.5979797", "0.59608746", "0.5959609", "0.5959227", "0.5958026", "0.5954605", "0.5946136", "0.5942756", "0.59366095", "0.5935448", "0.5928493", "0.592486", "0.59238213", "0.5922392", "0.59221447", "0.592113", "0.59164476", "0.5906741", "0.5904449", "0.58993536", "0.5898849", "0.58824134", "0.5881412", "0.5871539", "0.58681", "0.58579344", "0.58572567", "0.58543307", "0.5853133" ]
0.0
-1
Get the detail that owns by transaction.
public function details() { return $this->hasMany('App\Models\TransactionDetail'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function details()\n {\n return $this->belongsTo(TransactionDetail::class, 'transaction_detailID', 'id');\n }", "public function getOwner()\n {\n return $this->data['owner'];\n }", "function readOwner() { return($this->owner); }", "public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }", "public function show(Transaction $transaction)\n {\n return $transaction;\n }", "public function show(Transaction $transaction)\n {\n $this->authorize('view', $transaction);\n return Auth::user()->transactions->find($transaction);\n }", "public function getOwner()\n {\n return $this->get(self::_OWNER);\n }", "public function getOwnership() {\n\n return $this->ownership;\n\n }", "public function getTransactionReference()\n {\n foreach (['vpc_MerchTxnRef', 'vpc_TransactionNo'] as $key) {\n if (isset($this->data[$key])) {\n return $this->data[$key];\n }\n }\n }", "public function getAction(Transaction $transaction)\n {\n return $transaction;\n }", "public function getReturnOwnerTransaction()\n {\n $result = null;\n\n $xpcBackReference = \\XLite\\Core\\Request::getInstance()->xpcBackReference;\n\n if ($xpcBackReference) {\n\n $result = $this->searchTransactionByBackReference($xpcBackReference);\n\n if (!$result) {\n // Hack against broken GET-parameter\n $xpcBackReference = substr($xpcBackReference, 0, 32);\n\n $result = $this->searchTransactionByBackReference($xpcBackReference);\n }\n }\n\n return $result;\n }", "public function transaction()\n {\n return $this->hasOne('App\\Models\\Transaction');\n }", "public function transaction()\n {\n return $this->hasMany(Transaction::class, 'transaction_detailID');\n }", "function getOwner() \n {\n return $this->instance->getOwner();\n }", "function getOwnerIdentifier()\n {\n return $this->ownerIdentifier;\n }", "public function getOwnerEntity() {\n\t\treturn get_entity($this->owner_guid);\n\t}", "public function transactionDetails()\n {\n return $this->hasMany(TransactionDetail::class);\n }", "public function transaction(){\n return $this->belongTo('App\\Model\\Components\\Transaction','id','transaction_id');\n }", "function get_detail() {\n return $this->detail;\n }", "public function getOwner();", "public function getOwner();", "public function getOwner();", "public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function getTransaction(): Transaction\n {\n return $this->transaction;\n }", "public function getTransaction(): Transaction\n {\n return $this->transaction;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner() {\r\n return $this->owner;\r\n }", "public function getOwnerIdentifier();", "public function getOwner()\n {\n return $this->hasOne(User::className(), ['id' => 'owner_id']);\n }", "function getTxnId() {\n return $this->txn_id;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getTransaction()\n {\n return $this->transaction;\n }", "public function getTransaction()\n {\n return $this->transaction;\n }", "public function getTransaction()\n {\n return $this->transaction;\n }", "public function getTransactionRecord()\n {\n return $this->transactionRecord;\n }", "public function getTransaction();", "public function details()\n\t{\n\t\treturn $this->hasMany('App\\Http\\Models\\TxnSalesOrderDetail','so_number','so_number');\n\t}", "public function transaction()\n {\n return $this->belongsTo('App\\Models\\Transaction','transaction_id');\n }", "public function getOwner()\n {\n return $this->_owner;\n }", "public function getTransactionReference()\n {\n return $this->getDataItem('transactionReference');\n }", "public function transaction()\n {\n return $this->hasOne('App\\Model\\Transaction','request_id');\n }", "public function gettransaction($transaction){\n return $this->bitcoin->gettransaction($transaction);\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function show(Transaction $transaction)\n {\n $transaction = Transaction::with([\n 'payment',\n 'customer',\n ])->where('id',$transaction->id)->get()->toArray();\n return $transaction;\n }", "public function getTransactionDetails($transactionId) {\n return $this->getService()->detailTransaction($transactionId);\n }", "function getOwner() {\n \n return $this->principalInfo['uri'];\n \n }", "public function getDetail();", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : null;\n }", "public function getOwner() {\n\t\treturn $this->owner;\n\t}", "function getParent() {\n if (!empty($this->parent_txn_id)) {\n return userpoints_transaction_load($this->parent_txn_id);\n }\n }", "public function getTransaction()\r\n\t{\r\n\t\treturn $this->transaction;\r\n\t}", "public function owner()\n {\n return $this->conn->get('lock:' . $this->name);\n }", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "public function getTransactionReference()\n {\n if(isset($this->data['properties'])) {\n $properties = $this->data['properties'];\n $paymentIdProperty = array_filter($properties, function ($item) {\n return $item['name'] === 'PAYMENT_ID';\n });\n if (isset($paymentIdProperty[0]['value'])) {\n return (string)$paymentIdProperty[0]['value'];\n }\n };\n\n return null;\n }", "public function getPurchaseDetails($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collPurchaseDetails === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collPurchaseDetails = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(PurchaseDetailPeer::USER_ID, $this->id);\n\n\t\t\t\tPurchaseDetailPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collPurchaseDetails = PurchaseDetailPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(PurchaseDetailPeer::USER_ID, $this->id);\n\n\t\t\t\tPurchaseDetailPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastPurchaseDetailCriteria) || !$this->lastPurchaseDetailCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collPurchaseDetails = PurchaseDetailPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastPurchaseDetailCriteria = $criteria;\n\t\treturn $this->collPurchaseDetails;\n\t}", "public function getDetail() {\r\n\t\treturn($this->detail);\r\n\t}", "public function getOwnerId()\n {\n return $this->_OwnerId;\n }", "public function getTxDetails()\n {\n return $this->txDetails;\n }", "function readOwner()\r\n {\r\n return(null);\r\n }", "public function getTransactionId() { return $this->transactionId; }", "public function getTransactionReference()\n {\n if (!empty($this->data['transactions']) && !empty($this->data['transactions'][0]['related_resources'])) {\n foreach (array('sale', 'authorization') as $type) {\n if (!empty($this->data['transactions'][0]['related_resources'][0][$type])) {\n return $this->data['transactions'][0]['related_resources'][0][$type]['id'];\n }\n }\n }\n\n // This is a fallback, but is correct for fetch transaction and possibly others\n if (!empty($this->data['id'])) {\n return $this->data['id'];\n }\n\n return null;\n }", "public function getToolOwnerAttribute() {\n\t\t//\n\t\t$user = User::getIndex(Session::get('user_uid'));\n\t\tif ($user) {\n\n\t\t\t// fetch owner information\n\t\t\t//\n\t\t\t$owner = Owner::getIndex($this->tool_owner_uuid);\n\t\t\tif ($owner) {\n\t\t\t\treturn $owner->toArray();\n\t\t\t}\n\t\t}\n\t}", "public function getOrderDetail()\n {\n return $this->orderDetail;\n }", "public function getowner_id()\n {\n return $this->owner_id;\n }", "public function getTransactionReference()\n {\n return $this->transactionReference;\n }", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "public function getOwnerId()\n {\n return $this->user_id;\n }", "public function getOwnId()\n {\n return $this->getIfSet('ownId');\n }", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : '';\n }", "public function getResourceOwnerId() {\n\t\treturn $this->getClaims()['sub'];\n\t}", "public function owner(){\n\n\t\treturn $this->belongsTo('App\\User', 'user_id');\n\n\t}", "public function getOwner()\n {\n if (array_key_exists(\"owner\", $this->_propDict)) {\n return $this->_propDict[\"owner\"];\n } else {\n return null;\n }\n }", "public function getTransactionUid ();", "public function owner()\n\t{\n\t\treturn $this->belongsTo('User', 'user_id');\n\t}", "function Product() {\r\n\t\treturn $this->owner;\r\n\t}", "function get_owner()\n {\n return $this->get_default_property(self :: PROPERTY_OWNER);\n }", "public function getOwner(): User\n {\n return $this->user;\n }", "function userDetails() {\n return $this->hasOne('App\\Models\\User', 'id', 'receiver_user_id')->withTrashed();\n }", "public function getOwner(): User\n {\n return $this->owner;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "function get_owned_by_uid($uid) {\n\t\t$data = $this->db->query('SELECT event_id FROM event_owner WHERE owner_id='.$uid.'');\n\t\treturn $data->result();\n\t}", "public function owner() {\n return $this->belongsTo('App\\User', 'user_id');\n }", "public function getTransactionId() {\n return $this->transactionId;\n }", "public function getOwner(): string\n {\n return $this->owner;\n }", "public function getOrderDetails()\n {\n return Orders::getOrderdetails($this->getOrderId());\n }", "public function show(Transaction $transaction)\n {\n return new TransactionResource($transaction);\n }", "public function show(Transaction $transaction)\n {\n return new TransactionResource($transaction);\n }", "protected function get_owner_id()\n {\n return $this->owner_id;\n }", "public function getDetails()\r\n {\r\n return $this->details;\r\n }" ]
[ "0.633694", "0.6025633", "0.5980048", "0.5973451", "0.596036", "0.5899941", "0.5878873", "0.586538", "0.5817367", "0.5811808", "0.5800109", "0.57862765", "0.5782381", "0.5770194", "0.5765809", "0.5753884", "0.57480454", "0.5744143", "0.5743316", "0.5734147", "0.5734147", "0.5734147", "0.5710998", "0.57035714", "0.5702842", "0.5702842", "0.5702842", "0.56872356", "0.56872356", "0.56844395", "0.56844395", "0.56844395", "0.56645286", "0.56592244", "0.5659032", "0.5637474", "0.56174874", "0.56174874", "0.56174874", "0.56158125", "0.56158125", "0.56158125", "0.5605909", "0.5604096", "0.5602632", "0.55955803", "0.55828935", "0.557596", "0.5571879", "0.5567531", "0.555233", "0.555233", "0.55509037", "0.5538701", "0.5532545", "0.552977", "0.55172193", "0.55166614", "0.5516352", "0.55155104", "0.55061656", "0.55047876", "0.5500322", "0.549661", "0.54951376", "0.5492339", "0.5454911", "0.54501116", "0.54367316", "0.5435533", "0.5435129", "0.5426203", "0.541919", "0.54012334", "0.53910685", "0.5355513", "0.5353707", "0.535237", "0.5346427", "0.5343225", "0.53423893", "0.53380615", "0.53296965", "0.5322741", "0.5312282", "0.52967376", "0.529485", "0.5294804", "0.52919364", "0.52919364", "0.52919364", "0.5291396", "0.5286339", "0.5285784", "0.5278524", "0.52758753", "0.52709055", "0.52709055", "0.5269476", "0.5268168" ]
0.57750696
13
Run the database seeds.
public function run() { factory(\App\Models\StageProjectVisit::class, 25)->create()->each(function($stageprojectvisit){ $stageprojectvisit->make(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Configure action for this controller.
public function configureAction() { $this->pageRenderer = $GLOBALS['TSFE']->getPageRenderer(); // Set default mode if (!isset($this->settings['library']) || trim($this->settings['library']) === '') { $this->settings['library'] = 'core'; } if (!t3lib_div::inArray(array('core', 'slideshow'), $this->settings['library'])) { throw new InvalidArgumentException( 'Invalid mode check your TypoScript configuration (allowed mode "core" or "slideshow")', 1316699924 ); } $this->addJquery(); $this->addSupersized(); $backgroundImages = $this->searchBackgroundImage(); $this->view->assign('backgroundImages', $backgroundImages); $this->prepareConfiguration($backgroundImages); // Include Supersized configuration $this->pageRenderer->addJsFooterInlineCode( 'supersized-' . $this->settings['library'], $this->view->render() ); return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}", "protected function setAction()\n {\n $method = $this->request->method;\n $this->route->method = strtoupper($method);\n\n if ($this->route->method === 'POST') {\n $this->route->action = 'create';\n\n } elseif ($this->route->method === 'PUT') {\n $this->route->action = 'update';\n\n } elseif ($this->route->method === 'DELETE') {\n $this->route->action = 'delete';\n\n } else {\n $this->route->method = 'GET';\n $this->route->action = 'read';\n }\n\n $this->route->special_action = '';\n\n $this->valid_actions = $this->actions[$this->route->action];\n\n return $this;\n }", "public function setAction($action);", "public function SetControllerAction ($controllerAction);", "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "public function setAction()\n\t{\n\t\treturn $this;\n\t}", "public function addAction()\n {\n parent::addAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }", "protected function initAction()\n {\n }", "protected function setConfig($config) {\n parent::setConfig($config);\n $this->config['action'] = empty($this->config['action']) ? '' \n : $this->config['action'];\n }", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "function setAction($action);", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function setAction($action) {\n\t\t$this->action = $action;\n\t}", "protected function setFormActionUri() {}", "public function initializeAction() {\n\n\t}", "public function setAction($action) {\n $this->action = $action;\n }", "public function setAction($action) {\n $this->action = $action;\n }", "public function setFormAction($value) { $this->_formAction = $value; }", "public function & SetControllerAction ($controllerAction) {\n\t\t/** @var $this \\MvcCore\\Route */\n\t\tlist($ctrl, $action) = explode(':', $controllerAction);\n\t\tif ($ctrl)\t\t$this->controller = $ctrl;\n\t\tif ($action)\t$this->action = $action;\n\t\treturn $this;\n\t}", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "public function setAction($action)\n {\n $this->action = $action;\n $this->setAttributes(\"Action\");\n }", "public function setAction($action)\n\t{\n\n\t\t$this->action = $action;\n\n\t}", "public function setAction(callable $action);", "public function setAction($action) \n\t{\n\t\t$reflector = new ReflectionClass($this->controller);\n\n\t\tif (!$reflector->hasMethod($action)) {\n\t\t\tthrow new InvalidAction($this->controller, $action);\n\t\t}\n\t\t\n\t\t$this->action = $action;\n\n\t\treturn $this;\n\t}", "protected function initializeAction() {\n if(!$this->settings['moreText']) {\n $this->settings['moreText'] = $this->settings['defaults']['moreText'];\n }\n }", "function setAction($action) {\r\r\n\t\t$this->action = strtolower($action);\r\r\n\t}", "public function setup_actions() {}", "public function __construct($controller,$action) {\n\t\tparent::__construct($controller, $action);\n\t\t\n\t}", "public function setAction($action)\n {\n $reflector = new \\ReflectionClass($this->controller);\n if (!$reflector->hasMethod($action)) {\n throw new \\Exception(\"Controller {$this->controller} action: {$action} not found!\");\n }\n\n $this->action = $action;\n return $this;\n }", "public function setDefaultAction($actionName);", "protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }", "public function setAction($val)\n {\n $this->_propDict[\"action\"] = $val;\n return $this;\n }", "protected function createAction()\n {\n }", "function setActionURL($url) {\n\t\t$this->actionURL = $url;\n\t}", "public function setAction($action = '')\n {\n $this->action = $action;\n }", "abstract public function getControllerAction();", "public function setAction($value)\n {\n $this->action = $value;\n }", "public function setAction($val){\n\t\t$this->formElement->attr('action', $val);\n\t\treturn $this;\n\t}", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "public function setAction($str);", "public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }", "protected function initializeController() {}", "public function setAction($action)\n {\n $this->action = $action . 'Action';\n return $this;\n }", "public function getConfigPaymentAction()\n {\n return self::ACTION_AUTHORIZE;\n }", "public function setAction($action)\n \t{\n\t return $this->action = $action;\n \t}", "public function setAction( $action )\n\t{\n\t\t$this->setAttribute( \"action\", $action );\n\t}", "public function setAction($action) {\n\t\treturn $this->setParamCtrl(\"action\", $action, array(\n\t\t\t\"select\",\n\t\t\t\"auto\",\n\t\t\t\"activate\",\n\t\t\t\"combo\",\n\t\t\t\"nothing\",\n\t\t\t\"hide\"\n\t\t));\n\t}", "public function getControllerAction() {}", "public function testConfigActionCanBeAccessed()\n {\n $this->elasticsearchClientMock->expects($this->once())\n ->method('getConfiguration')\n ->will($this->returnValue(array('hosts' => '')));\n\n $serviceManager = $this->controller->getServiceLocator();\n $serviceManager->setAllowOverride(true);\n $serviceManager->setService('ElasticsearchManager', $this->elasticsearchClientMock);\n\n $this->routeMatch->setParam('action', 'config');\n\n $result = $this->controller->dispatch($this->request);\n $response = $this->controller->getResponse();\n\n $this->assertEquals(200, $response->getStatusCode());\n }", "public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }", "protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }", "protected function _initAction()\n {\n $this->loadLayout();\n $this->setUsedModuleName('novalnet_payment');\n $this->_setActiveMenu('novalnet/configuration');\n\n $this->_title($this->__('Novalnet'));\n $this->_title($this->__('Configuration'));\n\n return $this;\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "protected function setRequestAction()\n {\n $i = $this->setIndexAtMax();\n\n $special_action = $this->segments[$i];\n\n if (isset($this->valid_actions[$special_action])) {\n } else {\n return $this;\n }\n\n $this->route->special_action = $special_action;\n\n unset($this->segments[$i]);\n\n $this->setPath();\n\n return $this;\n }", "public function setAction($action) {\n $this->action = $action;\n return $this;\n }", "function set_action($action)\r\n {\r\n return $this->set_parameter(self :: PARAM_ACTION, $action);\r\n }", "protected function _postConstruct()\n {\n parent::_postConstruct();\n $this->_uri = Solar::factory('Solar_Uri_Action');\n }", "public function setAction($Action)\n {\n $this->action = $Action;\n\n return $this;\n }", "public function setAction($action)\n {\n $this->action = $action;\n return $this;\n }", "protected function initializeConfirmationAction() {}", "public function setAction($action)\n {\n if (is_string($action)) {\n $this->action = $action;\n }\n }", "public function action(Action $action);", "protected function initializeActionEntries() {}", "public function addAction() {\r\n\t}", "protected function configure()\n {\n\n // initialize the command with the required/optional options\n $this->setName(CommandNames::IMPORT_CREATE_OK_FILE)\n ->addArgument(InputArgumentKeysInterface::SHORTCUT, InputArgument::OPTIONAL, 'The shortcut that defines the operation(s) that has to be used for the import, one of \"create-ok-files\" or a combination of them', 'create-ok-files')\n ->setDescription('Create\\'s the OK file for the CSV files of the configured source directory');\n\n // invoke the parent method\n parent::configure();\n }", "public function setExpectedAction($action);", "public function indexAction()\n {\n $this->addAction();\n }", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function setAction($action)\n\t{\n\t\t$this->_action = $action;\n\t\treturn $this;\n\t}", "public function set_action($_action)\n {\n $this->_action = $_action;\n\n return $this;\n }", "public function setAction(?string $action) {\n $this->action = $action;\n return $this;\n }", "protected function ExecAction() {\r\n if (self::$sAction == \"new\")\r\n //self::$sAction = \"edit\";\r\n self::$sAction = \"add\";\r\n\r\n // Ищем контроллер\r\n $sControllerPath = \"/var/www/ad/app/controllers/\".self::$sController.\"_controller.php\";\r\n if (file_exists($sControllerPath)) {\r\n require_once($sControllerPath);\r\n\r\n $aClassPathComponents = explode(\"/\",self::$sController);\r\n $sClass = $aClassPathComponents[count($aClassPathComponents)-1];\r\n $sClass = ucfirst($sClass);\r\n $sClass = preg_replace_callback('/_([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $sClass);\r\n $sControllerClass = $sClass.\"Controller\";\r\n\r\n $this->oController = new $sControllerClass(self::$sController,self::$sAction);\r\n $this->oController->parameters = self::$aParameters;\r\n\r\n foreach(self::$aObjects as $oObject) {\r\n $sName = strtolower(get_class($oObject));\r\n $this->oController->$sName = $oObject;\r\n }\r\n call_user_func_array(array($this->oController,self::$sAction),self::$aObjects);\r\n\r\n return true;\r\n }\r\n }", "public function setServerAction ($action) {\n\t\t\t$server_action = '';\n\t\t\tswitch ($action){\n\t\t\t\tcase 'balance':\n\t\t\t\t\t\t$server_action = 'balance/get';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'status':\n\t\t\t\t\t\t$server_action = 'status/get';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'key_get':\n\t\t\t\t\t\t$server_action = 'key/get';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->authType = 'normal';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'key_reset':\n\t\t\t\t\t\t$server_action = 'key/reset';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->authType = 'normal';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'message':\n\t\t\t\t\t\t$server_action = 'sms/send';\n\t\t\t\tdefault:\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$this->serverAction = $server_action . '?';\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "public function set_action($action) {\n $this->_action = (string)$action;\n }", "public function __construct($action = '') {\n\t\t$this->app = Application::app();\n\t\t$this->setAction($action);\n\t}", "public function setupOptions()\n {\n $this->addTaskAction(new Action('test', 't', 'Test action'));\n }", "public function setAction(CircuitAction $action)\n {\n $this->action = $action;\n }", "private function setAction($action) {\n if (is_int($action) || is_string($action)) {\n $this->action = $action;\n }\n }", "protected function getAction() {}", "public function register_actions() {\n\t\t}", "public function setAction($action)\n {\n $this->action = $action;\n\n return $this;\n }", "public function setAction($action)\n {\n $this->action = $action;\n\n return $this;\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }", "public function configure() {\n\t\t}", "public function action(string $action): self;", "public function initializeUpdateAction() {\n\t\t$this->setTypeConverterConfigurationForImageUpload('example');\n\t}", "public function editAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_editExtraParameters;\n\n parent::editAction();\n }", "public function setsubscribableAction()\n {\n \n }", "protected function configure()\n {\n $this->setName('add')\n ->setDescription('Add job contents to the index')\n ;\n\n JobUtils::configureJobNamesArgument($this, 'Jobs to add to the index');\n }", "abstract public function configure_method_settings();" ]
[ "0.69294274", "0.65475357", "0.6410783", "0.6392701", "0.6338202", "0.6338202", "0.62787324", "0.62787324", "0.6277723", "0.61191654", "0.6103337", "0.6078937", "0.607105", "0.6041108", "0.60368294", "0.60336703", "0.60336703", "0.60336703", "0.60336703", "0.60336703", "0.59826046", "0.5963723", "0.59352845", "0.5934945", "0.5934945", "0.5930263", "0.5873757", "0.5837245", "0.58043426", "0.5784689", "0.5777737", "0.5767643", "0.57589805", "0.57536083", "0.5743337", "0.5741294", "0.57253623", "0.57128996", "0.5711617", "0.57078177", "0.5698281", "0.5684998", "0.56635535", "0.5660496", "0.5643195", "0.5616401", "0.5603421", "0.5599013", "0.55977434", "0.55790555", "0.556751", "0.55627483", "0.5559534", "0.55535424", "0.554934", "0.55477643", "0.5539817", "0.5536071", "0.55308825", "0.5522166", "0.5512382", "0.55101043", "0.550818", "0.5491797", "0.5483338", "0.54755855", "0.546358", "0.5462112", "0.5459932", "0.5457566", "0.54487234", "0.5447062", "0.5445968", "0.5432489", "0.5426338", "0.5423282", "0.5423282", "0.5423282", "0.5416174", "0.5413707", "0.5410573", "0.5404869", "0.53980225", "0.53955257", "0.5392247", "0.538947", "0.5389115", "0.53863376", "0.53643906", "0.5360478", "0.53532815", "0.53532815", "0.5348696", "0.5348078", "0.534791", "0.5342637", "0.53421944", "0.5341865", "0.53360486", "0.5328928" ]
0.56931114
41
Search for background image in the current rootline
protected function searchBackgroundImage() { $resources = FALSE; if (isset($this->settings['mode']) && $this->settings['mode'] == 'directory' && trim($this->settings['directory']) !== '') { // Get background image from a directory $resources = $this->searchBackgroundImageInDirectory(); } if (!isset($this->settings['mode']) || $this->settings['mode'] == 'rootline') { // Get background image from a rootline $resources = $this->searchBackgroundImageInRootline(); } if ($resources == FALSE || !($resources instanceof Tx_Extbase_Persistence_ObjectStorage && $resources->current() instanceof Tx_Supersized_Domain_Model_Resource)) { $this->setDefaultBackgroundImage(); } return $resources; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _captcha_show_gd_img_get_backgrounds()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$images = array();\n\t\t$_path = $this->path_background;\n\t\t\n\t\tif ( $_dir = @opendir( $_path ) )\n\t\t{\n\t\t\twhile( false !== ( $_file = @readdir( $_dir ) ) )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#\\.(gif|jpeg|jpg|png)$#i\", $_file ) )\n\t\t\t\t{\n\t\t\t\t\t$images[] = $_path . '/' . $_file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $images;\n\t}", "function get_background_image()\n {\n }", "function getBackgroundPosition() {return $this->readBackgroundPosition();}", "public static function loadBackgroundImages() {\n $dir = scandir('../img/bgs');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/bgs/\" . $file)) {\n $currFileExt = pathinfo(\"../img/bgs/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n\n $counter = 0;\n $middleClass = \"\";\n foreach ($slice as $bg) {\n $counter++;\n if ($counter == 1) {\n ?><div class=\"cs-product-row\"><?php\n }\n if ($counter == 2) {\n $middleClass = \"cs-prd-middle\";\n }\n else {\n $middleClass = \"\";\n }\n ?>\n <?php $bg_index = self::parseInt($bg); ?>\n <div class=\"cs-product pad-bot thumb_za_pozadini <?php echo $middleClass; ?>\"\n index_za_pozadina_e=\"<?php echo $bg_index; ?>\"> \n\n <img src=\"img/bgs/<?php echo $bg ?>\" width=\"97\" height=\"126\" data-bgname=\"<?php echo $bg ?>\" class=\"cs-main-bg\" />\n </div>\n <?php\n if ($counter == 3) {\n ?></div><?php\n $counter = 0;\n }\n }\n }", "function getBackground() {return $this->readBackground();}", "function readBackground() {return $this->_background;}", "function readBackgroundPosition() {return $this->_backgroundposition;}", "function backgroundToImg($htmlContent)\n{\n $regex = '/background-image[ ]{0,}:[ ]{0,}url\\([\\'\"]{0,}(.*?)[\\'\"]{0,}\\)/';\n $htmlContent = str_get_html($htmlContent);\n\n foreach ($htmlContent->find('*') as $element) {\n if (preg_match($regex, $element->style, $matches) > 0) {\n $element->outertext = '<img style=\"display:block;\" src=\"' . $matches[1] . '\" />';\n }\n }\n\n return $htmlContent;\n}", "function had_background($group_id){\n \n $attachment=groups_get_groupmeta($group_id,'background_attachment');\n if(!empty($attachment))\n return true;\n return false;\n \n }", "private function set_background_color()\n {\n imagecolorallocate(\n $this->img,\n L_BACKGROUND_COLOR_R,\n L_BACKGROUND_COLOR_G,\n L_BACKGROUND_COLOR_B\n );\n }", "function get_background() {\r\n return $this->db->get($this->table);\r\n\t}", "function gotravel_mikado_fullscreen_search_styles() {\n\t\t$bg_image = gotravel_mikado_options()->getOptionValue('fullscreen_search_background_image');\n\t\t$selector = '.mkdf-fullscreen-search-holder';\n\t\t$styles = array();\n\n\t\tif(!$bg_image) {\n\t\t\treturn;\n\t\t}\n\n\t\t$styles['background-image'] = 'url('.$bg_image.')';\n\n\t\techo gotravel_mikado_dynamic_css($selector, $styles);\n\t}", "function background_image()\n {\n }", "function remove_custom_background()\n {\n }", "public function getBgImage(){\r\n return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_BG_IMAGE,ScopeInterface::SCOPE_WEBSITE);\r\n }", "function get_background_color()\n {\n }", "function _custom_background_cb()\n {\n }", "protected function parseBackgroundPosition()\r\n {\r\n switch($this->_backgroundposition)\r\n {\r\n case bpLeftTop: return 'left top';\r\n case bpLeftCenter: return 'left center';\r\n case bpLeftBottom: return 'left bottom';\r\n\r\n case bpRightTop: return 'right top';\r\n case bpRightCenter: return 'right center';\r\n case bpRightBottom: return 'right bottom';\r\n\r\n case bpCenterTop: return 'center top';\r\n case bpCenterCenter: return 'center center';\r\n case bpCenterBottom: return 'center bottom';\r\n\r\n default: return $this->_backgroundposition;\r\n }\r\n }", "function cucina_retina_backgrounds(){\n\t$is_retina = (bool) get_theme_mod( 'background_size' );\n\tif ( $is_retina ) {\n\t\t$image = get_background_image();\n\t\tif ( ! $image ){\n\t\t\treturn;\n\t\t}\n\n\t\t$metadata = getimagesize( $image );\n\t\tif ( ! is_array( $metadata ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$width = $metadata[0];\n\t\t$height = $metadata[1];\n\t\tprintf( '<style>body{ background-size: %dpx %dpx; }</style>', $width/2, $height/2 );\n\t}\n}", "function get_background($page_id){\n\n\t$custom_meta = get_post_custom($page_id);\n\t\n\tif(isset($custom_meta['lumen_page_background']) && isset($custom_meta['lumen_page_background'][0]) && $page_id != \"default\"){\n\t\t$background = unserialize($custom_meta['lumen_page_background'][0]);\t\n\t\tif($background['background-color'] == \"\" && $background['background-image'] == \"\") {\n\t\t\t$background = ot_get_option('lumen_site_default_background');\n\t\t}\n\t}\telse {\n\t\t$background = ot_get_option('lumen_site_default_background');\n\t}\n\t\n\t$background_image = \"\";\n\tif(isset($background['background-image'])){\n\t\t$background_image = $background['background-image'];\n\t\tif(strlen($background_image) > 0) {\n\t\t\t$background_image = 'url('.$background_image.')';\n\t\t}\n\t}\n\t\n\t$output = \"\";\n\t$background_repeat = false;\n\t\n\tif(isset($background['background-color'])){ $output .= $background['background-color'].\" \"; }\n\t$output .= $background_image.\" \";\n\tif(isset($background['background-repeat'])){ \n\t\t$output .= $background['background-repeat'].\" \"; \n\t\tif($background['background-repeat'] == \"repeat\"){\n\t\t\t$background_repeat = true;\t\t\n\t\t} \n\t}\n\tif(isset($background['background-attachment'])){ $output .= $background['background-attachment'].\" \"; }\n\tif(isset($background['background-position'])){ $output .= $background['background-position'].\" \"; }\n\t\n\tif(strlen(trim($output)) > 0 && $background_repeat) { \n\t\treturn 'background: '.$output.'; background-size: inherit!important;'; \n\t}else{\n\t\treturn 'background: '.$output; \n\t}\n\t\n\treturn \"\";\n}", "function inject_css(){\n $group_id=bp_get_current_group_id();\n if(empty($group_id))\n return;\n $image=bgclite_get_image($group_id);\n \n if(empty($image)|| apply_filters('bp_group_customizer_iwilldo_it_myself',false))\n return;\n ?>\n <style type=\"text/css\">\n body.is-single-group{\n background:url(<?php echo $image;?>) center top fixed no-repeat,url(\"http://sill-web.de/gzc/wp-content/themes/yoo_master2_wp/css/navy_blue.png\") repeat;\n }\n </style> \n <?php\n\n }", "function bgimg($img){\n\treturn \"background: url('\".$img.\"'); background-size: cover; background-position: 0 50%;\";\n}", "public function get_url_background_pion(){ return $this->_url_background_pion;}", "function catch_that_image() {\n global $post;\n\n $first_img = get_template_directory_uri() . '/img/svg/one.svg';\n\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\n\tif(isset($matches[1][0])) {\n\t\t$first_img = $matches[1][0];\n\t}\n\n return $first_img;\n}", "function readBackgroundRepeat() {return $this->_backgroundrepeat;}", "protected function drawChartImageBackground( &$image ){\n\n\t\tforeach ( $this->testResultRanges as $key => $testResultRange) {\n\n\t\t\t$lastX = NULL;\n\t\t\t$lastY = NULL;\n\n\t\t\t$colorRGB = $this->getChartIndexColor($key);\n\t\t\t$colorBg = imagecolorallocatealpha($image, $colorRGB[0], $colorRGB[1], $colorRGB[2],110);\n\n\t\t\t$bgPoints = array();\n\t\t\tforeach ( $testResultRange as $testResult ){\n\t\t\t\t$newX = intval( $this->transformX( $testResult->getTimestamp() ) );\n\t\t\t\t$newY = intval( $this->transformY( $testResult->getValue() ) );\n\t\t\t\tif( $lastX !== NULL ){\n\n\t\t\t\t\t$bgPoints[] = $lastX;\n\t\t\t\t\t$bgPoints[] = $lastY;\n\t\t\t\t\t$bgPoints[] = $newX;\n\t\t\t\t\t$bgPoints[] = $lastY;\n\t\t\t\t\t$bgPoints[] = $newX;\n\t\t\t\t\t$bgPoints[] = $newY;\n\n\t\t\t\t}\n\n\t\t\t\t$lastX = $newX;\n\t\t\t\t$lastY = $newY;\n\t\t\t}\n\n\t\t\t$bgPoints[] = intval( $this->transformX( $testResultRange->getLast()->getTimestamp() ) );\n\t\t\t$bgPoints[] = intval( $this->transformY( 0 ) );\n\t\t\t$bgPoints[] = intval( $this->transformX( $testResultRange->getFirst()->getTimestamp() ) );\n\t\t\t$bgPoints[] = intval( $this->transformY( 0 ) );\n\n\t\t\t\t// draw filled chart background\n\t\t\tif ( count($bgPoints) > 7 ){\n\t\t\t\timagefilledpolygon ($image, $bgPoints , count($bgPoints)/2 , $colorBg );\n\t\t\t}\n\t\t}\n\t}", "function bethel_get_default_background_args() {\n\treturn array ('default-color' => '#f5f5f5',\n\t\t\t\t 'default-image' => get_stylesheet_directory_uri().'/images/background.jpg',\n\t\t\t\t 'default-repeat' => 'repeat'\n\t );\n}", "function getBackgroundRepeat() {return $this->readBackgroundRepeat();}", "function background_img($link){\n\t\t\t\techo \"<style> body{background: url(\". $link. \");\n\t\t\t\t\t\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t\t\t\t\t\tbackground-size: cover;\n\t\t\t\t\t\t\t\t\t} </style>\";\n\t\t\t}", "function show_background_color()\r\n\t\t{\r\n\t\t\t$image = get_background_image();\r\n\t\t\t/* If there's an image, just call the normal WordPress callback. We won't do anything here. */\r\n\t\t\tif ( !empty( $image ) ) {\r\n\t\t\t\t_custom_background_cb();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t/* Get the background color. */\r\n\t\t\t$color = get_background_color();\r\n\t\t\t/* If no background color, return. */\r\n\t\t\tif ( empty( $color ) )\r\n\t\t\t\treturn;\r\n\t\t\t/* Use 'background' instead of 'background-color'. */\r\n\t\t\t$style = \"background: #{$color};\";\r\n\t\t?>\r\n\t\t\t<style type=\"text/css\">\r\n\t\t\t\tbody.custom-background {\r\n\t\t\t\t\t<?php echo trim( $style );?>\r\n\t\t\t\t}\r\n\t\t\t</style>\r\n\t\t<?php\r\n\t\t}", "public function backgroundScan() {\n\t\t$lastPath = null;\n\t\twhile (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) {\n\t\t\t$this->scan($path, self::SCAN_RECURSIVE, self::REUSE_ETAG);\n\t\t\t$this->cache->correctFolderSize($path);\n\t\t\t$lastPath = $path;\n\t\t}\n\t}", "public function setBackgroundImage($url);", "function backgroundpositions($args) {\r\n\t\t$args['selections'] = $this->background_positions;\r\n\t\t$args['multiple'] = false;\r\n\t\t$args['width'] = '125';\r\n\t\t$args['tooltip'] = 'Choose the background position';\r\n\t\t$this->select($args);\r\n\t}", "function get_the_image_by_scan( $args = array() ) {\n\n\t/* Search the post's content for the <img /> tag and get its URL. */\n\tpreg_match_all( '|<img.*?src=[\\'\"](.*?)[\\'\"].*?>|i', get_post_field( 'post_content', $args['post_id'] ), $matches );\n\n\t/* If there is a match for the image, return its URL. */\n\tif ( isset( $matches ) && !empty( $matches[1][0] ) )\n\t\treturn array( 'src' => $matches[1][0] );\n\n\treturn false;\n}", "public static function FindUnusedImages()\n {\n }", "public static function loadFilterImages() {\n $dir = scandir('../img/effects');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/effects/\" . $file)) {\n $currFileExt = pathinfo(\"../img/effects/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n echo json_encode($slice);\n }", "function background_color()\n {\n }", "function featuredBG($size = 'full', $pos_x = 'center', $pos_y = 'center', $repeat = 'no-repeat'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo 'style=\"background: url('. $url .')'. $pos_x .' '. $pos_y .' ' . $repeat .'\"';\n}", "public function getBackgroundColor() {}", "public function getBackgroundColor() {}", "public function getBackgroundColor() {}", "function shariff3uu_catch_image() {\n\t\t$result = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );\n\t\tif ( array_key_exists( 0, $matches[1] ) ) {\n\t\t\treturn $matches[1][0];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function _custom_header_background_just_in_time()\n {\n }", "function kickstart_background_callback() {\n if ( ! get_background_color() ) {\n return;\n }\n printf( '<style>body { background-color: #%s; }</style>' . \"\\n\", get_background_color() );\n}", "public static function update_background( $input ) {\n global $canvys;\n return array(\n 'source' => cv_filter( $input['source'], array_merge( array_keys( $canvys['bg_patterns'] ), array( 'custom' ) ), 'gplaypattern' ),\n 'color' => cv_filter( $input['color'], 'hex' ),\n 'image' => cv_filter( $input['image'], 'url' ),\n 'style' => cv_filter( $input['style'], array( 'cover', 'tile' ) ),\n 'repeat' => cv_filter( $input['repeat'], array_keys( $canvys['bg_repeat_options'] ) ),\n 'position' => cv_filter( $input['position'], array_keys( $canvys['bg_position_options'] ) ),\n 'preset_attachment' => cv_filter( $input['preset_attachment'], array( 'scroll', 'fixed' ) ),\n 'custom_attachment' => cv_filter( $input['custom_attachment'], array( 'scroll', 'fixed' ) ),\n );\n }", "public function getBackgroundImage()\r\n {\r\n $orientation = $this->getOrientation();\r\n $backgroundImage = '';\r\n /** @var $helperImage Mage_XmlConnect_Helper_Image */\r\n $helperImage = Mage::helper('xmlconnect/image');\r\n\r\n switch ($orientation) {\r\n case Mage_XmlConnect_Helper_Ipad::ORIENTATION_LANDSCAPE:\r\n $configPath = 'conf/body/backgroundIpadLandscapeImage';\r\n $imageUrlOrig = $this->getData($configPath);\r\n if ($imageUrlOrig) {\r\n $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_WIDTH;\r\n $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_HEIGHT;\r\n $backgroundImage = $helperImage->getCustomSizeImageUrl($imageUrlOrig, $width, $height);\r\n } else {\r\n $backgroundImage = $this->getPreviewImagesUrl('ipad/background_home_landscape.jpg');\r\n }\r\n break;\r\n case Mage_XmlConnect_Helper_Ipad::ORIENTATION_PORTRAIT:\r\n $configPath = 'conf/body/backgroundIpadPortraitImage';\r\n $imageUrlOrig = $this->getData($configPath);\r\n if ($imageUrlOrig) {\r\n $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_WIDTH;\r\n $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_HEIGHT;\r\n $backgroundImage = $helperImage->getCustomSizeImageUrl($imageUrlOrig, $width, $height);\r\n } else {\r\n $backgroundImage = $this->getPreviewImagesUrl('ipad/background_portrait.jpg');\r\n }\r\n break;\r\n default:\r\n Mage::throwException(\r\n Mage::helper('xmlconnect')->__('Wrong Ipad background image orientation has been specified: \"%s\".', $orientation)\r\n );\r\n break;\r\n }\r\n return $backgroundImage;\r\n }", "function wprt_background_css( $bg ) {\n\t// Define vars\n\t$css = '';\n\t$bg_style = $bg .'_style';\n\n\tif ( $bg_img = wprt_get_mod( $bg, null ) ) {\n\t\t$css .= 'background-image: url('. esc_url( $bg_img ). ');';\n\t}\n\n\tif ( $bg_style = wprt_get_mod( $bg_style ) ) {\n\t\tif ( 'fixed' == $bg_style ) {\n\t\t\t$css .= ' background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover;';\n\t\t} elseif ( 'fixed-top' == $bg_style ) {\n\t\t\t$css .= ' background-position: center top; background-repeat: no-repeat; background-attachment: fixed; background-size: cover;';\n\t\t} elseif ( 'fixed-bottom' == $bg_style ) {\n\t\t\t$css .= ' background-position: center bottom; background-repeat: no-repeat; background-attachment: fixed; background-size: cover;';\n\t\t} elseif ( 'cover' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: no-repeat; background-position: center center; background-size: cover;';\n\t\t} elseif ( 'center-top' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: no-repeat; background-position: center top;';\n\t\t} elseif ( 'repeat' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: repeat;';\n\t\t} elseif ( 'repeat-x' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: repeat-x;';\n\t\t} elseif ( 'repeat-y' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: repeat-y;';\n\t\t}\n\t}\n\n\treturn esc_attr( $css );\n}", "function hyde_custom_background_cb() {\n\t$background = set_url_scheme( get_background_image() );\n\n\t// $color is the saved custom color.\n\t// A default has to be specified in style.css. It will not be printed here.\n\t$color = get_background_color();\n\n\tif ( $color === get_theme_support( 'custom-background', 'default-color' ) ) {\n\t\t$color = false;\n\t}\n\n\tif ( ! $background && ! $color )\n\t\treturn;\n\n\t$style = $color ? \"background-color: #$color;\" : '';\n\n\tif ( $background ) {\n\t\t$image = \" background-image: url('$background');\";\n\n\t\t$repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );\n\t\tif ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) )\n\t\t\t$repeat = 'repeat';\n\t\t$repeat = \" background-repeat: $repeat;\";\n\n\t\t$position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );\n\t\tif ( ! in_array( $position, array( 'center', 'right', 'left' ) ) )\n\t\t\t$position = 'left';\n\t\t$position = \" background-position: top $position;\";\n\n\t\t$attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );\n\t\tif ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )\n\t\t\t$attachment = 'scroll';\n\t\t$attachment = \" background-attachment: $attachment;\";\n\n\t\t$style .= $image . $repeat . $position . $attachment;\n\t}\n?>\n<style type=\"text/css\" id=\"custom-background-css\">\n.sidebar { <?php echo trim( $style ); ?> }\n</style>\n<?php\n}", "function fanwood_custom_background_callback() {\n\n\t/* Get the background image. */\n\t$image = get_background_image();\n\n\t/* If there's an image, just call the normal WordPress callback. We won't do anything here. */\n\tif ( !empty( $image ) ) {\n\t\t_custom_background_cb();\n\t\treturn;\n\t}\n\n\t/* Get the background color. */\n\t$color = get_background_color();\n\n\t/* If no background color, return. */\n\tif ( empty( $color ) )\n\t\treturn;\n\n\t/* Use 'background' instead of 'background-color'. */\n\t$style = \"background: #{$color};\";\n\n?>\n<style type=\"text/css\">body.custom-background { <?php echo trim( $style ); ?> }</style>\n<?php\n\n}", "function p2_body_class_background_image( $classes ) {\n\t$image = get_option( 'p2_background_image' );\n\n\tif ( empty( $image ) || 'none' == $image )\n\t\treturn $classes;\n\n\t$classes[] = esc_attr( 'p2-background-image-' . $image );\n\n\treturn $classes;\n}", "function extra_custom_background_cb() {\n\t$background = set_url_scheme( get_background_image() );\n\n\t// $color is the saved custom color.\n\t// A default has to be specified in style.css. It will not be printed here.\n\t$color = get_background_color();\n\n\tif ( $color === get_theme_support( 'custom-background', 'default-color' ) ) {\n\t\t$color = false;\n\t}\n\n\tif ( ! $background && ! $color ) {\n\t\treturn;\n\t}\n\n\t$style = $color ? \"background-color: #$color;\" : '';\n\n\tif ( $background ) {\n\t\t$image = \" background-image: url('$background');\";\n\n\t\t$_repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );\n\t\tif ( ! in_array( $_repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) {\n\t\t\t$_repeat = 'repeat';\n\t\t}\n\n\t\t$repeat = \" background-repeat: $_repeat;\";\n\n\t\tif ( 'no-repeat' == $_repeat ) {\n\t\t\t$repeat .= \" background-size: cover;\";\n\t\t}\n\n\t\t$position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );\n\n\t\tif ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) {\n\t\t\t$position = 'left';\n\t\t}\n\n\t\t$position = \" background-position: top $position;\";\n\n\t\t$attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );\n\n\t\tif ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) {\n\t\t\t$attachment = 'scroll';\n\t\t}\n\n\t\t$attachment = \" background-attachment: $attachment;\";\n\n\t\t$style .= $image . $repeat . $position . $attachment;\n\t}\n?>\n<style type=\"text/css\" id=\"extra-custom-background-css\">\nbody.custom-background { <?php echo trim( $style ); ?> }\n</style>\n<?php\n}", "function kdw_row_tiles_txt_img (){ \r\n \r\n}", "function plugin_header_image() {\n\t\t$post_type = get_current_screen()->post_type;\n\n\t\tif ( 'lumo_slide' != $post_type )\n\t\t\treturn;\n?>\n\t\t\t <style type=\"text/css\">\n\t\t\t\t.icon32.icon32-posts-lumo_slide {\n\t\t\t\t background: url(<?php echo plugins_url('/images/projection-screen-32x32.png', __FILE__); ?>) !important;\n\t\t\t\t}\n\t\t\t </style>\n<?php\n\t}", "public function inlineImageExists()\n {\n }", "private function getClassImageURL($root) {\n\t\t// get image url\n\t\t$imageURL = $root->find('header.pad-box-micro div.ribbon-positioner div.featured-course-image span', 0)->getAttribute('style');\n\t\tpreg_match( '/\\((.*?)\\)/', $imageURL, $match);\n\t\tif (isset($match[1])) {\n\t\t\t$imageURL = $this->url . $match[1];\n\t\t}\n\t\t\n\t\treturn $imageURL;\n\t}", "public static function get_bg_image_close() {\n\n\t\t\treturn '</div></div>';\n\n\t\t}", "public function firstImageInContent(){\n if(isset($this->imageFirstInContent)){\n return $this->imageFirstInContent;\n }\n $this->fetchFirstImageInContent();\n return $this->imageFirstInContent;\n }", "function shell_custom_background(){\r\n\r\n\t\t/* Custom Background */\r\n\t\tadd_theme_support( 'custom-background', array( 'default-color' => 'f9f9f9' ) );\r\n\t}", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "private function getImageIntoCss(): void\n {\n preg_match_all(self::REGEX_IMAGE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $sImgPath = PH7_PATH_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n $sImgUrl = PH7_URL_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n\n if ($this->isDataUriEligible($sImgPath)) {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . Optimization::dataUri($sImgPath, $this->oFile) . ')',\n $this->sContents\n );\n } else {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . $sImgUrl . ')',\n $this->sContents\n );\n }\n }\n }", "function parseImages( &$row, $params ){\n\t\t$text = $row->introtext.$row->fulltext;\n\t\t$regex = \"/\\<img.+src\\s*=\\s*\\\"([^\\\"]*)\\\"[^\\>]*\\>/\";\n\t\tpreg_match ($regex, $text, $matches); \n\t\t$images = (count($matches)) ? $matches : array();\n\t\tif (count($images)){\n\t\t\treturn $images[1];\n\t\t}\n\t\treturn ;\n\t}", "protected function getValidBackgroundImage(array $configValues)\n\t{\n\t\t$bgImage = !empty($configValues['bg_image']) ? $configValues['bg_image'] : null;\n\n\t\t// The background images is augmented to a string with the pattern\n\t\t// \"[assets-Folder]::[path/image.ext] so we have to convert the asset\n\t\t// by finding the relative public path\n\t\tif (!empty($bgImage)) {\n\t\t\t// If there is more than one image pick the first as the background\n\t\t\tif (is_array($bgImage))\n\t\t\t\t$bgImage = $bgImage[0];\n\n\t\t\t$bgImage = Asset::find($bgImage);\n\t\t}\n\n\t\treturn $bgImage;\n\t}", "public static function getBackgroundColors() {\n\t\treturn array_keys( self::background_colors );\n\t}", "protected function drawChartImageForeground( &$image ){\n\n\t\tforeach ( $this->testResultRanges as $key => $testResultRange) {\n\n\t\t\t$lastX = NULL;\n\t\t\t$lastY = NULL;\n\n\t\t\t$colorRGB = $this->getChartIndexColor($key);\n\t\t\t$color = imagecolorallocate($image, $colorRGB[0], $colorRGB[1], $colorRGB[2]);\n\n\t\t\t$feLines = array();\n\t\t\tforeach ( $testResultRange as $testResult ){\n\t\t\t\t$newX = intval( $this->transformX( $testResult->getTimestamp() ) );\n\t\t\t\t$newY = intval( $this->transformY( $testResult->getValue() ) );\n\t\t\t\tif( $lastX !== NULL ){\n\t\t\t\t\timageline ( $image , $lastX, $lastY, $newX, $lastY, $color );\n\t\t\t\t\timageline ( $image , $newX, $lastY, $newX, $newY, $color );\n\n\t\t\t\t\t$feLines[] = array($lastX,$lastY,$newX,$lastY);\n\t\t\t\t\t$feLines[] = array($newX,$lastY,$newX,$newY);\n\t\t\t\t}\n\t\t\t\t$lastX = $newX;\n\t\t\t\t$lastY = $newY;\n\t\t\t}\n\n\t\t\t\t// draw line\n\t\t\tif ( count($feLines) > 1 ){\n\t\t\t\tforeach ($feLines as $line){\n\t\t\t\t\timageline ( $image , $line[0], $line[1], $line[2], $line[3], $color );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function has_header_image()\n {\n }", "function dizzy_featured_ogimg () { \n\t $thumb = get_the_post_thumbnail($post->ID);\n\t\t$pattern= \"/(?<=src=['|\\\"])[^'|\\\"]*?(?=['|\\\"])/i\";\n\t\tpreg_match($pattern, $thumb, $thePath);\n\t\t$theSrc = $thePath[0];\n}", "public function setSections() {\n // Background Patterns Reader\n $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/';\n $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/';\n $sample_patterns = array();\n\n if ( is_dir( $sample_patterns_path ) ) :\n\n if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) :\n $sample_patterns = array();\n\n while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {\n\n if ( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {\n $name = explode( '.', $sample_patterns_file );\n $name = str_replace( '.' . end( $name ), '', $sample_patterns_file );\n $sample_patterns[] = array(\n 'alt' => $name,\n 'img' => $sample_patterns_url . $sample_patterns_file\n );\n }\n }\n endif;\n endif;\n\n ob_start();\n\n $ct = wp_get_theme();\n $this->theme = $ct;\n $item_name = $this->theme->get( 'Name' );\n $tags = $this->theme->Tags;\n $screenshot = $this->theme->get_screenshot();\n $class = $screenshot ? 'has-screenshot' : '';\n\n $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;', 'slova' ), $this->theme->display( 'Name' ) );\n\n ?>\n <div id=\"current-theme\" class=\"<?php echo esc_attr( $class ); ?>\">\n <?php if ( $screenshot ) : ?>\n <?php if ( current_user_can( 'edit_theme_options' ) ) : ?>\n <a href=\"<?php echo wp_customize_url(); ?>\" class=\"load-customize hide-if-no-customize\"\n title=\"<?php echo esc_attr( $customize_title ); ?>\">\n <img src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'slova' ); ?>\"/>\n </a>\n <?php endif; ?>\n <img class=\"hide-if-customize\" src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'slova' ); ?>\"/>\n <?php endif; ?>\n\n <h4><?php echo esc_html( $this->theme->display( 'Name' ) ); ?></h4>\n\n <div>\n <ul class=\"theme-info\">\n <li><?php printf( __( 'By %s', 'slova' ), $this->theme->display( 'Author' ) ); ?></li>\n <li><?php printf( __( 'Version %s', 'slova' ), $this->theme->display( 'Version' ) ); ?></li>\n <li><?php echo '<strong>' . __( 'Tags', 'slova' ) . ':</strong> '; ?><?php printf( $this->theme->display( 'Tags' ) ); ?></li>\n </ul>\n <p class=\"theme-description\"><?php echo esc_html( $this->theme->display( 'Description' ) ); ?></p>\n <?php\n if ( $this->theme->parent() ) {\n printf( ' <p class=\"howto\">' . __( 'This <a href=\"%1$s\">child theme</a> requires its parent theme, %2$s.', 'slova' ) . '</p>', __( 'http://codex.wordpress.org/Child_Themes', 'slova' ), $this->theme->parent()->display( 'Name' ) );\n }\n ?>\n\n </div>\n </div>\n\n <?php\n $item_info = ob_get_contents();\n\n ob_end_clean();\n\n $sampleHTML = '';\n if ( file_exists( dirname( __FILE__ ) . '/info-html.html' ) ) {\n Redux_Functions::initWpFilesystem();\n\n global $wp_filesystem;\n\n $sampleHTML = $wp_filesystem->get_contents( dirname( __FILE__ ) . '/info-html.html' );\n }\n\t\t\t\t\n\t\t\t\t$of_options_fontsize = array(\"8px\" => \"8px\", \"9px\" => \"9px\", \"10px\" => \"10px\", \"11px\" => \"11px\", \"12px\" => \"12px\", \"13px\" => \"13px\", \"14px\" => \"14px\", \"15px\" => \"15px\", \"16px\" => \"16px\", \"17px\" => \"17px\", \"18px\" => \"18px\", \"19px\" => \"19px\", \"20px\" => \"20px\", \"21px\" => \"21px\", \"22px\" => \"22px\", \"23px\" => \"23px\", \"24px\" => \"24px\", \"25px\" => \"25px\", \"26px\" => \"26px\", \"27px\" => \"27px\", \"28px\" => \"28px\", \"29px\" => \"29px\", \"30px\" => \"30px\", \"31px\" => \"31px\", \"32px\" => \"32px\", \"33px\" => \"33px\", \"34px\" => \"34px\", \"35px\" => \"35px\", \"36px\" => \"36px\", \"37px\" => \"37px\", \"38px\" => \"38px\", \"39px\" => \"39px\", \"40px\" => \"40px\");\n\t\t\t\t$of_options_font = array(\"1\" => \"Google Font\", \"2\" => \"Standard Font\", \"3\" => \"Custom Font\");\n\t\t\t\t\n\t\t\t\t//Google font API\n\t\t\t\t$of_options_google_font = array();\n\t\t\t\tif (is_admin()) {\n\t\t\t\t\t$results = '';\n\t\t\t\t\t$whitelist = array('127.0.0.1','::1');\n\t\t\t\t\tif(!in_array($_SERVER['REMOTE_ADDR'], $whitelist)){\n\t\t\t\t\t\t$results = wp_remote_get('https://www.googleapis.com/webfonts/v1/webfonts?sort=alpha&key=AIzaSyDnf-ujK_DUCihfvzqdlBokan6zbnrJbi0');\n\t\t\t\t\t\tif (!is_wp_error($results)) {\n\t\t\t\t\t\t\t\t$results = json_decode($results['body']);\n\t\t\t\t\t\t\t\tif(isset($results->items)){\n\t\t\t\t\t\t\t\t\tforeach ($results->items as $font) {\n\t\t\t\t\t\t\t\t\t\t$of_options_google_font[$font->family] = $font->family;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Standard Fonts\n\t\t\t\t$of_options_standard_fonts = array(\n\t\t\t\t\t'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif',\n\t\t\t\t\t\"'Arial Black', Gadget, sans-serif\" => \"'Arial Black', Gadget, sans-serif\",\n\t\t\t\t\t\"'Bookman Old Style', serif\" => \"'Bookman Old Style', serif\",\n\t\t\t\t\t\"'Comic Sans MS', cursive\" => \"'Comic Sans MS', cursive\",\n\t\t\t\t\t\"Courier, monospace\" => \"Courier, monospace\",\n\t\t\t\t\t\"Garamond, serif\" => \"Garamond, serif\",\n\t\t\t\t\t\"Georgia, serif\" => \"Georgia, serif\",\n\t\t\t\t\t\"Impact, Charcoal, sans-serif\" => \"Impact, Charcoal, sans-serif\",\n\t\t\t\t\t\"'Lucida Console', Monaco, monospace\" => \"'Lucida Console', Monaco, monospace\",\n\t\t\t\t\t\"'Lucida Sans Unicode', 'Lucida Grande', sans-serif\" => \"'Lucida Sans Unicode', 'Lucida Grande', sans-serif\",\n\t\t\t\t\t\"'MS Sans Serif', Geneva, sans-serif\" => \"'MS Sans Serif', Geneva, sans-serif\",\n\t\t\t\t\t\"'MS Serif', 'New York', sans-serif\" => \"'MS Serif', 'New York', sans-serif\",\n\t\t\t\t\t\"'Palatino Linotype', 'Book Antiqua', Palatino, serif\" => \"'Palatino Linotype', 'Book Antiqua', Palatino, serif\",\n\t\t\t\t\t\"Tahoma, Geneva, sans-serif\" => \"Tahoma, Geneva, sans-serif\",\n\t\t\t\t\t\"'Times New Roman', Times, serif\" => \"'Times New Roman', Times, serif\",\n\t\t\t\t\t\"'Trebuchet MS', Helvetica, sans-serif\" => \"'Trebuchet MS', Helvetica, sans-serif\",\n\t\t\t\t\t\"Verdana, Geneva, sans-serif\" => \"Verdana, Geneva, sans-serif\"\n\t\t\t\t);\n\t\t\t\t// Custom Font\n\t\t\t\t$fonts = array();\n\t\t\t\t$of_options_custom_fonts = array();\n\t\t\t\t$font_path = get_template_directory() . \"/fonts\";\n\t\t\t\tif (!$handle = opendir($font_path)) {\n\t\t\t\t\t$fonts = array();\n\t\t\t\t} else {\n\t\t\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\t\t\tif (strpos($file, \".ttf\") !== false ||\n\t\t\t\t\t\t\tstrpos($file, \".eot\") !== false ||\n\t\t\t\t\t\t\tstrpos($file, \".svg\") !== false ||\n\t\t\t\t\t\t\tstrpos($file, \".woff\") !== false\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$fonts[] = $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($handle);\n\n\t\t\t\tforeach ($fonts as $font) {\n\t\t\t\t\t$font_name = str_replace(array('.ttf', '.eot', '.svg', '.woff'), '', $font);\n\t\t\t\t\t$of_options_custom_fonts[$font_name] = $font_name;\n\t\t\t\t}\n\t\t\t\t/* remove dup item */\n\t\t\t\t$of_options_custom_fonts = array_unique($of_options_custom_fonts);\n\t\t\t\t\n\t\t\t\t/*Sidebar option*/\n\t\t\t\t$of_options_sidebar = array(\"Main Sidebar\" => \"Main Sidebar\", \"Blog Left Sidebar\" => \"Blog Left Sidebar\", \"Blog Right Sidebar\" => \"Blog Right Sidebar\", \"Custom Sidebar 1\" => \"Custom Sidebar 1\", \"Custom Sidebar 2\" => \"Custom Sidebar 2\", \"Custom Sidebar 3\" => \"Custom Sidebar 3\", \"Custom Sidebar 4\" => \"Custom Sidebar 4\");\n\t\t\t\t\n\t\t\t\t/*General Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'General Setting', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-cogs',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n 'id' => 'tb_less',\n 'type' => 'switch',\n 'title' => __( 'Less Design', 'slova' ),\n 'subtitle' => __( 'Use the less design features.', 'slova' ),\n\t\t\t\t\t\t\t'default' => false,\n ),\n array(\n 'id' => 'tb_smoothscroll',\n 'type' => 'switch',\n 'title' => __( 'Smoothscroll', 'slova' ),\n 'subtitle' => __( 'Use the smoothscroll in your site.', 'slova' ),\n 'default' => true,\n ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_background',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Body Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Body background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#ffffff',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Logo*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Logo', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-viadeo',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_favicon_image',\n\t\t\t\t\t\t\t'type' => 'media',\n\t\t\t\t\t\t\t'url' => true,\n\t\t\t\t\t\t\t'title' => __('Favicon Image', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select an image file for your favicon.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'url'\t=> URI_PATH.'/favicon.ico'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_logo_image',\n\t\t\t\t\t\t\t'type' => 'media',\n\t\t\t\t\t\t\t'url' => true,\n\t\t\t\t\t\t\t'title' => __('Logo Image', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select an image file for your logo.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'url'\t=> URI_PATH.'/assets/images/logo.png'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Header*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Header', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-file-edit',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_manage_location',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Manage Location', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select manage location of menu in this header.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'' => 'Auto Navigation',\n\t\t\t\t\t\t\t\t'main_navigation' => 'Main Navigation',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_stick_header',\n 'type' => 'switch',\n 'title' => __( 'Stick Header', 'slova' ),\n 'subtitle' => __( 'Enable a fixed header when scrolling.', 'slova' ),\n\t\t\t\t\t\t\t'default' => false,\n ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Main Menu*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Main Menu', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-list',\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'First Level', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_first_level_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'letter-spacing' => true,\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#fff', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Roboto', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '16px', \n\t\t\t\t\t\t\t\t'line-height' => '90px',\n\t\t\t\t\t\t\t\t'letter-spacing' => '0.2px'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_first_level_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'padding',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '0px', \n\t\t\t\t\t\t\t\t'padding-right' => '15px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '0px', \n\t\t\t\t\t\t\t\t'padding-left' => '15px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Sub Level', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_sub_level_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'letter-spacing' => true,\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#fff', \n\t\t\t\t\t\t\t\t'font-style' => '400', \n\t\t\t\t\t\t\t\t'font-family' => 'Roboto', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '14px', \n\t\t\t\t\t\t\t\t'line-height' => '26.4px',\n\t\t\t\t\t\t\t\t'letter-spacing' => '0.2px'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_sub_level_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'padding',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '10px', \n\t\t\t\t\t\t\t\t'padding-right' => '10px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '10px', \n\t\t\t\t\t\t\t\t'padding-left' => '20px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Footer*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Footer', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-file-edit',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#000000',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array('.ro-footer'),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Footer Top', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#000000',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_margin',\n\t\t\t\t\t\t\t'title' => __('Margin', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter margin.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'margin',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'margin-top' => '60px', \n\t\t\t\t\t\t\t\t'margin-right' => '0px', \n\t\t\t\t\t\t\t\t'margin-bottom' => '0px', \n\t\t\t\t\t\t\t\t'margin-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '90px', \n\t\t\t\t\t\t\t\t'padding-right' => '0px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '60px', \n\t\t\t\t\t\t\t\t'padding-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_text_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Text Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the text color. (default: #EEEEEE).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#EEEEEE',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-top'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_heading_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Heading Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the headings color. (default: #FFFFFF).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#FFFFFF',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-top h1,.ro-footer .ro-footer-top h2,.ro-footer .ro-footer-top h3,.ro-footer .ro-footer-top h4,.ro-footer .ro-footer-top h5,.ro-footer .ro-footer-top h6'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_link_color',\n\t\t\t\t\t\t\t'type' => 'link_color',\n\t\t\t\t\t\t\t'title' => __('Links Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the link color. (default: #FFFFFF).', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'regular' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'hover' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'active' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'visited' => '#FFFFFF',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-top a'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_column',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Footer Top Columns', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select column of footer top.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1' => '1 Column',\n\t\t\t\t\t\t\t\t'2' => '2 Columns',\n\t\t\t\t\t\t\t\t'3' => '3 Columns',\n\t\t\t\t\t\t\t\t'4' => '4 Columns'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '4',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col1',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 1', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','1')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col2',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 2', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','2')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col3',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 3', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','3')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_top_col4',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Top Column 4', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-3 col-lg-3',\n\t\t\t\t\t\t\t'required' => array('tb_footer_top_column','>=','4')\n\t\t\t\t\t\t),\n\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Footer Bottom', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#000000',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_margin',\n\t\t\t\t\t\t\t'title' => __('Margin', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter margin.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'margin',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'margin-top' => '0px', \n\t\t\t\t\t\t\t\t'margin-right' => '0px', \n\t\t\t\t\t\t\t\t'margin-bottom' => '0px', \n\t\t\t\t\t\t\t\t'margin-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_padding',\n\t\t\t\t\t\t\t'title' => __('Padding', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array(''),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '30px', \n\t\t\t\t\t\t\t\t'padding-right' => '0px', \n\t\t\t\t\t\t\t\t'padding-bottom' => '30px', \n\t\t\t\t\t\t\t\t'padding-left' => '0px',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_text_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Text Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the text color. (default: #EEEEEE).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#EEEEEE',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-bottom'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_heading_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Heading Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the headings color. (default: #CCCCCC).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#CCCCCC',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-bottom h1,.ro-footer .ro-footer-bottom h2,.ro-footer .ro-footer-bottom h3,.ro-footer .ro-footer-bottom h4,.ro-footer .ro-footer-bottom h5,.ro-footer .ro-footer-bottom h6'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_link_color',\n\t\t\t\t\t\t\t'type' => 'link_color',\n\t\t\t\t\t\t\t'title' => __('Links Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls the link color. (default: #FFFFFF).', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'regular' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'hover' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'active' => '#FFFFFF',\n\t\t\t\t\t\t\t\t'visited' => '#FFFFFF',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'output' => array('.ro-footer .ro-footer-bottom a'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_column',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Footer Bottom Columns', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select column of footer bottom.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1' => '1 Column',\n\t\t\t\t\t\t\t\t'2' => '2 Columns'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '2',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_col1',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Bottom Column 1', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-6 col-lg-6 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-6 col-lg-6',\n\t\t\t\t\t\t\t'required' => array('tb_footer_bottom_column','>=','1')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_footer_bottom_col2',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Footer Bottom Column 2', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-6 col-lg-6 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-6 col-md-6 col-lg-6',\n\t\t\t\t\t\t\t'required' => array('tb_footer_bottom_column','>=','2')\n\t\t\t\t\t\t),\n\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Styling Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Styling Options', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-tint',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_primary_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Primary Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls several items, ex: link hovers, highlights, and more. (default: #a360ff).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#a360ff',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_secondary_color',\n\t\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t\t'title' => __('Secondary Color', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Controls several items, ex: link hovers, highlights, and more. (default: #0084ff).', 'slova'),\n\t\t\t\t\t\t\t'default' => '#0084ff',\n\t\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Typography Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Typography', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-font',\n 'fields' => array(\n\t\t\t\t\t\t/*Body font*/\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_body_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Body Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '400',\n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '14px', \n\t\t\t\t\t\t\t\t'line-height' => '23px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h1_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H1 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h1, .ro-font-size-1'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '42px', \n\t\t\t\t\t\t\t\t'line-height' => '46.2px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h2_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H2 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h2, .ro-font-size-2'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '36px', \n\t\t\t\t\t\t\t\t'line-height' => '39.6px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h3_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H3 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h3, .ro-font-size-3'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '24px', \n\t\t\t\t\t\t\t\t'line-height' => '26.4px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h4_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H4 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h4, .ro-font-size-4'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '18px', \n\t\t\t\t\t\t\t\t'line-height' => '19.8px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h5_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H5 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h5, .ro-font-size-5'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '16px', \n\t\t\t\t\t\t\t\t'line-height' => '17.6px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_h6_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('H6 Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('body h6, .ro-font-size-6'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#2d3745', \n\t\t\t\t\t\t\t\t'font-style' => '700', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '14px', \n\t\t\t\t\t\t\t\t'line-height' => '15.4px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_special_font',\n\t\t\t\t\t\t\t'type' => 'typography', \n\t\t\t\t\t\t\t'title' => __('Special Font Options', 'slova'),\n\t\t\t\t\t\t\t'google' => true, \n\t\t\t\t\t\t\t'font-backup' => true,\n\t\t\t\t\t\t\t'output' => array('.ro-special-font'),\n\t\t\t\t\t\t\t'units' =>'px',\n\t\t\t\t\t\t\t'subtitle' => __('Typography option with each property can be called individually.', 'slova'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'color' => '#333', \n\t\t\t\t\t\t\t\t'font-style' => '400', \n\t\t\t\t\t\t\t\t'font-family' => 'Lato', \n\t\t\t\t\t\t\t\t'google' => true,\n\t\t\t\t\t\t\t\t'font-size' => '13px', \n\t\t\t\t\t\t\t\t'line-height' => '15.4px',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Title Bar Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Title Bar', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-livejournal',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_page_title_bg',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Page Title Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'output' => array('.ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#aaaaaa',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_page_title_bar_margin',\n\t\t\t\t\t\t\t'title' => 'Page Title Margin',\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter margin of page title bar.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'margin',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array('.ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'margin-top' => '0', \n\t\t\t\t\t\t\t\t'margin-right' => '0', \n\t\t\t\t\t\t\t\t'margin-bottom' => '0', \n\t\t\t\t\t\t\t\t'margin-left' => '0',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_page_title_bar_padding',\n\t\t\t\t\t\t\t'title' => 'Page Title Padding',\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter padding of page title bar.', 'slova'),\n\t\t\t\t\t\t\t'type' => 'spacing',\n\t\t\t\t\t\t\t'mode' => 'padding',\n\t\t\t\t\t\t\t'units' => array('px'),\n\t\t\t\t\t\t\t'output' => array('.ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'padding-top' => '160px', \n\t\t\t\t\t\t\t\t'padding-right' => '0', \n\t\t\t\t\t\t\t\t'padding-bottom' => '20px', \n\t\t\t\t\t\t\t\t'padding-left' => '0',\n\t\t\t\t\t\t\t\t'units' => 'px', \n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Post Setting*/\n\t\t\t\t$this->sections[] = array(\n\t\t\t\t\t'title' => __( 'Post Setting', 'slova' ),\n\t\t\t\t\t'desc' => __( '', 'slova' ),\n\t\t\t\t\t'icon' => 'el-icon-file-edit',\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Title Bar', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_title_bar_background',\n\t\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t\t'title' => __('Background', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('background with image, color, etc.', 'slova'),\n\t\t\t\t\t\t\t'output' => array('.single .ro-section-title-bar, .archive .ro-section-title-bar, .search .ro-section-title-bar, .error404 .ro-section-title-bar'),\n\t\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t\t'background-color' => '#ffffff',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_page_title',\n 'type' => 'switch',\n 'title' => __( 'Show Page Title', 'slova' ),\n 'subtitle' => __( 'Show page title in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_page_breadcrumb',\n 'type' => 'switch',\n 'title' => __( 'Show Page Breadcrumb', 'slova' ),\n 'subtitle' => __( 'Show page breadcrumb in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Blog Post', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t'id' => 'tb_blog_layout',\n\t\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t\t'title' => __('Select Layout', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select layout of blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1col'\t=> array(\n\t\t\t\t\t\t\t\t\t\t'alt' => '1col',\n\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/1col.png'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cl'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cl',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cl.png'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cr'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cr',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cr.png'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '2cr'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_left_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Left', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar left in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_left_sidebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Sidebar Left Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_content_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Content Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-8 col-md-8 col-lg-8'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_right_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Right', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar right in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_blog_right_siedebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Sidebar Right Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_image',\n 'type' => 'switch',\n 'title' => __( 'Show Featured Image', 'slova' ),\n 'subtitle' => __( 'Show or not featured image of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_title',\n 'type' => 'switch',\n 'title' => __( 'Show Title', 'slova' ),\n 'subtitle' => __( 'Show or not title of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_meta',\n 'type' => 'switch',\n 'title' => __( 'Show Meta', 'slova' ),\n 'subtitle' => __( 'Show or not meta of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_show_post_excerpt',\n 'type' => 'switch',\n 'title' => __( 'Show Excerpt', 'slova' ),\n 'subtitle' => __( 'Show or not excerpt of post in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ), \n\t\t\t\t\t\tarray(\n 'id' => 'tb_blog_post_readmore_text',\n 'type' => 'text',\n 'title' => __( 'Read More Text', 'slova' ),\n 'subtitle' => __( 'Enter text of label button read more in blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => 'Read more',\n ),\n\t\t\t\t\t) \n\t\t\t\t);\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Single Post', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => '',\n\t\t\t\t\t'subsection' => true,\n 'fields' => array(\n\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t'id' => 'tb_post_layout',\n\t\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t\t'title' => __('Select Layout', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select layout of single blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'1col'\t=> array(\n\t\t\t\t\t\t\t\t\t\t'alt' => '1col',\n\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/1col.png'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cl'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cl',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cl.png'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'2cr'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'alt' => '2cr',\n\t\t\t\t\t\t\t\t\t\t\t'img' => URI_PATH_ADMIN.'/assets/images/2cr.png'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => '2cr'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_left_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Left', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar left in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_post_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_left_sidebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Left Sidebar Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_post_layout','=', '2cl')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_content_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Content Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-8 col-md-8 col-lg-8',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_right_sidebar',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Sidebar Right', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Select sidebar right in blog.', 'slova'),\n\t\t\t\t\t\t\t'options' => $of_options_sidebar,\n\t\t\t\t\t\t\t'default' => 'Main Sidebar',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'tb_post_right_siedebar_col',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Right Sidebar Column', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Please, Enter class bootstrap and extra class. Ex: col-xs-12 col-sm-6 col-md-3 col-lg-3 el-class.', 'slova'),\n\t\t\t\t\t\t\t'default' => 'col-xs-12 col-sm-4 col-md-4 col-lg-4',\n\t\t\t\t\t\t\t'required' => array('tb_blog_layout','=', '2cr')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_image',\n 'type' => 'switch',\n 'title' => __( 'Show Featured Image', 'slova' ),\n 'subtitle' => __( 'Show or not featured image of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_title',\n 'type' => 'switch',\n 'title' => __( 'Show Title', 'slova' ),\n 'subtitle' => __( 'Show or not title of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_meta',\n 'type' => 'switch',\n 'title' => __( 'Show Meta', 'slova' ),\n 'subtitle' => __( 'Show or not meta of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_desc',\n 'type' => 'switch',\n 'title' => __( 'Show Description', 'slova' ),\n 'subtitle' => __( 'Show or not description of post on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray( \n 'id' => 'tb_post_show_post_nav',\n 'type' => 'switch',\n 'title' => __( 'Show Navigation', 'slova' ),\n 'subtitle' => __( 'Show or not post navigation on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_tags',\n 'type' => 'switch',\n 'title' => __( 'Show Tags', 'slova' ),\n 'subtitle' => __( 'Show or not post tags on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_author',\n 'type' => 'switch',\n 'title' => __( 'Show Author', 'slova' ),\n 'subtitle' => __( 'Show or not post author on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_post_show_post_comment',\n 'type' => 'switch',\n 'title' => __( 'Show Comment', 'slova' ),\n 'subtitle' => __( 'Show or not post comment on your single blog.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t/*Page Setting*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Page Setting', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-list-alt',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n 'id' => 'tb_page_show_page_title',\n 'type' => 'switch',\n 'title' => __( 'Show Page Title', 'slova' ),\n 'subtitle' => __( 'Show page title in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_page_show_page_breadcrumb',\n 'type' => 'switch',\n 'title' => __( 'Show Page Breadcrumb', 'slova' ),\n 'subtitle' => __( 'Show page breadcrumb in page title bar.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n ),\n\t\t\t\t\t\tarray(\n 'id' => 'tb_page_show_page_comment',\n 'type' => 'switch',\n 'title' => __( 'Show Page Comment', 'slova' ),\n 'subtitle' => __( 'Show or not page comment on your page.', 'slova' ),\n\t\t\t\t\t\t\t'default' => true,\n )\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Custom CSS*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Custom CSS', 'slova' ),\n 'desc' => __( '', 'slova' ),\n 'icon' => 'el-icon-css',\n 'fields' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'custom_css_code',\n\t\t\t\t\t\t\t'type' => 'ace_editor',\n\t\t\t\t\t\t\t'title' => __('Custom CSS Code', 'slova'),\n\t\t\t\t\t\t\t'subtitle' => __('Quickly add some CSS to your theme by adding it to this block..', 'slova'),\n\t\t\t\t\t\t\t'mode' => 'css',\n\t\t\t\t\t\t\t'theme' => 'monokai',\n\t\t\t\t\t\t\t'default' => '@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,500,700); @import url(https://fonts.googleapis.com/css?family=Raleway:400,300,600,700,500);'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t/*Import / Export*/\n\t\t\t\t$this->sections[] = array(\n 'title' => __( 'Import / Export', 'slova' ),\n 'desc' => __( 'Import and Export your Redux Framework settings from file, text or URL.', 'slova' ),\n 'icon' => 'el-icon-refresh',\n 'fields' => array(\n array(\n 'id' => 'tb_import_export',\n 'type' => 'import_export',\n 'title' => 'Import Export',\n 'subtitle' => 'Save and restore your Redux options',\n 'full_width' => false,\n ),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'id' => 'tb_import',\n\t\t\t\t\t\t\t'type' => 'js_button',\n\t\t\t\t\t\t\t'title' => 'Auto Setup.',\n\t\t\t\t\t\t\t'subtitle' => __('Tools > Content Demo Install.', 'slova'),\n\t\t\t\t\t\t),\n ),\n );\n\t\t\t\t\n }", "function fa_detect_image( $content ){\n\t// check for images in text\n\tpreg_match_all(\"#\\<img(.*)src\\=(\\\"|\\')(.*)(\\\"|\\')(/?[^\\>]+)?\\>#Ui\", $content, $matches);\n\t// no image is available\n\tif( !isset($matches[0][0]) ){ \n\t\treturn false;\n\t}\n\t\n\t$result = array(\n\t\t'img' \t=> false, \n\t\t'id' \t=> false\n\t);\n\t\n\t// get image attributes in order to determine the attachment guid\n\tpreg_match_all(\"#([a-z]+)=\\\"(.*)\\\"#Ui\", $matches[0][0], $attrs);\n\t$inversed = array_flip( $attrs[1] );\n\t\n\t// if image doesn't have width/height attributes set on it, there's no point in going further\n\tif( !array_key_exists( 'width', $inversed ) || !array_key_exists( 'height', $inversed ) ){\n\t\t$result['img'] = $matches[3][0];\n\t\treturn $result;\n\t}\n\t\n\t// image attributes hold the image URL. Replace those to get the real image guid\n\t$img_size_url = '-'.$attrs[2][$inversed['width']].'x'.$attrs[2][$inversed['height']];\n\t$real_image_guid = str_replace( $img_size_url, '', $matches[3][0] );\n\t\n\tglobal $wpdb;\n\t$the_image = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT * FROM $wpdb->posts WHERE guid = '%s' AND post_type='attachment'\", \n\t\t\t$real_image_guid \n\t\t) \n\t);\n\t// create the result\n\t$result['img'] = $matches[3][0];\n\t// if image was found, add the image ID to the result\n\tif( $the_image ){\n\t\t$result['id'] = $the_image->ID;\t\t\t\t\n\t}\n\treturn $result;\t\n}", "public function setOnBoardImgs(){\n $onBoardImgs=\"\";\n $onBoardImgs.=$this->getMarkerTag($this->filePathFocus,$this->markerImage,$this->markerAt);\n if(!empty($this->sOnBoard)){\n $komas=explode(\",\",$this->sOnBoard);\n foreach($komas as $koma){$onBoardImgs.=$this->getImageTag($koma,\"S\",$this->filePathKoma);}\n }\n\n if(!empty($this->gOnBoard)){\n $komas=explode(\",\",$this->gOnBoard);\n foreach($komas as $koma){$onBoardImgs.=$this->getImageTag($koma,\"G\",$this->filePathKoma);}\n }\n return $onBoardImgs;\n }", "function vibe_custom_background_cb(){\n $background = set_url_scheme( get_background_image() );\n\n // $color is the saved custom color.\n // A default has to be specified in style.css. It will not be printed here.\n $color = get_theme_mod( 'background_color' );\n\n if ( ! $background && ! $color )\n return;\n\n $style = $color ? \"background-color: #$color;\" : '';\n\n if ( $background ) {\n $image = \" background-image: url('$background');\";\n\n $repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );\n if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) )\n $repeat = 'repeat';\n $repeat = \" background-repeat: $repeat;\";\n\n $position = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );\n if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) )\n $position = 'left';\n $position = \" background-position: top $position;\";\n\n $attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );\n if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )\n $attachment = 'scroll';\n $attachment = \" background-attachment: $attachment;\";\n\n $style .= $image . $repeat . $position . $attachment;\n\n echo '\n <div id=\"background_fixed\">\n <img src=\"'.$background.'\" />\n </div>\n <style type=\"text/css\">\n #background_fixed{position: fixed;top:0;left:0;width:200%;height:200%;}\n </style>\n ';\n }\n\n}", "public static function edit_image()\n{\n\n\n\t/*\n\t* Change Background\n\t*/\n\n\t/*\n\t* Change other setting\n\t*/\n}", "public function determineBorder()\n {\n $level = $this->summonerLevel;\n $borders = Storage::disk('public')->allFiles('borders');\n $borders = collect($borders)->map(function ($item) {\n preg_match('/\\d+/', $item, $res);\n $res = (int)$res[0];\n return $res;\n });\n $borders = $borders->sort()->values()->all();\n $current = $borders[0];\n foreach ($borders as $border) {\n if ($border > $level)\n break;\n $current = $border;\n }\n $url = Storage::disk('public')->url('borders/'.$current.'.png');\n $this->border = $url;\n $this->save();\n return $url;\n }", "protected function collectTcaSpriteIcons() {}", "function catch_that_image() {\n global $post, $posts;\n $first_img = '';\n ob_start();\n ob_end_clean();\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n $first_img = $matches [1] [0];\n\n if(empty($first_img)){ //Defines a default image\n $first_img = \"http://seattletimes.nwsource.com/art/ui/fb_icon_sm.jpg\";\n }\n return $first_img;\n}", "public function ajax_background_add()\n {\n }", "public function hasLogo() {\n return $this->_has(8);\n }", "private function _addLines() {\r\n\t\t// Reset line thickness to one pixel.\r\n\t\timagesetthickness($this->_resource, 1);\r\n\t\t\r\n\t\t// Reset foreground color to default. \r\n\t\t$foreground = imagecolorallocate($this->_resource, $this->_fg_color['R'], $this->_fg_color['G'], $this->_fg_color['B']);\r\n\t\t\r\n\t\t// Get dimension of image\r\n\t\t$width = imagesx($this->_resource);\r\n\t\t$height = imagesy($this->_resource);\r\n\t\t\r\n\t\tfor ($i = 0; $i < abs($this->_linesModifier); $i++) {\r\n\t\t\t// Set random foreground color if desired.\r\n\t\t\t($this->useRandomColorLines) ? $foreground = $this->_setRandomColor() : null;\r\n\t\t\t\r\n\t\t\t// Add some randomly colored lines.\r\n\t\t\timageline($this->_resource, 0, rand(0, $height), $width, rand(0, $height), $foreground); // horizontal\r\n\t\t\timageline($this->_resource, rand(0, $width), 0, rand(0, $width), $height, $foreground); // vertical\r\n\t\t}\r\n\t}", "function catch_that_image($post_content) {\r\n\t$first_img = '';\r\n\tob_start();\r\n\tob_end_clean();\r\n\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post_content, $matches);\r\n\t$first_img = $matches [1] [0];\r\n\t//echo '<pre>';print_r($matches);echo '</pre>';\r\n\tif(empty($first_img)){ //Defines a default image\r\n\t\t$first_img = \"http://placehold.it/250x250\";\r\n\t}\r\n\treturn $first_img;\r\n}", "protected function processImage() {}", "public function convertBackgroundImage($css)\n {\n if ($css=='none')\n return null;\n else if (preg_match('/^url\\(([^)]*)\\)$/isU', $css, $match))\n return $match[1];\n else\n return null;\n }", "protected function getGetImgResourceHookObjects() {}", "public static function page_header_background() {\n\t\t$post_id = wpv_get_the_ID();\n\n\t\tif( is_null($post_id) || !self::has_page_header() || is_archive() || is_search() || ! is_singular() )\n\t\t\treturn '';\n\n\t\t$bgcolor = wpv_sanitize_accent(wpv_post_meta($post_id, 'local-page-title-background-color', true));\n\t\t$bgimage = wpv_post_meta($post_id, 'local-page-title-background-image', true);\n\t\t$bgrepeat = wpv_post_meta($post_id, 'local-page-title-background-repeat', true);\n\t\t$bgsize = wpv_post_meta($post_id, 'local-page-title-background-size', true);\n\t\t$bgattachment = wpv_post_meta($post_id, 'local-page-title-background-attachment', true);\n\t\t$bgposition = wpv_post_meta($post_id, 'local-page-title-background-position', true);\n\n\t\t$style = '';\n\t\tif(!empty($bgcolor)) {\n\t\t\t$style .= \"background-color:$bgcolor;\";\n\n\t\t\tif(empty($bgimage)) {\n\t\t\t\t$style .= \"background-image:none;\";\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($bgimage)) {\n\t\t\t$style .= \"background-image:url('$bgimage');\";\n\t\t\tif(!empty($bgrepeat))\n\t\t\t\t$style .= \"background-repeat:$bgrepeat;\";\n\t\t\tif(!empty($bgsize))\n\t\t\t\t$style .= \"background-size:$bgsize;\";\n\t\t\tif(!empty($bgattachment))\n\t\t\t\t$style .= \"background-attachment:$bgattachment;\";\n\t\t}\n\n\t\treturn $style;\n\t}", "public function mainImage()\n {\n return $this->images()->where('main_img', '=', '1');\n }", "private static function background($im, int $width, int $height) {\n $path = __DIR__ . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'bgs' . DIRECTORY_SEPARATOR;\n $dir = dir($path);\n\n $bgs = [];\n while (false !== ($file = $dir->read())) {\n if ('.' != $file[0] && substr($file, -4) == '.jpg') {\n $bgs[] = $path . $file;\n }\n }\n $dir->close();\n\n $gb = $bgs[array_rand($bgs)];\n\n list($w, $h) = @getimagesize($gb);\n // Resample\n $bgImage = @imagecreatefromjpeg($gb);\n @imagecopyresampled($im, $bgImage, 0, 0, 0, 0, $width, $height, $w, $h);\n }", "public function getBackgroundColors() {\n return array_keys($this->background_colors);\n }", "public function getBackgroundColorIndex()\n {\n if ($this->logicalScreenDescriptor) {\n $index = substr($this->logicalScreenDescriptor, 5, 1);\n $index = unpack('C', $index)[1];\n\n return $index;\n }\n\n return 0;\n }", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "public static function getBackgroundById($id)\n {\n\t\t$key = 'BackgroundById_' . $id;\n\t\t$cache = Hapyfish_Cache_Memcached::getInstance();\n\t\t$background = $cache->get($key);\n\t\tif ($background === false) {\n\t\t\t//load from database\n\t\t\t$db = Hapyfish_Island_Dal_Background::getDefaultInstance();\n\t\t\t$background = $db->getBackgroundById($id);\n\t\t\tif ($background) {\n\t\t\t\t$cache->add($key, $background, Hapyfish_Cache_Memcached::LIFE_TIME_ONE_MONTH);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $background;\n }", "protected function getLiipImagine_Filter_Loader_BackgroundService()\n {\n return $this->services['liip_imagine.filter.loader.background'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\BackgroundFilterLoader($this->get('liip_imagine'));\n }", "function fluid_edge_404_footer_top_general_styles() {\n $background_color = fluid_edge_options()->getOptionValue('404_page_background_color');\n\t $background_image = fluid_edge_options()->getOptionValue('404_page_background_image');\n\t $pattern_background_image = fluid_edge_options()->getOptionValue('404_page_background_pattern_image');\n \t\n \t$item_styles = array();\n if(!empty($background_color)) {\n $item_styles['background-color'] = $background_color;\n }\n\n if (!empty($background_image)) {\n $item_styles['background-image'] = 'url('.$background_image.')';\n $item_styles['background-position'] = 'center 0';\n $item_styles['background-size'] = 'cover';\n $item_styles['background-repeat'] = 'no-repeat';\n }\n\n if (!empty($pattern_background_image)) {\n $item_styles['background-image'] = 'url('.$pattern_background_image.')';\n $item_styles['background-position'] = '0 0';\n $item_styles['background-repeat'] = 'repeat';\n }\n\t\n\t $item_selector = array(\n\t\t '.edgtf-404-page .edgtf-content'\n\t );\n\n echo fluid_edge_dynamic_css($item_selector, $item_styles);\n }", "function get_block_core_post_featured_image_border_attributes($attributes)\n {\n }", "private function processImageStack() {\n\n foreach($this->imagePath as $imagePath) {\n $this->processSingleImage($imagePath);\n }\n }", "public function getImageIdsThatExistInTutorial($img_rows){\n if(!$img_rows) return array();\n $this->db->select('IMAGE_ID');\n $img_ids = $this->imageModel->getIdsFromRows($img_rows);\n $this->db->where_in('IMAGE_ID', $img_ids);\n $q = $this->db->get(TutorialModel::$TutorialTableName);\n $r = $q->result_array();\n $output = array();\n foreach($r as $row){\n $output[$row['IMAGE_ID']] = true;\n }\n \n foreach($img_rows as $row){\n if(array_key_exists($row['IMAGE_ID'], $output)){\n continue;//already exists in the tutorial image\n }else{\n //see if the url exists in the introduction section of a tutorial teached by the owner\n $owner = $row['OWNER'];\n $url = $row['URL'];\n $img_id = $row['IMAGE_ID'];\n $this->db->select('TUTORIAL_ID');\n $this->db->like('INTRODUCTION', $url);\n $q = $this->db->get_where(TutorialModel::$TutorialTableName, array('TEACHER_ACCOUNT'=>$owner), 1, 0);\n if ($q->num_rows() > 0){\n $output[$img_id] = true;\n }\n }\n }\n return $output;\n }", "public function getBackgroundColors(): array\n {\n\t\treturn array_keys($this->backgroundColors);\n\t}", "public function getBackgroundColors() {\n\t\treturn array_keys($this->background_colors);\n\t}" ]
[ "0.63266754", "0.61262035", "0.5998153", "0.56832576", "0.5635973", "0.56250733", "0.55891657", "0.55520797", "0.5525776", "0.5494806", "0.5453265", "0.5441832", "0.5329485", "0.5313207", "0.5311217", "0.5291862", "0.52859515", "0.5161213", "0.516051", "0.50958914", "0.50662404", "0.5044195", "0.5040835", "0.50391054", "0.50181293", "0.50106484", "0.5000807", "0.49604613", "0.49053094", "0.4903528", "0.48722863", "0.4866704", "0.48595548", "0.4837087", "0.48282644", "0.48027456", "0.4753382", "0.47470888", "0.47369438", "0.47369438", "0.47366574", "0.47234142", "0.47120678", "0.4710639", "0.4708175", "0.46929738", "0.46523416", "0.4633455", "0.46328232", "0.46229017", "0.46217448", "0.46196592", "0.4617098", "0.46057612", "0.45939547", "0.4591821", "0.45866084", "0.4570595", "0.45600736", "0.45600736", "0.45600736", "0.45600736", "0.45473316", "0.4537414", "0.45370287", "0.45257315", "0.45170408", "0.45074815", "0.44893947", "0.44845518", "0.44796512", "0.44783", "0.44744632", "0.44652995", "0.446214", "0.44556117", "0.44522774", "0.4452072", "0.44399357", "0.44350532", "0.44092405", "0.44061902", "0.44058076", "0.44056448", "0.4405495", "0.4403039", "0.44005373", "0.4399568", "0.4396305", "0.43938035", "0.43938035", "0.43934557", "0.43928203", "0.437976", "0.43694896", "0.4354358", "0.43500668", "0.4338264", "0.43363595", "0.43299642" ]
0.7098368
0
Return the relative path of the given filename
protected function getRelativePath($filename) { return str_replace('EXT:', t3lib_extMgm::siteRelPath('supersized'), $filename); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getRelativeFilePath($filename)\n {\n return self::IMPORT_STATUS_DIR . '/' . $filename;\n }", "public function getRelativeFilename(): string\n {\n return $this->relative_filename;\n }", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "public function getRelativePath($file)\n {\n return $this->config['directories']['app'] . '/' . $file;\n }", "private function get_relative_file( $file ) {\n\t\treturn ltrim( str_replace( dirname( app()->plugin_file ), '', $file ), '/' );\n\t}", "public static function relativePath($filename = null)\n {\n $path = 'uploads/'.auth()->id();\n\n if (is_string($filename)) {\n $path .= '/'.$filename;\n }\n\n return $path;\n }", "public function realPath($relativeFilename) { \n // Check for absolute path \n if (realpath($relativeFilename) == $relativeFilename) return $relativeFilename; \n \n // Otherwise, treat as relative path \n $paths = explode(PATH_SEPARATOR, get_include_path()); \n foreach ($paths as $path) { \n $path = str_replace('\\\\', '/', $path); \n $path = rtrim($path, '/') . '/'; \n $fullpath = realpath($path . $relativeFilename); \n if ($fullpath) return $fullpath; \n } \n \n return false; \n }", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "public function relativePath($fullPath, $fileName, $basePath = null);", "public function relativePath() : string {\n $path = empty($this->path) ? '' : Path::toRelative($this->path, true);\n return $path; \n }", "function getLocalFilePath($fileName) {\n return PATHS[$fileName];\n}", "public function getFileAbsolutePath($file);", "public function getRelativePathToFile($file)\n {\n return $this->getBucketUrl().$file;\n }", "function getFileFullPath($fileName) {\n\tglobal $GrunPath;\n\treturn $GrunPath.\"/\".$fileName;\n}", "function relative_to_absolute($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_ROOT_DIR__, str_replace('\\\\', '/', $filepath));\n}", "protected static function getRelativePath($ThumbFilename)\n\t{\n\t\tpreg_match('`/[^/]+/Thumbs/[^/]+\\.(' . EXTENSIONS . ')$`', $ThumbFilename, $URLRelative);\n\t\treturn $URLRelative[0];\n\t}", "public function getRelativePath() {\n $str = str_replace(Storage::disk('public')->url(''), '', $this->url);\n $str = str_replace($this->file_name, '', $str);\n return $str;\n }", "public function filePath($file) {\r\n $file = $this->fileLoad($file);\r\n return drupal_realpath($file->uri);\r\n }", "public function get_thumb_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_thumb_name();\n\t}", "function get_path_relative_to($path, $relative_to) {\n return substr($path, strlen($relative_to));\n }", "protected function getPath($file)\n {\n return $this->root . '/' . $file;\n }", "function _wp_get_attachment_relative_path($file)\n {\n }", "abstract public function getLocalPath(File $file);", "public function getRelativeMediaPath($fileName)\n {\n return str_replace(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA), Mage_Core_Model_Store::URL_TYPE_MEDIA . '/', $fileName);\n }", "public function getFilePath($fileName)\n {\n return $this->moduleDirReader->getModuleDir(\n \\Magento\\Framework\\Module\\Dir::MODULE_ETC_DIR,\n Naming::getModuleName()\n ) . '/' . $fileName;\n }", "public function getResource(string $relativePath): string {\n return (new \\SplFileObject($relativePath, 'rb', true))->getRealPath();\n }", "public function getPath($file)\n {\n $file = $this->getRelativePath($file);\n\n return $this->config['paths']['directory'] . '/' . $file;\n }", "public function getRelativePath(): string\n {\n return $this->relativePath;\n }", "function relative_to_url($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}", "public function getFullPath();", "function translatePath($file) {\n // // // // //\n // // /// ///\n ////// // // ///\n // // /////// // //\n // // // // // //\n return substr($file, strlen(dirname($_SERVER['SCRIPT_FILENAME']))+1);\n }", "public function getFullPath($name);", "public function realpath($file);", "function relativePath($path, $rel=false) {\n $relpath = '';\n\n if(!$rel) $rel = getcwd();\n $apath = explode(DIRECTORY_SEPARATOR, realpath($path));\n $arel = explode(DIRECTORY_SEPARATOR, realpath($rel));\n while(isset($apath[0]) && isset($arel[0]) && $apath[0] == $arel[0]) {\n array_shift($apath);\n array_shift($arel);\n }\n\n return str_repeat('..'.DIRECTORY_SEPARATOR, count($arel)).join(DIRECTORY_SEPARATOR, $apath);\n}", "public function generatePath($filename);", "public function getAbsolutePath ($filename)\n {\n $filename = str_replace('/../', '/', $filename); // TODO improve\n return $this->getHelpRootDir ().$filename.'.mkd';\n }", "public function getPath(){\n\t \treturn $this->dirname.'/'.$this->filename.'.'.$this->extension;\n\t }", "function papi_get_file_path( $file ) {\n\tif ( empty( $file ) || ! is_string( $file ) ) {\n\t\treturn;\n\t}\n\n\t$directories = papi_filter_settings_directories();\n\t$file = '/' . str_replace( ' ', '-', str_replace( '_', '-', $file ) );\n\n\tforeach ( $directories as $directory ) {\n\t\tif ( file_exists( $directory . $file ) ) {\n\t\t\treturn $directory . $file;\n\t\t}\n\n\t\tif ( file_exists( $directory . $file . '.php' ) ) {\n\t\t\treturn $directory . $file . '.php';\n\t\t}\n\t}\n}", "public function getResourcePath($file)\n {\n return $this->createPath($this->getResourcesPath(), $file);\n }", "public function getFilePath($file) {\n return $this->path . '/' . $file . $this->extension;\n }", "public function path(): string\n {\n return realpath($this->file);\n }", "public function getPath($file_path = null)\n {\n if (!$file_path) {\n return $this->base_path;\n }\n\n return $this->base_path.'/'.$file_path;\n }", "public function getFilePath($path, $filename)\n\t{\n\t\treturn str_replace('//', '/', $path.'/'.$filename);\n\t}", "public function getFilepath()\n {\n $filepath = $this->_path['dirname'].DIRECTORY_SEPARATOR.$this->_path['filename'];\n\n if ($this->_path['extension'])\n $filepath .= '.'.$this->_path['extension'];\n\n return $filepath;\n }", "public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}", "protected function getFullPath(string $file): string\n {\n for ($i = 0;\n !file_exists(\n $fullPath = __DIR__ . '/' . str_repeat('../', $i) . $file\n ) && $i < 100;\n $i++) {\n }\n return $fullPath;\n }", "public function getPathRelative($modifierId = false) {\n return $this->getFolder() . $this->getFilename();\n }", "function getPath($relativePath);", "public function path( $relative_path = '/' ) {\n\t\treturn plugin_dir_path( $this->main_file ) . ltrim( $relative_path, '/' );\n\t}", "public static function abs(string $relative): string\n {\n if (Console::isConsole())\n return '.' . dirname(getcwd()) . $relative;\n\n return sprintf('../%s', $relative);\n }", "public static function getResourcePath($file)\n {\n return (__DIR__ . '/Resources/' . $file);\n }", "public function getAbsoluteFilePath($fileName)\n {\n return $fileName === null ? null : $this->getAbsoluteFolderPath($fileName) . '/' . $fileName;\n }", "public function get_cover_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_cover_name();\n\t}", "protected function fileOptionToFullPath($relativePath){\n return getcwd() . '/' . ltrim($relativePath, '/');\n }", "function absolute_to_relative_path($path)\n{\n $pathParts = explode(DIRECTORY_SEPARATOR, $path);\n $pathParts = array_reverse($pathParts);\n array_splice($pathParts, 5);\n $pathParts = array_reverse($pathParts);\n $returnPath = CCTVALIASPATH . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $pathParts);\n $returnPath = str_replace('\\\\', '/', $returnPath);\n return $returnPath;\n}", "public static function get_asset_path( $filename ) {\n\t\treturn self::get_asset_dir() . '/' . $filename;\n\t}", "public function path(string $file)\n {\n return $this->basePath.$file;\n }", "public function getRelativePath(){\n\t\treturn 'Less';\n\t}", "public function getRelativePath()\n {\n return $this->relativePath;\n }", "public function getFullPath(): string;", "public function translatePath($fileName)\n\t{\n\t\t$fileName = str_replace('\\\\', '/', $fileName);\n\n\t\t$realDir = rtrim($this->directory, '/');\n\t\t$realDir .= '/' . dirname($fileName);\n\t\t$realDir = '/' . ltrim($realDir, '/');\n\n\t\t$fileName = $realDir . '/' . basename($fileName);\n\n\t\treturn $fileName;\n\t}", "private function __getUrl($file) {\n if (! $this->includeUrl) {\n $dirUrl = $_SERVER['REQUEST_URI'];\n\n $urlParts = parse_url($_SERVER['REQUEST_URI']);\n\n $dirUrl = '';\n\n if (isset($urlParts['scheme'])) {\n $dirUrl = $urlParts['scheme'] . '://';\n }\n\n if (isset($urlParts['host'])) {\n $dirUrl .= $urlParts['host'];\n }\n\n if (isset($urlParts['path'])) {\n $dirUrl .= $urlParts['path'];\n }\n } else {\n $dirUrl = $this->directoryUrl;\n }\n\n if ($this->__currentDirectory != '.') {\n $dirUrl = $dirUrl . $this->__currentDirectory;\n }\n return $dirUrl . rawurlencode($file);\n }", "function serendipity_getRealDir($file) {\n $dir = str_replace( \"\\\\\", \"/\", dirname($file));\n $base = preg_replace('@/include$@', '', $dir) . '/';\n return $base;\n}", "public function getFilePath() {\n\t\t$path = SPREADSHEET_FILES_DIR . \"/\" . $this->file_name;\n\t\tif (file_exists($path)) {\n\t\t\treturn $path;\n\t\t}\n\t}", "public function absPath(string $path): string;", "public function resolvePath(string $relativePath): string;", "public static function relpath($abs_path, $root = NULL) {\n $abs_path = self::abspath($abs_path);\n// self::logmsg('Source path: \"' . $abs_path . '\"');\n if (!isset($root)) {\n $root = $_SERVER['DOCUMENT_ROOT'];\n }\n// self::logmsg('root: \"' . $root . '\"');\n $source_rel = self::get_rel_dir($root, $abs_path);\n // self::logmsg('Relative path of source (calculated): \"' . $source_rel . '\"');\n if (preg_match('/\\.\\.\\//', $source_rel)) {\n // self::logmsg('<b>Note</b>: path is outside document root. You are allowed to, but its unusual setup. When used to calculate destination folder, the \"../\"s will be removed');\n }\n return $source_rel;\n }", "public function getDirectoryRelativePath(): string\n {\n return $this->config->getValue('general/file/import_images_base_dir');\n }", "function getServerFilePath($fileName) {\n return $_SERVER['DOCUMENT_ROOT'].PATHS[$fileName];\n}", "static function filename2url($filename) {\n\t\t$slashPos = -1;\n\t\twhile(($slashPos = strpos($filename, \"/\", $slashPos+1)) !== false) {\n\t\t\tif(substr($filename, 0, $slashPos) == substr($_SERVER['SCRIPT_FILENAME'],0,$slashPos)) {\n\t\t\t\t$commonLength = $slashPos;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$urlBase = substr($_SERVER['PHP_SELF'], 0, -(strlen($_SERVER['SCRIPT_FILENAME']) - $commonLength));\n\t\t$url = $urlBase . substr($filename, $commonLength);\n\t\t$protocol = $_SERVER['HTTPS'] ? \"https\" : \"http\";\n\t\treturn \"$protocol://\". $_SERVER['HTTP_HOST'] . $url;\n\n\t\t// Count the number of extra folders the script is in.\n\t\t// $prefix = str_repeat(\"../\", substr_count(substr($_SERVER[SCRIPT_FILENAME],$commonBaseLength)));\n\t}", "private function getFilePath($file)\n {\n return $this->configPath . $file;\n }", "public function getFilepath() {\n\t\treturn $this->directory.$this->fileprefix.'-'.$this->filename.'.'.static::EXTENSION;\n\t}", "public function getPath($filename, $scope = '@app')\n {\n return $this->getConfigFilePath($filename, $scope);\n }", "public function filePath() {\n return $this->baseDir() . '/' . $this->fileName();\n }", "protected function getPath($file, $ext = 'stub')\n {\n return $this->packagePath($this->basePath . $this->kebabPlural()) . '/' . $file . '.' . $ext;\n }", "public static function toAbsolute(String $relativePath=''): String\n {\n return __DIR__ . \"/../../$relativePath\";\n }", "public function getAbsolutePath(){\n\t \treturn $this->getAbsoluteDirname().'/'.$this->filename.'.'.$this->extension;\n\t }", "public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }", "function get_parent_theme_file_path($file = '')\n {\n }", "private function getAssetPath($fileName)\n {\n if (file_exists($this->getBasePath() . '/' . $fileName)) {\n return $this->getBaseUrl() . $fileName;\n } elseif (file_exists($this->getApp()['resources']->getPath('themepath/' . $fileName))) {\n return $this->getApp()['resources']->getUrl('theme') . $fileName;\n } elseif ($this instanceof \\Bolt\\Extensions) {\n return $fileName;\n }\n\n $message = sprintf(\n \"Couldn't add file asset '%s': File does not exist in either %s or %s directories.\",\n $fileName,\n $this->getBaseUrl(),\n $this->getApp()['resources']->getUrl('theme')\n );\n $this->getApp()['logger.system']->error($message, ['event' => 'extensions']);\n\n return $fileName;\n }", "public function getTargetRelativePath() : string {\n return $this->relative_path;\n }", "public function getRelativeUploadPath(): string;", "public function relativeUrl(string $url): string\n {\n // If string contains ://, it is considered as absolute\n if (preg_match('/:\\\\/\\\\//mUsi', $url)) {\n return $url;\n }\n\n // If string begins with \"/\", the \"/\" is removed to resolve the\n // relative path\n if (strlen($url) && $url[0] == '/') {\n $url = substr($url, 1);\n if ($this->samePrefix($url)) {\n // If the prefix is the same, simply returns the file name\n $relative = basename($url);\n } else {\n // Else, returns enough ../ to get upper\n $relative = '';\n\n for ($k = 0; $k < $this->getDepth(); $k++) {\n $relative .= '../';\n }\n\n $relative .= $url;\n }\n } else {\n $relative = $url;\n }\n\n return $relative;\n }", "public function absoluteRelativePath(string $url): string\n {\n return $this->currentDirectory . '/' . $this->getDirName() . '/' . $this->relativeUrl($url);\n }", "public function getFilePath(): string\n {\n return $this->targetDir . '/' . $this->getFileName();\n }", "public function getFullPath()\n\t{\n\t\treturn $this->getServerName() . $this->getScriptDirectory();\n\t}", "public function getFullPath(): string\n {\n return $this->getRoot() . $this->getPathExt();\n }", "public static function filename2url($filename)\n {\n $filename = realpath($filename);\n if (!$filename) {\n return null;\n }\n\n // Filter files outside of the webroot\n $base = realpath(BASE_PATH);\n $baseLength = strlen($base);\n if (substr($filename, 0, $baseLength) !== $base) {\n return null;\n }\n\n $relativePath = ltrim(substr($filename, $baseLength), '/\\\\');\n return Director::absoluteURL($relativePath);\n }", "function tfuse_get_file_uri($file) {\r\n $file = ltrim($file, '/');\r\n if (file_exists(STYLESHEETPATH . '/' . $file))\r\n return get_stylesheet_directory_uri() . '/' . $file;\r\n else if (file_exists(get_template_directory() . '/' . $file))\r\n return get_template_directory_uri() . '/' . $file;\r\n else\r\n return $file;\r\n }", "public function path( $file = '' ) {\n\n\t\t$file = ltrim( $file, '/' );\n\n\t\treturn $file ? $this->path . \"/{$file}\" : $this->path;\n\t}", "protected function getRelativeUrl($path) {\n return $this->app->getRelativeUrl($path);\n }", "public function getCachedFilePath($fileName)\n {\n $targetPath = dirname($fileName).DIRECTORY_SEPARATOR.basename($fileName);\n $targetPath = str_replace($this->getFolderRoot(), $this->getFolderCache(), $targetPath);\n return $targetPath;\n }", "public function getFilePath($file)\n {\n if (array_key_exists($file, $this->_configFiles)) {\n $this->_configFiles[$file]['pathname'];\n }\n\n if (!pathinfo($file, PATHINFO_EXTENSION)) {\n $file .= '.xml';\n }\n\n return $this->_configPath . $file;\n }", "function url_to_relative($url) {\n\treturn str_replace(__CHV_BASE_URL__, __CHV_RELATIVE_ROOT__, $url);\n}", "function resolve_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= $exploded_relative_path[$relative_path_counter2] . '/';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}", "public function getRelativePath($path)\n {\n return str_replace($this->baseDir . '/', '', $path);\n }", "private function getPath()\n {\n $path = $this->getDirName().$this->getFilename();\n if (strlen($this->getMime()->getExt())>0) {\n $path .= '.'.$this->getMime()->getExt();\n }\n return $path;\n }", "protected function generateFullPathOfStubFile(string $stubRelativePath) {\n\n return __DIR__ . $stubRelativePath;\n }", "function absolute_to_url($filepath) {\n\tif(__CHV_ROOT_DIR__===__CHV_RELATIVE_ROOT__) {\n\t\treturn __CHV_BASE_URL__.ltrim($filepath, '/');\n\t}\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}" ]
[ "0.78169477", "0.7623878", "0.74210376", "0.7282647", "0.7224932", "0.71992564", "0.7176848", "0.71226144", "0.7112633", "0.7102576", "0.69847924", "0.69845927", "0.6970614", "0.6970228", "0.69599926", "0.6948789", "0.6947727", "0.69331604", "0.69229704", "0.68924856", "0.6811808", "0.67774916", "0.6733082", "0.6731068", "0.6728502", "0.6716332", "0.6680205", "0.6679845", "0.66676176", "0.6665858", "0.6627445", "0.65759003", "0.6571747", "0.65696615", "0.65507835", "0.6534934", "0.65294075", "0.65260744", "0.6506686", "0.64945585", "0.649326", "0.64929444", "0.64599466", "0.64562184", "0.6455307", "0.6454143", "0.6445273", "0.64439213", "0.64352286", "0.63878673", "0.63834226", "0.6380103", "0.6377646", "0.63743204", "0.63692933", "0.63620746", "0.6358289", "0.63558966", "0.635584", "0.63391006", "0.6336854", "0.6334927", "0.6329106", "0.63276255", "0.6324806", "0.6323066", "0.6314439", "0.6308963", "0.6299039", "0.62948054", "0.62836117", "0.62749845", "0.62726754", "0.6268587", "0.62565196", "0.6216336", "0.6214676", "0.62120885", "0.6209176", "0.619815", "0.619733", "0.61828524", "0.61821014", "0.6170698", "0.61572456", "0.6156973", "0.6140127", "0.6135225", "0.6126463", "0.61189866", "0.6110899", "0.61108077", "0.61074805", "0.61060655", "0.61020166", "0.6099211", "0.6080565", "0.607372", "0.60733515", "0.6069146" ]
0.8086728
0
Run the database seeds.
public function run() { DB::table('jobs')->insert([ [ 'employer_id' => '1', 'status' => 'open', 'category_id' => '1', 'job_title' => 'demo title', 'description' => 'this is description', 'salary_type' => 'per month', 'occupation' => 'laravel developer', 'education' => 'BSAC', 'experience' => '3 Year', ], [ 'employer_id' => '1', 'status' => 'open', 'category_id' => '2', 'job_title' => 'demo title 2', 'description' => 'this is description', 'salary_type' => 'per month', 'occupation' => 'php developer', 'education' => 'SE', 'experience' => '2 Year', ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Auto generated seed file
public function run() { \DB::table('personas')->delete(); \DB::table('personas')->insert(array ( 0 => array ( 'idPersona' => 2, 'pNombre' => 'Josue', 'sNombre' => NULL, 'apellidoP' => 'Medina', 'apellidoM' => 'Peña', 'ci' => '3127007', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1964-02-09', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:54', 'updated_at' => '2020-04-06 11:57:54', ), 1 => array ( 'idPersona' => 12, 'pNombre' => 'Gabriel', 'sNombre' => NULL, 'apellidoP' => 'Terran', 'apellidoM' => 'Ascusy', 'ci' => '52973825', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:54', 'updated_at' => '2020-04-06 11:57:54', ), 2 => array ( 'idPersona' => 22, 'pNombre' => 'Juan', 'sNombre' => 'Carlos', 'apellidoP' => 'Teran', 'apellidoM' => 'Benavides', 'ci' => '82163327', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:54', 'updated_at' => '2020-04-06 11:57:54', ), 3 => array ( 'idPersona' => 32, 'pNombre' => 'Alvina', 'sNombre' => NULL, 'apellidoP' => 'Benavides', 'apellidoM' => 'Teran', 'ci' => '2914632', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1949-03-02', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:54', 'updated_at' => '2020-04-06 11:57:54', ), 4 => array ( 'idPersona' => 42, 'pNombre' => 'Ernesto', 'sNombre' => NULL, 'apellidoP' => 'Otalora', 'apellidoM' => 'Inochea', 'ci' => '53903939', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:54', 'updated_at' => '2020-04-06 11:57:54', ), 5 => array ( 'idPersona' => 52, 'pNombre' => 'Julio', 'sNombre' => NULL, 'apellidoP' => 'Cabrera', 'apellidoM' => 'Vocal', 'ci' => '18486806', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:55', 'updated_at' => '2020-04-06 11:57:55', ), 6 => array ( 'idPersona' => 62, 'pNombre' => 'Roberto', 'sNombre' => NULL, 'apellidoP' => 'Asurduy', 'apellidoM' => 'Calderon', 'ci' => '96429009', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:55', 'updated_at' => '2020-04-06 11:57:55', ), 7 => array ( 'idPersona' => 72, 'pNombre' => 'Eufracio', 'sNombre' => NULL, 'apellidoP' => 'Quino', 'apellidoM' => NULL, 'ci' => '1434951', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1954-06-04', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:55', 'updated_at' => '2020-04-06 11:57:55', ), 8 => array ( 'idPersona' => 82, 'pNombre' => 'Marizabeth', 'sNombre' => NULL, 'apellidoP' => 'Garcia', 'apellidoM' => 'Peñarrieta', 'ci' => '3768591', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1957-10-29', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:55', 'updated_at' => '2020-04-06 11:57:55', ), 9 => array ( 'idPersona' => 92, 'pNombre' => 'Mariano', 'sNombre' => NULL, 'apellidoP' => 'Paco', 'apellidoM' => 'Marco', 'ci' => '826055', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1952-09-25', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:55', 'updated_at' => '2020-04-06 11:57:55', ), 10 => array ( 'idPersona' => 102, 'pNombre' => 'Salome', 'sNombre' => 'Elsa', 'apellidoP' => 'Torrez', 'apellidoM' => 'Mamani', 'ci' => '3139549', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1959-06-08', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:55', 'updated_at' => '2020-04-06 11:57:55', ), 11 => array ( 'idPersona' => 112, 'pNombre' => 'Jorge', 'sNombre' => NULL, 'apellidoP' => 'Selaya', 'apellidoM' => 'Morales', 'ci' => '618223', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1953-04-24', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:55', 'updated_at' => '2020-04-06 11:57:55', ), 12 => array ( 'idPersona' => 122, 'pNombre' => 'Victor', 'sNombre' => 'Hugo', 'apellidoP' => 'Gonzales', 'apellidoM' => 'Call', 'ci' => '84808442', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 13 => array ( 'idPersona' => 132, 'pNombre' => 'Gonzalo', 'sNombre' => 'Enrrique', 'apellidoP' => 'Gottret', 'apellidoM' => 'Requena', 'ci' => '755698', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1948-12-19', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 14 => array ( 'idPersona' => 142, 'pNombre' => 'Marilu', 'sNombre' => NULL, 'apellidoP' => 'Morales', 'apellidoM' => 'Narvaez', 'ci' => '7344159', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 15 => array ( 'idPersona' => 152, 'pNombre' => 'Pedro', 'sNombre' => NULL, 'apellidoP' => 'Salinas', 'apellidoM' => 'Velazco', 'ci' => '75963486', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 16 => array ( 'idPersona' => 162, 'pNombre' => 'Lizeth', 'sNombre' => NULL, 'apellidoP' => 'Cepeda', 'apellidoM' => 'Garcia', 'ci' => '93844893', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 17 => array ( 'idPersona' => 172, 'pNombre' => 'Carlos', 'sNombre' => NULL, 'apellidoP' => 'Zambrana', 'apellidoM' => 'Claure', 'ci' => '22213025', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 18 => array ( 'idPersona' => 182, 'pNombre' => 'Rodolfo', 'sNombre' => NULL, 'apellidoP' => 'Rodriguez', 'apellidoM' => 'Romero', 'ci' => '48193751', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 19 => array ( 'idPersona' => 192, 'pNombre' => 'Vicente', 'sNombre' => NULL, 'apellidoP' => 'Gonzales', 'apellidoM' => 'Aramayo', 'ci' => '37373262', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 20 => array ( 'idPersona' => 202, 'pNombre' => 'Julio', 'sNombre' => 'Cesar', 'apellidoP' => 'Ledezma', 'apellidoM' => 'Enriquez', 'ci' => '30817816', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 21 => array ( 'idPersona' => 212, 'pNombre' => 'Victor', 'sNombre' => NULL, 'apellidoP' => 'Salazar', 'apellidoM' => 'Flores', 'ci' => '460653', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1953-03-10', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:56', 'updated_at' => '2020-04-06 11:57:56', ), 22 => array ( 'idPersona' => 222, 'pNombre' => 'Simon', 'sNombre' => 'Pedro', 'apellidoP' => 'Calle', 'apellidoM' => 'Mamani', 'ci' => '7069279', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1978-03-18', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:57', 'updated_at' => '2020-04-06 11:57:57', ), 23 => array ( 'idPersona' => 232, 'pNombre' => 'Maria', 'sNombre' => 'Eugenia', 'apellidoP' => 'Terceros', 'apellidoM' => 'Ledezma', 'ci' => '3774154', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:57', 'updated_at' => '2020-04-06 11:57:57', ), 24 => array ( 'idPersona' => 242, 'pNombre' => 'Javier', 'sNombre' => NULL, 'apellidoP' => 'Huarachi', 'apellidoM' => 'Rios', 'ci' => '6507300', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:57', 'updated_at' => '2020-04-06 11:57:57', ), 25 => array ( 'idPersona' => 252, 'pNombre' => 'Epifanio', 'sNombre' => NULL, 'apellidoP' => 'Galarza', 'apellidoM' => 'Chacon', 'ci' => '32778641', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:57', 'updated_at' => '2020-04-06 11:57:57', ), 26 => array ( 'idPersona' => 262, 'pNombre' => 'Adolfo', 'sNombre' => NULL, 'apellidoP' => 'Mamani', 'apellidoM' => 'Pinto', 'ci' => '2701765', 'expxedicion' => 'LA PAZ', 'fechaNacimiento' => '1971-09-26', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:57', 'updated_at' => '2020-04-06 11:57:57', ), 27 => array ( 'idPersona' => 272, 'pNombre' => 'Alina', 'sNombre' => NULL, 'apellidoP' => 'Terrazas', 'apellidoM' => 'Salazar', 'ci' => '53271895', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:57', 'updated_at' => '2020-04-06 11:57:57', ), 28 => array ( 'idPersona' => 282, 'pNombre' => 'Felix', 'sNombre' => NULL, 'apellidoP' => 'Choque', 'apellidoM' => 'Zarate', 'ci' => '11076255', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:57', 'updated_at' => '2020-04-06 11:57:57', ), 29 => array ( 'idPersona' => 292, 'pNombre' => 'Alicia', 'sNombre' => NULL, 'apellidoP' => 'Lazo', 'apellidoM' => 'Venegas', 'ci' => '63590309', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 30 => array ( 'idPersona' => 302, 'pNombre' => 'Nelida', 'sNombre' => NULL, 'apellidoP' => 'Vargas', 'apellidoM' => 'Calle', 'ci' => '20275130', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 31 => array ( 'idPersona' => 312, 'pNombre' => 'Emma', 'sNombre' => NULL, 'apellidoP' => 'Salazar', 'apellidoM' => 'Cori', 'ci' => '4964916', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1978-04-04', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 32 => array ( 'idPersona' => 322, 'pNombre' => 'Hugo', 'sNombre' => 'Jose', 'apellidoP' => 'Reinaga', 'apellidoM' => 'Villaroel', 'ci' => '31640746', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 33 => array ( 'idPersona' => 332, 'pNombre' => 'Erminia', 'sNombre' => NULL, 'apellidoP' => 'Cano', 'apellidoM' => 'Bazualto', 'ci' => '6408542', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1985-01-19', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 34 => array ( 'idPersona' => 342, 'pNombre' => 'Justo', 'sNombre' => NULL, 'apellidoP' => 'Marca', 'apellidoM' => 'Portuguez', 'ci' => '85337328', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 35 => array ( 'idPersona' => 352, 'pNombre' => 'Carlos', 'sNombre' => 'Justo', 'apellidoP' => 'Zambrana', 'apellidoM' => 'Quiroga', 'ci' => '817161', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1981-03-02', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 36 => array ( 'idPersona' => 362, 'pNombre' => 'Javier', 'sNombre' => NULL, 'apellidoP' => 'Miranda', 'apellidoM' => 'Nava', 'ci' => '26156262', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 37 => array ( 'idPersona' => 372, 'pNombre' => 'Nicolas', 'sNombre' => 'Alfredo', 'apellidoP' => 'Aspiasu', 'apellidoM' => 'Palenque', 'ci' => '389173', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1947-09-10', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:58', 'updated_at' => '2020-04-06 11:57:58', ), 38 => array ( 'idPersona' => 382, 'pNombre' => 'Juan', 'sNombre' => 'David', 'apellidoP' => 'Medina', 'apellidoM' => 'Rocha', 'ci' => '672366', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1955-06-27', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 39 => array ( 'idPersona' => 392, 'pNombre' => 'Romina', 'sNombre' => NULL, 'apellidoP' => 'Montaño', 'apellidoM' => 'Vargas', 'ci' => '3761797', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1971-02-25', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 40 => array ( 'idPersona' => 402, 'pNombre' => 'Aleida', 'sNombre' => 'Eugenia', 'apellidoP' => 'Rocabado', 'apellidoM' => 'Benavides', 'ci' => '12146507', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1967-05-31', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 41 => array ( 'idPersona' => 412, 'pNombre' => 'Fernando', 'sNombre' => NULL, 'apellidoP' => 'Carvajal', 'apellidoM' => 'Uzieda', 'ci' => '17451129', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 42 => array ( 'idPersona' => 422, 'pNombre' => 'Adolfo', 'sNombre' => NULL, 'apellidoP' => 'Vargas', 'apellidoM' => 'Benavides', 'ci' => '20549205', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 43 => array ( 'idPersona' => 432, 'pNombre' => 'Neysa', 'sNombre' => NULL, 'apellidoP' => 'Benavides', 'apellidoM' => NULL, 'ci' => '46636716', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 44 => array ( 'idPersona' => 442, 'pNombre' => 'Magin', 'sNombre' => 'Demetrio', 'apellidoP' => 'Cabrera', 'apellidoM' => 'Montecinos', 'ci' => '5174683', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1975-08-14', 'sexo' => 'M', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 45 => array ( 'idPersona' => 452, 'pNombre' => 'Silberia', 'sNombre' => NULL, 'apellidoP' => 'Torrez', 'apellidoM' => 'Espinoza', 'ci' => '6194398', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 46 => array ( 'idPersona' => 462, 'pNombre' => 'Flora', 'sNombre' => NULL, 'apellidoP' => 'Dorado', 'apellidoM' => 'Crespo', 'ci' => '2870884', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 47 => array ( 'idPersona' => 472, 'pNombre' => 'Alejandria', 'sNombre' => 'Rosemary', 'apellidoP' => 'Vargas', 'apellidoM' => 'Dorado', 'ci' => '3756572', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1972-04-24', 'sexo' => 'F', 'created_at' => '2020-04-06 11:57:59', 'updated_at' => '2020-04-06 11:57:59', ), 48 => array ( 'idPersona' => 482, 'pNombre' => 'Eick', 'sNombre' => 'Boris', 'apellidoP' => 'Vargas', 'apellidoM' => 'Dorado', 'ci' => '19997316', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 49 => array ( 'idPersona' => 492, 'pNombre' => 'Victor', 'sNombre' => NULL, 'apellidoP' => 'Foronda', 'apellidoM' => 'Benavides', 'ci' => '67834368', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 50 => array ( 'idPersona' => 502, 'pNombre' => 'Eliseo', 'sNombre' => NULL, 'apellidoP' => 'Uzieda', 'apellidoM' => 'Vargas', 'ci' => '10198105', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 51 => array ( 'idPersona' => 512, 'pNombre' => 'Julia', 'sNombre' => NULL, 'apellidoP' => 'Choquevilca', 'apellidoM' => 'Mamani', 'ci' => '4496165', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 52 => array ( 'idPersona' => 522, 'pNombre' => 'Julyata', 'sNombre' => NULL, 'apellidoP' => 'Flores', 'apellidoM' => 'Cruz', 'ci' => '7863817', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1986-01-09', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 53 => array ( 'idPersona' => 532, 'pNombre' => 'Luz', 'sNombre' => 'Maribel', 'apellidoP' => 'Nolasco', 'apellidoM' => 'Aguilar', 'ci' => '5194378', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 54 => array ( 'idPersona' => 542, 'pNombre' => 'Sandra', 'sNombre' => 'Elizabeth', 'apellidoP' => 'Ledezma', 'apellidoM' => 'Enrriquez', 'ci' => '19314279', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 55 => array ( 'idPersona' => 552, 'pNombre' => 'Marina', 'sNombre' => NULL, 'apellidoP' => 'Gamboa', 'apellidoM' => 'Vargas', 'ci' => '86221779', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 56 => array ( 'idPersona' => 562, 'pNombre' => 'Zoraida', 'sNombre' => 'Vanesa', 'apellidoP' => 'Rios', 'apellidoM' => 'Moreira', 'ci' => '8159049', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 57 => array ( 'idPersona' => 572, 'pNombre' => 'Rosmery', 'sNombre' => NULL, 'apellidoP' => 'Zeballos', 'apellidoM' => 'Alave', 'ci' => '53373655', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:00', 'updated_at' => '2020-04-06 11:58:00', ), 58 => array ( 'idPersona' => 582, 'pNombre' => 'Jorge', 'sNombre' => NULL, 'apellidoP' => 'Chavez', 'apellidoM' => NULL, 'ci' => '71023570', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:01', 'updated_at' => '2020-04-06 11:58:01', ), 59 => array ( 'idPersona' => 592, 'pNombre' => 'Alvina', 'sNombre' => NULL, 'apellidoP' => 'Condori', 'apellidoM' => 'Fernandez', 'ci' => '21538884', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:01', 'updated_at' => '2020-04-06 11:58:01', ), 60 => array ( 'idPersona' => 602, 'pNombre' => 'Maribel', 'sNombre' => NULL, 'apellidoP' => 'Vasquez', 'apellidoM' => 'Torrico', 'ci' => '57138396', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:01', 'updated_at' => '2020-04-06 11:58:01', ), 61 => array ( 'idPersona' => 612, 'pNombre' => 'Jose', 'sNombre' => 'Limbert', 'apellidoP' => 'Teran', 'apellidoM' => 'Benavides', 'ci' => '58919825', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:01', 'updated_at' => '2020-04-06 11:58:01', ), 62 => array ( 'idPersona' => 622, 'pNombre' => 'Victor', 'sNombre' => NULL, 'apellidoP' => 'Cachaca', 'apellidoM' => 'Janko', 'ci' => '23481278', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:01', 'updated_at' => '2020-04-06 11:58:01', ), 63 => array ( 'idPersona' => 632, 'pNombre' => 'Juan', 'sNombre' => NULL, 'apellidoP' => 'Martinez', 'apellidoM' => 'Lima', 'ci' => '91956120', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:01', 'updated_at' => '2020-04-06 11:58:01', ), 64 => array ( 'idPersona' => 642, 'pNombre' => 'Juan', 'sNombre' => NULL, 'apellidoP' => 'Galarza', 'apellidoM' => 'Chacon', 'ci' => '69669883', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:01', 'updated_at' => '2020-04-06 11:58:01', ), 65 => array ( 'idPersona' => 652, 'pNombre' => 'Lucha', 'sNombre' => NULL, 'apellidoP' => 'Ledezma', 'apellidoM' => 'Escobar', 'ci' => '82928581', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:02', 'updated_at' => '2020-04-06 11:58:02', ), 66 => array ( 'idPersona' => 662, 'pNombre' => 'Jose', 'sNombre' => 'Victor', 'apellidoP' => 'Pinto', 'apellidoM' => 'Pereira', 'ci' => '980501', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1960-08-26', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:02', 'updated_at' => '2020-04-06 11:58:02', ), 67 => array ( 'idPersona' => 672, 'pNombre' => 'Wilfredo', 'sNombre' => NULL, 'apellidoP' => 'Ledezma', 'apellidoM' => 'Escobar', 'ci' => '87330013', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:02', 'updated_at' => '2020-04-06 11:58:02', ), 68 => array ( 'idPersona' => 682, 'pNombre' => 'Anabel', 'sNombre' => 'Maruja', 'apellidoP' => 'Benavides', 'apellidoM' => 'Meneces', 'ci' => '3033460', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1960-09-02', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:02', 'updated_at' => '2020-04-06 11:58:02', ), 69 => array ( 'idPersona' => 692, 'pNombre' => 'Jaime', 'sNombre' => NULL, 'apellidoP' => 'Villalta', 'apellidoM' => 'Fernandez', 'ci' => '65189331', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:02', 'updated_at' => '2020-04-06 11:58:02', ), 70 => array ( 'idPersona' => 702, 'pNombre' => 'German', 'sNombre' => NULL, 'apellidoP' => 'Zambrana', 'apellidoM' => 'Villazon', 'ci' => '3425218', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1959-12-10', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:03', 'updated_at' => '2020-04-06 11:58:03', ), 71 => array ( 'idPersona' => 712, 'pNombre' => 'Beatriz', 'sNombre' => NULL, 'apellidoP' => 'Apaza', 'apellidoM' => 'Gutierrez', 'ci' => '98449787', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:03', 'updated_at' => '2020-04-06 11:58:03', ), 72 => array ( 'idPersona' => 722, 'pNombre' => 'Carmen', 'sNombre' => NULL, 'apellidoP' => 'Revera', 'apellidoM' => 'Ledezma', 'ci' => '25296888', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:03', 'updated_at' => '2020-04-06 11:58:03', ), 73 => array ( 'idPersona' => 732, 'pNombre' => 'Walter', 'sNombre' => NULL, 'apellidoP' => 'Ledezma', 'apellidoM' => 'Escobar', 'ci' => '50826993', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:03', 'updated_at' => '2020-04-06 11:58:03', ), 74 => array ( 'idPersona' => 742, 'pNombre' => 'Pascuala', 'sNombre' => NULL, 'apellidoP' => 'Mamani', 'apellidoM' => 'Chuquimia', 'ci' => '2057297', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1954-04-11', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:03', 'updated_at' => '2020-04-06 11:58:03', ), 75 => array ( 'idPersona' => 752, 'pNombre' => 'Tito', 'sNombre' => NULL, 'apellidoP' => 'Vargas', 'apellidoM' => 'Ortega', 'ci' => '89303636', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:03', 'updated_at' => '2020-04-06 11:58:03', ), 76 => array ( 'idPersona' => 762, 'pNombre' => 'Adriana', 'sNombre' => NULL, 'apellidoP' => 'Pinto', 'apellidoM' => 'Oros', 'ci' => '90015449', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:04', 'updated_at' => '2020-04-06 11:58:04', ), 77 => array ( 'idPersona' => 772, 'pNombre' => 'Enrrique', 'sNombre' => NULL, 'apellidoP' => 'Soria', 'apellidoM' => 'Cano', 'ci' => '80957772', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:04', 'updated_at' => '2020-04-06 11:58:04', ), 78 => array ( 'idPersona' => 782, 'pNombre' => 'Jose', 'sNombre' => NULL, 'apellidoP' => 'Ledezma', 'apellidoM' => 'Escobar', 'ci' => '858124', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1946-08-27', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:04', 'updated_at' => '2020-04-06 11:58:04', ), 79 => array ( 'idPersona' => 792, 'pNombre' => 'Silvia', 'sNombre' => NULL, 'apellidoP' => 'Sagredo', 'apellidoM' => 'Verduguez', 'ci' => '933162', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1955-05-18', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:04', 'updated_at' => '2020-04-06 11:58:04', ), 80 => array ( 'idPersona' => 802, 'pNombre' => 'Saida', 'sNombre' => NULL, 'apellidoP' => 'Guzman', 'apellidoM' => 'Colque', 'ci' => '3569701', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1965-03-17', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:04', 'updated_at' => '2020-04-06 11:58:04', ), 81 => array ( 'idPersona' => 812, 'pNombre' => 'Omar', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => 'Benavidez', 'ci' => '65500576', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:04', 'updated_at' => '2020-04-06 11:58:04', ), 82 => array ( 'idPersona' => 822, 'pNombre' => 'Alberto', 'sNombre' => NULL, 'apellidoP' => 'Bustos', 'apellidoM' => 'Gonzales', 'ci' => '96069615', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:05', 'updated_at' => '2020-04-06 11:58:05', ), 83 => array ( 'idPersona' => 832, 'pNombre' => 'Maria', 'sNombre' => 'Helen', 'apellidoP' => 'Valencia', 'apellidoM' => 'Rojas', 'ci' => '40362952', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:05', 'updated_at' => '2020-04-06 11:58:05', ), 84 => array ( 'idPersona' => 842, 'pNombre' => 'Bernardo', 'sNombre' => NULL, 'apellidoP' => 'Flores', 'apellidoM' => 'Ochoa', 'ci' => '2702696', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1967-03-12', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:05', 'updated_at' => '2020-04-06 11:58:05', ), 85 => array ( 'idPersona' => 852, 'pNombre' => 'Rudy', 'sNombre' => NULL, 'apellidoP' => 'Guzman', 'apellidoM' => 'Chirinos', 'ci' => '76036437', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:05', 'updated_at' => '2020-04-06 11:58:05', ), 86 => array ( 'idPersona' => 862, 'pNombre' => 'Felix', 'sNombre' => NULL, 'apellidoP' => 'Gutierrez', 'apellidoM' => 'Gonzales', 'ci' => '2740182', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1956-01-07', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:05', 'updated_at' => '2020-04-06 11:58:05', ), 87 => array ( 'idPersona' => 872, 'pNombre' => 'Enrrique', 'sNombre' => NULL, 'apellidoP' => 'Camacho', 'apellidoM' => 'Adriazola', 'ci' => '3565257', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1970-07-12', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:05', 'updated_at' => '2020-04-06 11:58:05', ), 88 => array ( 'idPersona' => 882, 'pNombre' => 'Alvaro', 'sNombre' => NULL, 'apellidoP' => 'Cespedes', 'apellidoM' => 'Tapia', 'ci' => '5197067', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1980-03-18', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:05', 'updated_at' => '2020-04-06 11:58:05', ), 89 => array ( 'idPersona' => 892, 'pNombre' => 'Bicman', 'sNombre' => NULL, 'apellidoP' => 'Silvestre', 'apellidoM' => 'Camacho', 'ci' => '6520912', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1973-07-29', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:06', 'updated_at' => '2020-04-06 11:58:06', ), 90 => array ( 'idPersona' => 902, 'pNombre' => 'Renata', 'sNombre' => NULL, 'apellidoP' => 'Ledezma', 'apellidoM' => 'Terceros', 'ci' => '3748741', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1942-02-26', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:06', 'updated_at' => '2020-04-06 11:58:06', ), 91 => array ( 'idPersona' => 912, 'pNombre' => 'Victor', 'sNombre' => NULL, 'apellidoP' => 'Cespedes', 'apellidoM' => 'Calatayud', 'ci' => '33486856', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:06', 'updated_at' => '2020-04-06 11:58:06', ), 92 => array ( 'idPersona' => 922, 'pNombre' => 'Linsay', 'sNombre' => NULL, 'apellidoP' => 'Quintana', 'apellidoM' => 'Calatayud', 'ci' => '6472678', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1986-04-09', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:06', 'updated_at' => '2020-04-06 11:58:06', ), 93 => array ( 'idPersona' => 932, 'pNombre' => 'Benigno', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => 'Ledezma', 'ci' => '53874303', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:06', 'updated_at' => '2020-04-06 11:58:06', ), 94 => array ( 'idPersona' => 942, 'pNombre' => 'Cristobal', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => 'Ledezma', 'ci' => '5245213', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1974-07-25', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:06', 'updated_at' => '2020-04-06 11:58:06', ), 95 => array ( 'idPersona' => 952, 'pNombre' => 'Henrry', 'sNombre' => 'Rene', 'apellidoP' => 'Carballo', 'apellidoM' => 'Mercado', 'ci' => '5239077', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1980-12-07', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:06', 'updated_at' => '2020-04-06 11:58:06', ), 96 => array ( 'idPersona' => 962, 'pNombre' => 'Ximena', 'sNombre' => 'Gissela', 'apellidoP' => 'Carballo', 'apellidoM' => 'Mercado', 'ci' => '4417809', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1975-05-27', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 97 => array ( 'idPersona' => 972, 'pNombre' => 'Sagrada', 'sNombre' => 'Familia', 'apellidoP' => 'Congregación', 'apellidoM' => NULL, 'ci' => '79088843', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 98 => array ( 'idPersona' => 982, 'pNombre' => 'Lourdes', 'sNombre' => NULL, 'apellidoP' => 'Herbas', 'apellidoM' => 'Colque', 'ci' => '82718961', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 99 => array ( 'idPersona' => 992, 'pNombre' => 'Maria', 'sNombre' => 'Aida', 'apellidoP' => 'Vargas', 'apellidoM' => 'Camacho', 'ci' => '67343328', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 100 => array ( 'idPersona' => 1002, 'pNombre' => 'Auro', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => NULL, 'ci' => '89623289', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 101 => array ( 'idPersona' => 1012, 'pNombre' => 'Jose', 'sNombre' => 'Bernardino', 'apellidoP' => 'Flores', 'apellidoM' => 'Alcocer', 'ci' => '99948208', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 102 => array ( 'idPersona' => 1022, 'pNombre' => 'Sonia', 'sNombre' => NULL, 'apellidoP' => 'Roque', 'apellidoM' => 'Ticona', 'ci' => '55252080', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 103 => array ( 'idPersona' => 1032, 'pNombre' => 'Felix', 'sNombre' => NULL, 'apellidoP' => 'Mamani', 'apellidoM' => 'Villalta', 'ci' => '39089728', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:07', 'updated_at' => '2020-04-06 11:58:07', ), 104 => array ( 'idPersona' => 1042, 'pNombre' => 'Angelica', 'sNombre' => NULL, 'apellidoP' => 'Agreda', 'apellidoM' => 'Garcia', 'ci' => '1411326', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1952-02-04', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 105 => array ( 'idPersona' => 1052, 'pNombre' => 'Jorge', 'sNombre' => NULL, 'apellidoP' => 'Apaza', 'apellidoM' => 'Quispe', 'ci' => '3612396', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1962-09-01', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 106 => array ( 'idPersona' => 1062, 'pNombre' => 'Benigna', 'sNombre' => NULL, 'apellidoP' => 'Bazoalto', 'apellidoM' => 'Vazquez', 'ci' => '2919722', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1955-06-28', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 107 => array ( 'idPersona' => 1072, 'pNombre' => 'Alexis', 'sNombre' => NULL, 'apellidoP' => 'Gutierrez', 'apellidoM' => 'Gandarilla', 'ci' => '25752581', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2018-02-10', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 108 => array ( 'idPersona' => 1082, 'pNombre' => 'Eliseo', 'sNombre' => NULL, 'apellidoP' => 'Rioja', 'apellidoM' => 'Aquino', 'ci' => '98819565', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 109 => array ( 'idPersona' => 1092, 'pNombre' => 'Martina', 'sNombre' => NULL, 'apellidoP' => 'Ortiz', 'apellidoM' => 'Beltran', 'ci' => '34495641', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 110 => array ( 'idPersona' => 1102, 'pNombre' => 'Florencio', 'sNombre' => NULL, 'apellidoP' => 'Apaza', 'apellidoM' => 'Pocori', 'ci' => '31068274', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 111 => array ( 'idPersona' => 1112, 'pNombre' => 'Severo', 'sNombre' => NULL, 'apellidoP' => 'Marca', 'apellidoM' => 'Poma', 'ci' => '79173387', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 112 => array ( 'idPersona' => 1122, 'pNombre' => 'Mildreth', 'sNombre' => NULL, 'apellidoP' => 'Zurita', 'apellidoM' => 'Torrico', 'ci' => '6430841', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1985-07-01', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:08', 'updated_at' => '2020-04-06 11:58:08', ), 113 => array ( 'idPersona' => 1132, 'pNombre' => 'Maria', 'sNombre' => 'Mercedes', 'apellidoP' => 'Damian', 'apellidoM' => 'Perez', 'ci' => '97439691', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1964-02-09', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:09', 'updated_at' => '2020-04-06 11:58:09', ), 114 => array ( 'idPersona' => 1142, 'pNombre' => 'Maria', 'sNombre' => 'Teresa', 'apellidoP' => 'Larrazabal', 'apellidoM' => 'Gutierrez', 'ci' => '46623127', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:09', 'updated_at' => '2020-04-06 11:58:09', ), 115 => array ( 'idPersona' => 1152, 'pNombre' => 'Nelson', 'sNombre' => NULL, 'apellidoP' => 'Mamani', 'apellidoM' => 'Chipana', 'ci' => '53686256', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:09', 'updated_at' => '2020-04-06 11:58:09', ), 116 => array ( 'idPersona' => 1162, 'pNombre' => 'Ramiro', 'sNombre' => 'Alberto', 'apellidoP' => 'Herrera', 'apellidoM' => 'Teran', 'ci' => '4488096', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1973-08-07', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:09', 'updated_at' => '2020-04-06 11:58:09', ), 117 => array ( 'idPersona' => 1172, 'pNombre' => 'Marina', 'sNombre' => NULL, 'apellidoP' => 'Inoche', 'apellidoM' => 'Alave', 'ci' => '66785698', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:09', 'updated_at' => '2020-04-06 11:58:09', ), 118 => array ( 'idPersona' => 1182, 'pNombre' => 'David', 'sNombre' => NULL, 'apellidoP' => 'Fernandez', 'apellidoM' => 'Paco', 'ci' => '5175074', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1976-12-20', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:09', 'updated_at' => '2020-04-06 11:58:09', ), 119 => array ( 'idPersona' => 1192, 'pNombre' => 'Saul', 'sNombre' => NULL, 'apellidoP' => 'Rojas', 'apellidoM' => NULL, 'ci' => '81553590', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:09', 'updated_at' => '2020-04-06 11:58:09', ), 120 => array ( 'idPersona' => 1202, 'pNombre' => 'Lucy', 'sNombre' => NULL, 'apellidoP' => 'Inochea', 'apellidoM' => 'Alave', 'ci' => '19200979', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 121 => array ( 'idPersona' => 1212, 'pNombre' => 'Casto', 'sNombre' => 'Kindar', 'apellidoP' => 'Blanco', 'apellidoM' => 'Bustillo', 'ci' => '14393950', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 122 => array ( 'idPersona' => 1222, 'pNombre' => 'Ruben', 'sNombre' => NULL, 'apellidoP' => 'Otalora', 'apellidoM' => 'Inochea', 'ci' => '85517441', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 123 => array ( 'idPersona' => 1232, 'pNombre' => 'Pascual', 'sNombre' => NULL, 'apellidoP' => 'Otalora', 'apellidoM' => 'Inochea', 'ci' => '3576861', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1964-04-19', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 124 => array ( 'idPersona' => 1242, 'pNombre' => 'Emilia', 'sNombre' => NULL, 'apellidoP' => 'Merida', 'apellidoM' => 'Vergara', 'ci' => '37138243', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 125 => array ( 'idPersona' => 1252, 'pNombre' => 'Yonny', 'sNombre' => NULL, 'apellidoP' => 'Inochea', 'apellidoM' => 'Guzman', 'ci' => '3587553', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1969-09-08', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 126 => array ( 'idPersona' => 1262, 'pNombre' => 'Javier', 'sNombre' => NULL, 'apellidoP' => 'Inochea', 'apellidoM' => 'Guzman', 'ci' => '83306234', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 127 => array ( 'idPersona' => 1272, 'pNombre' => 'Emiliana', 'sNombre' => NULL, 'apellidoP' => 'Inoche', 'apellidoM' => 'Orellana', 'ci' => '860445', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1947-08-20', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 128 => array ( 'idPersona' => 1282, 'pNombre' => 'Emigdio', 'sNombre' => NULL, 'apellidoP' => 'Miranda', 'apellidoM' => NULL, 'ci' => '3746518', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1970-10-09', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 129 => array ( 'idPersona' => 1292, 'pNombre' => 'Richard', 'sNombre' => NULL, 'apellidoP' => 'Rojas', 'apellidoM' => 'Ledezma', 'ci' => '4446006', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1972-10-26', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:10', 'updated_at' => '2020-04-06 11:58:10', ), 130 => array ( 'idPersona' => 1302, 'pNombre' => 'Angel', 'sNombre' => NULL, 'apellidoP' => 'Merida', 'apellidoM' => 'Vergara', 'ci' => '99990218', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 131 => array ( 'idPersona' => 1312, 'pNombre' => 'Hilda', 'sNombre' => NULL, 'apellidoP' => 'Merida', 'apellidoM' => 'Vergara', 'ci' => '92840151', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 132 => array ( 'idPersona' => 1322, 'pNombre' => 'Mirian', 'sNombre' => 'Esperanza', 'apellidoP' => 'Callapa', 'apellidoM' => 'Rioja', 'ci' => '5277818', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1980-09-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 133 => array ( 'idPersona' => 1332, 'pNombre' => 'Abac', 'sNombre' => 'Efenia', 'apellidoP' => 'Heredia', 'apellidoM' => 'Rocha', 'ci' => '5201077', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1956-01-15', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 134 => array ( 'idPersona' => 1342, 'pNombre' => 'Zaida', 'sNombre' => NULL, 'apellidoP' => 'Merida', 'apellidoM' => 'Vergara', 'ci' => '74541723', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 135 => array ( 'idPersona' => 1352, 'pNombre' => 'Feliciano', 'sNombre' => NULL, 'apellidoP' => 'Quiroz', 'apellidoM' => 'Rosas', 'ci' => '815069-1p', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1950-02-05', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 136 => array ( 'idPersona' => 1362, 'pNombre' => 'Benigno', 'sNombre' => NULL, 'apellidoP' => 'Quiroz', 'apellidoM' => 'Ferrufino', 'ci' => '3942714', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1968-06-28', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 137 => array ( 'idPersona' => 1372, 'pNombre' => 'Fortunato', 'sNombre' => NULL, 'apellidoP' => 'Inochea', 'apellidoM' => 'Jimenez', 'ci' => '807101', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1951-02-02', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 138 => array ( 'idPersona' => 1382, 'pNombre' => 'Golden', 'sNombre' => NULL, 'apellidoP' => 'Fernandez', 'apellidoM' => 'Suarez', 'ci' => '5721886', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1948-12-05', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 139 => array ( 'idPersona' => 1392, 'pNombre' => 'Juan', 'sNombre' => 'Ronald', 'apellidoP' => 'Inochea', 'apellidoM' => 'Vargas', 'ci' => '62724534', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:11', 'updated_at' => '2020-04-06 11:58:11', ), 140 => array ( 'idPersona' => 1402, 'pNombre' => 'Julio', 'sNombre' => 'Cesar', 'apellidoP' => 'Torrez', 'apellidoM' => NULL, 'ci' => '88034386', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:12', 'updated_at' => '2020-04-06 11:58:12', ), 141 => array ( 'idPersona' => 1412, 'pNombre' => 'Mario', 'sNombre' => NULL, 'apellidoP' => 'Guzman', 'apellidoM' => 'Pinto', 'ci' => '25386174', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:12', 'updated_at' => '2020-04-06 11:58:12', ), 142 => array ( 'idPersona' => 1422, 'pNombre' => 'Ramiro', 'sNombre' => 'Fermin', 'apellidoP' => 'Aguilar', 'apellidoM' => 'Corrales', 'ci' => '32592361', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:12', 'updated_at' => '2020-04-06 11:58:12', ), 143 => array ( 'idPersona' => 1432, 'pNombre' => 'Jhanneth', 'sNombre' => NULL, 'apellidoP' => 'Ledezma', 'apellidoM' => 'Enriquez', 'ci' => '80733881', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:12', 'updated_at' => '2020-04-06 11:58:12', ), 144 => array ( 'idPersona' => 1442, 'pNombre' => 'Valentin', 'sNombre' => NULL, 'apellidoP' => 'Rios', 'apellidoM' => 'Peña', 'ci' => '2955641', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1955-12-16', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:12', 'updated_at' => '2020-04-06 11:58:12', ), 145 => array ( 'idPersona' => 1452, 'pNombre' => 'Hugo', 'sNombre' => NULL, 'apellidoP' => 'Caceres', 'apellidoM' => 'Velasco', 'ci' => '95849393', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:12', 'updated_at' => '2020-04-06 11:58:12', ), 146 => array ( 'idPersona' => 1462, 'pNombre' => 'Fabian', 'sNombre' => NULL, 'apellidoP' => 'Valdivia', 'apellidoM' => 'Pinto', 'ci' => '57998695', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:12', 'updated_at' => '2020-04-06 11:58:12', ), 147 => array ( 'idPersona' => 1472, 'pNombre' => 'Froilan', 'sNombre' => NULL, 'apellidoP' => 'Quiñones', 'apellidoM' => 'Paco', 'ci' => '83451775', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:13', 'updated_at' => '2020-04-06 11:58:13', ), 148 => array ( 'idPersona' => 1482, 'pNombre' => 'Celso', 'sNombre' => NULL, 'apellidoP' => 'Valdivia', 'apellidoM' => NULL, 'ci' => '36932276', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:13', 'updated_at' => '2020-04-06 11:58:13', ), 149 => array ( 'idPersona' => 1492, 'pNombre' => 'Feliz', 'sNombre' => NULL, 'apellidoP' => 'Aduviri', 'apellidoM' => 'Mamani', 'ci' => '279715', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1941-02-03', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:13', 'updated_at' => '2020-04-06 11:58:13', ), 150 => array ( 'idPersona' => 1502, 'pNombre' => 'Alberto', 'sNombre' => NULL, 'apellidoP' => 'Cruz', 'apellidoM' => 'Villca', 'ci' => '2008922', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1951-08-10', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:13', 'updated_at' => '2020-04-06 11:58:13', ), 151 => array ( 'idPersona' => 1512, 'pNombre' => 'Yhonny', 'sNombre' => 'Rodolfo', 'apellidoP' => 'Quiroz', 'apellidoM' => 'Aranibar', 'ci' => '3807130', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1973-09-23', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:13', 'updated_at' => '2020-04-06 11:58:13', ), 152 => array ( 'idPersona' => 1522, 'pNombre' => 'Susana', 'sNombre' => NULL, 'apellidoP' => 'Quiroz', 'apellidoM' => 'Aranibar', 'ci' => '6514201', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1987-10-12', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:13', 'updated_at' => '2020-04-06 11:58:13', ), 153 => array ( 'idPersona' => 1532, 'pNombre' => 'Vitalia', 'sNombre' => NULL, 'apellidoP' => 'Guzman', 'apellidoM' => 'Abasto', 'ci' => '57000242', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:14', 'updated_at' => '2020-04-06 11:58:14', ), 154 => array ( 'idPersona' => 1542, 'pNombre' => 'Elias', 'sNombre' => NULL, 'apellidoP' => 'Quispe', 'apellidoM' => 'Compara', 'ci' => '3775392', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1971-09-11', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:14', 'updated_at' => '2020-04-06 11:58:14', ), 155 => array ( 'idPersona' => 1552, 'pNombre' => 'Carlos', 'sNombre' => 'Francini', 'apellidoP' => 'Valdivia', 'apellidoM' => 'Pinto', 'ci' => '3769353', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1971-10-20', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:14', 'updated_at' => '2020-04-06 11:58:14', ), 156 => array ( 'idPersona' => 1562, 'pNombre' => 'Dante', 'sNombre' => 'Alberto', 'apellidoP' => 'Verastegui', 'apellidoM' => 'Ontiveros', 'ci' => '3037248', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1962-04-03', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:14', 'updated_at' => '2020-04-06 11:58:14', ), 157 => array ( 'idPersona' => 1572, 'pNombre' => 'Jhon', 'sNombre' => 'Cristian', 'apellidoP' => 'Laura', 'apellidoM' => 'Illacutipa', 'ci' => '53870926', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1962-04-03', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:14', 'updated_at' => '2020-04-06 11:58:14', ), 158 => array ( 'idPersona' => 1582, 'pNombre' => 'Edson', 'sNombre' => NULL, 'apellidoP' => 'Caceres', 'apellidoM' => 'Cejas', 'ci' => '52421866', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:15', 'updated_at' => '2020-04-06 11:58:15', ), 159 => array ( 'idPersona' => 1592, 'pNombre' => 'Boris', 'sNombre' => NULL, 'apellidoP' => 'Martines', 'apellidoM' => 'Caceres', 'ci' => '85851967', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1978-12-16', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:15', 'updated_at' => '2020-04-06 11:58:15', ), 160 => array ( 'idPersona' => 1602, 'pNombre' => 'Julian', 'sNombre' => NULL, 'apellidoP' => 'Lopez', 'apellidoM' => 'Alanoca', 'ci' => '57227610', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:15', 'updated_at' => '2020-04-06 11:58:15', ), 161 => array ( 'idPersona' => 1612, 'pNombre' => 'Gonzalo', 'sNombre' => NULL, 'apellidoP' => 'Vargas', 'apellidoM' => 'Hinojosa', 'ci' => '89344859', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1978-12-16', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:15', 'updated_at' => '2020-04-06 11:58:15', ), 162 => array ( 'idPersona' => 1622, 'pNombre' => 'Wilma', 'sNombre' => NULL, 'apellidoP' => 'Condori', 'apellidoM' => 'Sarzuri', 'ci' => '3701164', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1968-12-29', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:15', 'updated_at' => '2020-04-06 11:58:15', ), 163 => array ( 'idPersona' => 1632, 'pNombre' => 'Maria', 'sNombre' => 'Margarita', 'apellidoP' => 'Quiroz', 'apellidoM' => 'Gomez', 'ci' => '3786704', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1957-08-27', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 164 => array ( 'idPersona' => 1642, 'pNombre' => 'Sinforosa', 'sNombre' => NULL, 'apellidoP' => 'Quispe', 'apellidoM' => 'Mamani', 'ci' => '77935200', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 165 => array ( 'idPersona' => 1652, 'pNombre' => 'Guillermo', 'sNombre' => NULL, 'apellidoP' => 'Huanca', 'apellidoM' => 'Aucachi', 'ci' => '84580258', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 166 => array ( 'idPersona' => 1662, 'pNombre' => 'Lidia', 'sNombre' => NULL, 'apellidoP' => 'Calle', 'apellidoM' => 'Chuquimia', 'ci' => '46316535', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 167 => array ( 'idPersona' => 1672, 'pNombre' => 'Carmelo', 'sNombre' => NULL, 'apellidoP' => 'Mamani', 'apellidoM' => NULL, 'ci' => '261089', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1944-07-09', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 168 => array ( 'idPersona' => 1682, 'pNombre' => 'Esther', 'sNombre' => 'Ruth', 'apellidoP' => 'Lopez', 'apellidoM' => 'Simon', 'ci' => '3775804', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1970-04-09', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 169 => array ( 'idPersona' => 1692, 'pNombre' => 'Elias', 'sNombre' => NULL, 'apellidoP' => 'Soria', 'apellidoM' => 'Medrano', 'ci' => '23237050', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 170 => array ( 'idPersona' => 1702, 'pNombre' => 'Elsa', 'sNombre' => NULL, 'apellidoP' => 'Gutierrez', 'apellidoM' => 'Coca', 'ci' => '29464260', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:16', 'updated_at' => '2020-04-06 11:58:16', ), 171 => array ( 'idPersona' => 1712, 'pNombre' => 'Jianeth', 'sNombre' => 'Mirtha', 'apellidoP' => 'Inochea', 'apellidoM' => 'Guzman', 'ci' => '4452191', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1982-09-08', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 172 => array ( 'idPersona' => 1722, 'pNombre' => 'Wilfredo', 'sNombre' => NULL, 'apellidoP' => 'Ledezma', 'apellidoM' => 'Enriquez', 'ci' => '3779201', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1972-10-11', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 173 => array ( 'idPersona' => 1732, 'pNombre' => 'Susana', 'sNombre' => NULL, 'apellidoP' => 'Enrriquez', 'apellidoM' => 'Herrera', 'ci' => '3587117', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1966-09-20', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 174 => array ( 'idPersona' => 1742, 'pNombre' => 'Ricardo', 'sNombre' => NULL, 'apellidoP' => 'Otalora', 'apellidoM' => 'Inochea', 'ci' => '3587667', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1969-04-02', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 175 => array ( 'idPersona' => 1752, 'pNombre' => 'Elizabeth', 'sNombre' => NULL, 'apellidoP' => 'Ochoa', 'apellidoM' => 'Otalora', 'ci' => '5239428', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1975-11-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 176 => array ( 'idPersona' => 1762, 'pNombre' => 'Nicolas', 'sNombre' => NULL, 'apellidoP' => 'Alave', 'apellidoM' => 'Morales', 'ci' => '910370', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1949-03-22', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 177 => array ( 'idPersona' => 1772, 'pNombre' => 'Saturnino', 'sNombre' => NULL, 'apellidoP' => 'Mollo', 'apellidoM' => 'Morales', 'ci' => '3750210', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1968-09-29', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 178 => array ( 'idPersona' => 1782, 'pNombre' => 'Inez', 'sNombre' => NULL, 'apellidoP' => 'Zeballos', 'apellidoM' => 'Alave', 'ci' => '29022646', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 179 => array ( 'idPersona' => 1792, 'pNombre' => 'Julieta', 'sNombre' => NULL, 'apellidoP' => 'Zeballos', 'apellidoM' => 'Alave', 'ci' => '7886637', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1986-08-22', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 180 => array ( 'idPersona' => 1802, 'pNombre' => 'Orlando', 'sNombre' => NULL, 'apellidoP' => 'Zeballos', 'apellidoM' => 'Alave', 'ci' => '5938639', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1982-03-23', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:17', 'updated_at' => '2020-04-06 11:58:17', ), 181 => array ( 'idPersona' => 1812, 'pNombre' => 'Juan', 'sNombre' => 'Carlos', 'apellidoP' => 'Valdivia', 'apellidoM' => 'Sarabia', 'ci' => '63154983', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 182 => array ( 'idPersona' => 1822, 'pNombre' => 'Cristobal', 'sNombre' => 'Ramiro', 'apellidoP' => 'Valdivia', 'apellidoM' => 'Sarabia', 'ci' => '3766446', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1971-12-05', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 183 => array ( 'idPersona' => 1832, 'pNombre' => 'Lina', 'sNombre' => NULL, 'apellidoP' => 'Veliz', 'apellidoM' => 'Moreira', 'ci' => '34217707', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 184 => array ( 'idPersona' => 1842, 'pNombre' => 'Remberto', 'sNombre' => NULL, 'apellidoP' => 'Garcia', 'apellidoM' => 'Bueno', 'ci' => '5235006', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1980-09-14', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 185 => array ( 'idPersona' => 1852, 'pNombre' => 'Pedro', 'sNombre' => NULL, 'apellidoP' => 'Mollo', 'apellidoM' => 'Morales', 'ci' => '70368912', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 186 => array ( 'idPersona' => 1862, 'pNombre' => 'Jorge', 'sNombre' => NULL, 'apellidoP' => 'Ruedas', 'apellidoM' => 'Sanizo', 'ci' => '8667102', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1959-08-24', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 187 => array ( 'idPersona' => 1872, 'pNombre' => 'Javier', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => 'Valdivia', 'ci' => '93257977', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 188 => array ( 'idPersona' => 1882, 'pNombre' => 'Nemecio', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => 'Valdivia', 'ci' => '33256651', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 189 => array ( 'idPersona' => 1892, 'pNombre' => 'Juan', 'sNombre' => 'Pablo', 'apellidoP' => 'Terceros', 'apellidoM' => 'Valdivia', 'ci' => '6508084', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1981-11-10', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 190 => array ( 'idPersona' => 1902, 'pNombre' => 'Agustina', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => 'Valdibia', 'ci' => '75582982', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:18', 'updated_at' => '2020-04-06 11:58:18', ), 191 => array ( 'idPersona' => 1912, 'pNombre' => 'Maria', 'sNombre' => 'Luisa', 'apellidoP' => 'Valdivia', 'apellidoM' => 'Sarabia', 'ci' => '60974169', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 192 => array ( 'idPersona' => 1922, 'pNombre' => 'Alfredo', 'sNombre' => NULL, 'apellidoP' => 'Terceros', 'apellidoM' => 'Valdivia', 'ci' => '86184918', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 193 => array ( 'idPersona' => 1932, 'pNombre' => 'Juana', 'sNombre' => NULL, 'apellidoP' => 'Valdivia', 'apellidoM' => 'Saravia', 'ci' => '5257849', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1978-08-29', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 194 => array ( 'idPersona' => 1942, 'pNombre' => 'Roberta', 'sNombre' => NULL, 'apellidoP' => 'Uzieda', 'apellidoM' => 'Ledezma', 'ci' => '3779145', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1970-05-24', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 195 => array ( 'idPersona' => 1952, 'pNombre' => 'Wilson', 'sNombre' => NULL, 'apellidoP' => 'Uzieda', 'apellidoM' => 'Ledezma', 'ci' => '4491476', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1975-01-05', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 196 => array ( 'idPersona' => 1962, 'pNombre' => 'Nancy', 'sNombre' => NULL, 'apellidoP' => 'Pinto', 'apellidoM' => 'Alcon', 'ci' => '37452903', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 197 => array ( 'idPersona' => 1972, 'pNombre' => 'Martin', 'sNombre' => NULL, 'apellidoP' => 'Vilalo', 'apellidoM' => 'Franco', 'ci' => '6494695', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1984-06-10', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 198 => array ( 'idPersona' => 1982, 'pNombre' => 'Marcela', 'sNombre' => NULL, 'apellidoP' => 'Mamani', 'apellidoM' => 'Villalta', 'ci' => '33753950', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 199 => array ( 'idPersona' => 1992, 'pNombre' => 'Epifania', 'sNombre' => NULL, 'apellidoP' => 'Quispe', 'apellidoM' => 'Compara', 'ci' => '3369225', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1967-01-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:19', 'updated_at' => '2020-04-06 11:58:19', ), 200 => array ( 'idPersona' => 2002, 'pNombre' => 'Lidia', 'sNombre' => 'Estela', 'apellidoP' => 'Claros', 'apellidoM' => 'Rodriguez', 'ci' => '2730184', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1961-08-03', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 201 => array ( 'idPersona' => 2012, 'pNombre' => 'Delia', 'sNombre' => 'Benedicta', 'apellidoP' => 'Claros', 'apellidoM' => 'Rodriguez', 'ci' => '3070044', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1963-07-07', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 202 => array ( 'idPersona' => 2022, 'pNombre' => 'Brido', 'sNombre' => NULL, 'apellidoP' => 'Claros', 'apellidoM' => 'Rodriguez', 'ci' => '3530693', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1975-07-23', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 203 => array ( 'idPersona' => 2032, 'pNombre' => 'Javier', 'sNombre' => 'Antonio', 'apellidoP' => 'Claros', 'apellidoM' => 'Rodriguez', 'ci' => '3722882', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1968-07-29', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 204 => array ( 'idPersona' => 2042, 'pNombre' => 'Ruben', 'sNombre' => NULL, 'apellidoP' => 'Claros', 'apellidoM' => 'Rodriguez', 'ci' => '3100115', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1965-07-05', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 205 => array ( 'idPersona' => 2052, 'pNombre' => 'Leoncio', 'sNombre' => NULL, 'apellidoP' => 'Lliulli', 'apellidoM' => 'Saire', 'ci' => '2218596', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1949-09-12', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 206 => array ( 'idPersona' => 2062, 'pNombre' => 'Ana', 'sNombre' => 'Maria', 'apellidoP' => 'Benavides', 'apellidoM' => 'Encinas', 'ci' => '990214', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1995-12-04', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 207 => array ( 'idPersona' => 2072, 'pNombre' => 'Lilian', 'sNombre' => 'Leticia', 'apellidoP' => 'Carvallo', 'apellidoM' => 'Mercado', 'ci' => '5237682', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1978-01-14', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 208 => array ( 'idPersona' => 2082, 'pNombre' => 'Mabel', 'sNombre' => 'Berta', 'apellidoP' => 'Saavedra', 'apellidoM' => 'Mercado', 'ci' => '82843332', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:20', 'updated_at' => '2020-04-06 11:58:20', ), 209 => array ( 'idPersona' => 2092, 'pNombre' => 'Iber', 'sNombre' => NULL, 'apellidoP' => 'Saavedra', 'apellidoM' => 'Mercado', 'ci' => '89177247', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 210 => array ( 'idPersona' => 2102, 'pNombre' => 'Julieta', 'sNombre' => NULL, 'apellidoP' => 'Rodriguez', 'apellidoM' => 'Guillen', 'ci' => '3057589', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1946-02-16', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 211 => array ( 'idPersona' => 2112, 'pNombre' => 'Jhonatan', 'sNombre' => 'Osbaldo', 'apellidoP' => 'Carballo', 'apellidoM' => 'Mercado', 'ci' => '5259758-1h', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1984-04-12', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 212 => array ( 'idPersona' => 2122, 'pNombre' => 'Roxana', 'sNombre' => 'Dolly', 'apellidoP' => 'Carballo', 'apellidoM' => 'Mercado', 'ci' => '54196714', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 213 => array ( 'idPersona' => 2132, 'pNombre' => 'Rene', 'sNombre' => NULL, 'apellidoP' => 'Carballo', 'apellidoM' => 'Ortega', 'ci' => '595596', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1941-06-18', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 214 => array ( 'idPersona' => 2142, 'pNombre' => 'Feliz', 'sNombre' => NULL, 'apellidoP' => 'Valdez', 'apellidoM' => 'Zapata', 'ci' => '541036', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1933-11-20', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 215 => array ( 'idPersona' => 2152, 'pNombre' => 'Hilarion', 'sNombre' => NULL, 'apellidoP' => 'Almendras', 'apellidoM' => 'Rodrigues', 'ci' => '57071524', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 216 => array ( 'idPersona' => 2162, 'pNombre' => 'Nelsa', 'sNombre' => NULL, 'apellidoP' => 'Rodriguez', 'apellidoM' => 'Vargas', 'ci' => '52058373', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:21', 'updated_at' => '2020-04-06 11:58:21', ), 217 => array ( 'idPersona' => 2172, 'pNombre' => 'Javier', 'sNombre' => 'Wenceslao', 'apellidoP' => 'Rodriguez', 'apellidoM' => 'Vargas', 'ci' => '3123415', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1961-12-04', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 218 => array ( 'idPersona' => 2182, 'pNombre' => 'Victor', 'sNombre' => NULL, 'apellidoP' => 'Cabrera', 'apellidoM' => 'Peña', 'ci' => '90384023', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 219 => array ( 'idPersona' => 2192, 'pNombre' => 'Alicia', 'sNombre' => NULL, 'apellidoP' => 'Rodriguez', 'apellidoM' => 'Vargas', 'ci' => '93211119', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 220 => array ( 'idPersona' => 2202, 'pNombre' => 'Jose', 'sNombre' => NULL, 'apellidoP' => 'Droguetts', 'apellidoM' => 'Sautter', 'ci' => '97315815', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 221 => array ( 'idPersona' => 2212, 'pNombre' => 'Felipe', 'sNombre' => NULL, 'apellidoP' => 'Gutierrez', 'apellidoM' => 'Mamani', 'ci' => '1718534', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1959-08-25', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 222 => array ( 'idPersona' => 2222, 'pNombre' => 'Damian', 'sNombre' => NULL, 'apellidoP' => 'Baltaza', 'apellidoM' => 'Mamani', 'ci' => '18381850', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 223 => array ( 'idPersona' => 2232, 'pNombre' => 'Inocencia', 'sNombre' => NULL, 'apellidoP' => 'Cruz', 'apellidoM' => 'Mamani', 'ci' => '7891935', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1974-12-08', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 224 => array ( 'idPersona' => 2242, 'pNombre' => 'Miriam', 'sNombre' => NULL, 'apellidoP' => 'Castillo', 'apellidoM' => 'Vargas', 'ci' => '5297014', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1981-03-09', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 225 => array ( 'idPersona' => 2252, 'pNombre' => 'Radio', 'sNombre' => NULL, 'apellidoP' => 'Movil', 'apellidoM' => 'Vinto', 'ci' => '72455798', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:22', 'updated_at' => '2020-04-06 11:58:22', ), 226 => array ( 'idPersona' => 2262, 'pNombre' => 'Pantaleon', 'sNombre' => NULL, 'apellidoP' => 'Mamani', 'apellidoM' => 'Villca', 'ci' => '4069721', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '1963-07-22', 'sexo' => 'M', 'created_at' => '2020-04-06 11:58:23', 'updated_at' => '2020-04-06 11:58:23', ), 227 => array ( 'idPersona' => 2272, 'pNombre' => 'Rosalia', 'sNombre' => NULL, 'apellidoP' => 'Tovar', 'apellidoM' => 'Toco', 'ci' => '59052401', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:23', 'updated_at' => '2020-04-06 11:58:23', ), 228 => array ( 'idPersona' => 2282, 'pNombre' => 'Martha', 'sNombre' => 'Mariel', 'apellidoP' => 'Vargas', 'apellidoM' => 'Bustamante', 'ci' => '24953187', 'expxedicion' => 'COCHABAMBA', 'fechaNacimiento' => '2020-04-06', 'sexo' => 'F', 'created_at' => '2020-04-06 11:58:23', 'updated_at' => '2020-04-06 11:58:23', ), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function seed();", "protected function seed()\n {\n }", "public function seed() {\n }", "public function run()\n {\n $faker= \\Faker\\Factory::create();\n for ($i=0; $i < 20; $i++)\n {\n \tHuongDanVien::create([\n \t\t'tenhdv'=> $faker->name,\n \t\t'phai'=> $faker->word,\n \t\t'diachi'=> $faker->word,\n \t\t'sdt'=> $faker->number_format(0122000000),\n \t\t]);\n }\n }", "public function actionGenerate()\n {\n \\bariew\\yii2Tools\\tests\\FixtureManager::init();\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "public function run()\n {\n \t$faker = Faker\\Factory::create();; \n foreach (range(1, 55) as $key => $value) {\n \tApp\\Student::create([\n \t\t 'name' => $faker->name,\n 'father_name' => $faker->name('male'),\n 'mother_name' => $faker->name('female'),\n 'phone_number' => $faker->phoneNumber,\n 'home_number' => $faker->phoneNumber,\n 'email' => $faker->unique()->safeEmail,\n 'gender' => 'male',\n 'roll_number' => $faker->randomNumber(),\n 'reg_number' => $faker->randomNumber(),\n 'department_id' => $faker->randomNumber(1),\n 'shift' => 'second',\n 'semester' => 'eight',\n 'present_address' => $faker->address,\n 'permanent_address' => $faker->address,\n \t]);\n }\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('ms_MY');\n ini_set('memory_limit', '50G');\n \\Eloquent::reguard();\n $this->command->info('User Seed');\n\n for ($i = 0; $i < 5; $i++) {\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'participant',\n 'isLead' => 0,\n 'totalPoints' => rand(1,100),\n ]);\n \n }\n\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'participant',\n 'isLead' => 1,\n 'totalPoints' => rand(1,100),\n ]);\n\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'program manager',\n 'isLead' => 0,\n 'totalPoints' => 0,\n ]);\n \n }", "public function getSeed();", "public function run()\n {\n //Cmd: php artisan db:seed --class=\"UsersTableSeeder\"\n \n $faker = Faker\\Factory::create(\"ja_JP\");\n \n for( $i=0; $i<10; $i++ ){\n\n App\\User::create([\n\t\t\t\t\"name\" => $faker->name(),\n\t\t\t\t\"name_mei\" => $faker->name(),\n\t\t\t\t\"kana_sei\" => $faker->word(),\n\t\t\t\t\"kana_mei\" => $faker->word(),\n\t\t\t\t\"email\" => $faker->safeEmail(),\n\t\t\t\t\"password\" => $faker->password(),\n\t\t\t\t\"phone\" => $faker->word(),\n\t\t\t\t\"address\" => $faker->address(),\n\t\t\t\t\"birthday\" => $faker->date().\" \".$faker->time(),\n\t\t\t\t\"language\" => $faker->languageCode(),\n\t\t\t\t\"licence\" => $faker->word(),\n\t\t\t\t\"school\" => $faker->word(),\n\t\t\t\t\"school_dept\" => $faker->word(),\n\t\t\t\t\"school_subject\" => $faker->word(),\n\t\t\t\t\"gender\" => $faker->word(),\n\t\t\t\t\"salary\" => $faker->randomDigit(),\n\t\t\t\t\"image_url\" => $faker->uuid(),\n\t\t\t\t\"back_image_url\" => $faker->uuid(),\n\t\t\t\t\"remember_token\" => $faker->sha1(),\n\t\t\t\t\"user_role_id\" => $faker->randomDigit(),\n\t\t\t\t\"created_at\" => $faker->dateTime(\"now\"),\n\t\t\t\t\"updated_at\" => $faker->dateTime(\"now\")\n\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $title = $faker->sentence(rand(3,6));\n Article::create([\n 'title'=>$title,\n 'slug'=>Str::slug($title,'-'),\n 'description'=>$faker->text(rand(100,300)),\n 'content'=>$faker->realText(rand(1000,2000))\n ]);\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n $limit = 100;\n\n for ($i = 0; $i < $limit; $i++){\n \t\\App\\Models\\Member::create([\n 'code' => $faker->name,\n 'name' => $faker->name,\n 'sns_link' => $faker->name,\n 'is_block' => $faker->numberBetween(0, 1),\n 'phone' => $faker->name,\n 'amount' => $faker->numberBetween(1000, 9000),\n //{{SEEDER_NOT_DELETE_THIS_LINE}}\n\t\t\t]);\n\t\t}\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $kelamin = \"laki-laki\";\n foreach (range(1, 100) as $i) {\n \tKajian::create([\n \t\t'waktu'\t\t\t\t=> $faker->dateTimeThisCentury($max = 'now', $timezone = date_default_timezone_get()), \n\n \t\t'tema'\t\t\t\t=> $faker->sentence($nbWords = 6, $variableNbWords = true), \n \t\t'pemateri'\t\t\t=> $faker->name($gender = null|'male'|'female'), \n \t\t'alamat'\t\t\t=> $faker->streetAddress, \n \t\t'deskripsi'\t\t\t=> $faker->paragraph($nbSentences = 3, $variableNbSentences = true), \n \t\t'jenis_peserta'\t\t=> $kelamin, \n \t\t'latitude'\t\t\t=> $faker->latitude, \n \t\t'longitude'\t\t\t=> $faker->longitude,\n 'isRutin' => $faker->boolean\n \t]);\n }\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n /* Curso::factory(8)->create(); */\n /* $this->call(CidepartamentoSeeder::class);\n $this->call(CategoriaSeeder::class);\n $this->call(GeneroSeeder::class); */\n\n /* $this->call(UserSeeder::class); */\n\n\n /* Estudiante::factory(20)->create(); */\n\n /* Profesore::factory(12)->create(); */\n\n\n /* $this->call(EstudianteSeeder::class); */\n /* $this->call(CursoSeeder::class); */\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n for ($i = 100; $i < 120; $i++) {\n university::insert([\n 'name' => $faker->name(),\n 'code' => $i,\n 'contact' => '1234567' . $i,\n 'address' => 'Bhavnagar',\n 'user_id' => 2\n ]);\n\n }\n }", "public function run(): void\n {\n $faker = Factory::create();\n \\App\\User::query()->insert($this->gen($faker));\n }", "public function run()\n {\n $faker = Faker::create();\n\n Umrah::Create([\n 'user_id' => User::all()->random()->id,\n 'deceased_id' => Deceased::all()->random()->id,\n 'umrah_status_id' => UmrahStatus::all()->random()->id,\n ]);\n }", "function migrate_seed(){\n\n // Pull in Seed Service Provider\n // Loop in the contents of the file specified in the Service provider\n // Run Insert query.\n\n $seedFiles = require BASEPATH.\"/migration/SeedServiceProvider.php\";\n\n //Loop the files\n foreach ( $seedFiles as $file ){\n\n $seeds = require BASEPATH . \"/migration/seed/{$file}.php\";\n\n //Loop In table for insertion\n foreach( $seeds as $table_name => $data ){\n\n insert( $table_name, $data );\n\n }\n\n }\n\n}", "public function run()\n {\n // App\\UserRentCompactDisc::delete();\n (new Faker\\Generator)->seed(100);\n factory(App\\UserRentCompactDisc::class, 30)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n //echo $faker->word();die();\n //var_dump($faker);die();\n\n for($i=0; $i<100; $i++) \n {\n Maker::create\n ([\n 'name' => $faker->unique()->company(),\n 'phone' => $faker->phoneNumber()\n ]);\n }\n }", "public function run()\n {\n\n $faker =Faker\\Factory::create();\n foreach (range(1,10) as $index) {\n Member::create([\n 'memberNo' => $faker->text(5),\n 'name' => $faker->text($min=5,$max=10),\n 'email' => $faker->email(),\n 'lastConnect' => $faker->dateTime()\n ]);\n }\n }", "public function run()\n\t{\n\n $faker=Faker::create();\n\n for($i = 0; $i < 20; $i++)\n {\n \n \n \n $id= \\DB::table('users')->insertGetId(array(\n 'name' => $faker->firstName,\n 'email' => $faker->unique()->email,\n 'password' => \\Hash::make('bebe'),\n 'type' => $faker->randomElement(['member','admin']),\n \n\n\t\t\t));\n\n\n\n }\n\t\n\t}", "public function run()\n {\n //\\App\\Models\\User::factory(400)->create();\n //\\App\\Models\\Ship::factory(10000)->create();\n //\\App\\Models\\City::factory(1000)->create();\n //\\App\\Models\\Offer::factory(2000)->create();\n\n /* $this->call([\n CountrySeeder::class,\n ]);*/\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n $faker = Faker::create();\n DB::table('userroles')->insert([\n 'role_name' => 'Subper Admin',\n 'role_status' => 1,\n 'read' => $faker->paragraph(2),\n 'write' => $faker->paragraph(2),\n 'country_nationality' => $faker->paragraph(2)\n ]);\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class,15)->create();\n\n\n $regcouncils = fopen('C:\\practocsv\\regcouncil.csv', 'r');\n $degrees = fopen('C:\\practocsv\\degree.csv', 'r');\n $cities = fopen('C:\\practocsv\\city.csv', 'r');\n $specializations = fopen('C:\\practocsv\\specialization.csv', 'r');\n $colleges = fopen('C:\\practocsv\\college.csv', 'r');\n\n $categories = fopen('C:\\practocsv\\category.csv', 'r');\n $subcategories = fopen('C:\\practocsv\\subcategory.csv', 'r');\n $manufacturers = fopen('C:\\practocsv\\manufacture.csv', 'r');\n $ingredients = fopen('C:\\practocsv\\ingredients.csv', 'r');\n $products = fopen('C:\\practocsv\\product.csv', 'r');\n\n $faker = \\Faker\\Factory::create();\n\n $regcouncil_id = 0;\n $city_id = 0;\n $degree_id = 0;\n $specialization_id = 0;\n $college_id = 0;\n\n Type::create([\n 'name'=>'video'\n ]);\n Type::create([\n 'name'=>'chat'\n ]);\n $type = Type::create([\n 'name'=>'clinic'\n ]);\n\n while(($reg = fgetcsv($regcouncils)) !== FALSE){\n $regcouncil = Regcouncil::create([\n 'name'=>$reg[0]\n ]);\n $regcouncil_id = $regcouncil->id;\n }\n\n while(($deg = fgetcsv($degrees)) !== FALSE){\n $degree = Degree::create([\n 'name'=>$deg[0]\n ]);\n $degree_id = $degree->id;\n }\n\n while(($cit = fgetcsv($cities)) !== FALSE){\n $city = City::create([\n 'name'=>$cit[0]\n ]);\n $city_id = $city->id;\n }\n\n while(($reg = fgetcsv($specializations)) !== FALSE){\n $speciality = Speciality::create([\n 'name'=>$reg[0]\n ]);\n $specialization_id = $speciality->id;\n }\n\n while(($clg = fgetcsv($colleges)) !== FALSE){\n $college = College::create([\n 'name'=>$clg[0]\n ]);\n $college_id = $college->id;\n }\n\n for($i=0 ; $i<50 ; $i++){\n $doctor = Doctor::create([\n 'fullname' => $faker->name,\n 'description' => $faker->sentence(rand(5,6)),\n 'fees' => rand(1000,10000),\n 'phone_no' => rand(1000000000,9999999999),\n 'password' => '$2y$10$ckpf//racepEDB9TGR2ZLu3JkVrPKUlaXorZIiWF4eZf87O83lPX2',\n 'email'=> $faker->unique()->safeEmail,\n 'city_id' => rand(1,$city_id),\n 'address' => $faker->sentence(rand(5,6)),\n 'gender' => 'male',\n 'country_code' => '+91',\n 'years_of_exp' => rand(5,20),\n 'slot_duration' => 15,\n 'speciality_id' => rand(1,$specialization_id),\n 'reg_no' => rand(1,200000),\n 'regcouncil_id' => rand(1,$regcouncil_id),\n 'degree_id' => rand(1,$degree_id),\n 'college_id' => rand(1,$college_id),\n 'establishment_name' => $faker->word,\n 'establishment_address' => $faker->sentence(rand(5,6)),\n 'establishment_city_id' => rand(1,$city_id),\n 'establishment_pincode' => rand(1000,999999),\n ]);\n\n $user = User::create([\n 'name' => $doctor->fullname,\n 'email' => $doctor->email,\n 'email_verified_at' => now(),\n 'password' => '$2y$10$ckpf//racepEDB9TGR2ZLu3JkVrPKUlaXorZIiWF4eZf87O83lPX2' , // password\n 'gender'=> $doctor->gender,\n 'role'=>'doctor',\n 'age'=>rand(20,50),\n 'phone_no'=> $doctor->phone_no,\n 'remember_token' => Str::random(10),\n 'doctor_id'=>$doctor->id\n ]);\n $doctor->type()->attach(rand(1,$type->id));\n }\n\n while(($cat = fgetcsv($categories)) !== FALSE){\n $category = Category::create([\n 'name'=>$cat[0]\n ]);\n $category_id = $category->id;\n }\n\n while(($subcat = fgetcsv($subcategories)) !== FALSE){\n $subcategory = Subcategory::create([\n 'name'=>$subcat[0],\n 'category_id'=>rand(1,$category_id),\n ]);\n $subcategory_id = $subcategory->id;\n }\n\n // $i=1;\n // while($i<15){\n // $i++;\n // $manufacturer = Manufacturer::create([\n // 'name'=>$faker->name,\n // 'user_id'=>$i\n // ]);\n // $manufacture_id = $manufacturer->id;\n // }\n\n\n $manufacturer = Manufacturer::create([\n 'name'=>\"John Doe\",\n 'user_id'=>1,\n \n ]);\n\n $manufacture_id = 1;\n\n\n // while(($ing = fgetcsv($ingredients)) !== FALSE){\n // $ingredient = Ingredient::create([\n // 'name'=>$ing[0]\n // ]);\n // $ingredient_id = $ingredient->id;\n // }\n\n while(($pro = fgetcsv($products)) !== FALSE){\n $product = Product::create([\n 'name'=>$pro[0],\n 'price'=>rand(100,1000),\n 'size'=>\"200 ml\",\n 'quantity'=>rand(20,50),\n 'category_id'=>rand(1,$category_id),\n 'subcategory_id'=>rand(1,$subcategory_id),\n 'description'=>$faker->sentence(rand(3,4)),\n 'how_to_use'=>$faker->sentence(rand(2,3)),\n 'benefits'=>$faker->sentence(rand(2,3)),\n 'highlights'=>$faker->sentence(rand(1,2)),\n 'manufacturer_id'=>rand(1,$manufacture_id),\n 'prescription_required'=>rand(0,1),\n ]);\n $product_id = $product->id;\n }\n\n $products = fopen('C:\\practocsv\\product.csv', 'r');\n while(($pro = fgetcsv($products)) !== FALSE){\n $product = Product::create([\n 'name'=>$pro[0],\n 'price'=>rand(100,1000),\n 'size'=>\"200 ml\",\n 'quantity'=>rand(20,50),\n 'category_id'=>rand(1,$category_id),\n 'subcategory_id'=>rand(1,$subcategory_id),\n 'description'=>$faker->sentence(rand(3,4)),\n 'how_to_use'=>$faker->sentence(rand(2,3)),\n 'benefits'=>$faker->sentence(rand(2,3)),\n 'highlights'=>$faker->sentence(rand(1,2)),\n 'manufacturer_id'=>rand(1,$manufacture_id),\n 'prescription_required'=>rand(0,1),\n ]);\n $product_id = $product->id;\n }\n\n Notification_type::create([\n 'name' => 'appointment-made',\n 'message' => 'You have Received a new appointment!'\n ]);\n\n Notification_type::create([\n 'name' => 'appointment-accepted',\n 'message' => 'Your appointment is confirmed!'\n ]);\n\n Notification_type::create([\n 'name' => 'appointment-rejected',\n 'message' => 'Sorry, your appointment is rejected'\n ]);\n\n Notification_type::create([\n 'name' => 'feedback',\n 'message' => 'you have received a new feedback'\n ]);\n\n Notification_type::create([\n 'name' => 'report',\n 'message' => 'Your report has been generated'\n ]);\n\n Notification_type::create([\n 'name' => 'manufacturer-request',\n 'message' => 'you have a new manufacturer registration'\n ]);\n\n Notification_type::create([\n 'name' => 'product-request',\n 'message' => 'you have a new product request'\n ]);\n\n Notification_type::create([\n 'name' => 'product-accept',\n 'message' => 'Your product is now approved'\n ]);\n\n Notification_type::create([\n 'name' => 'prescription',\n 'message' => 'You have received a prescription'\n ]);\n\n\n fclose($specializations);\n fclose($cities);\n fclose($degrees);\n fclose($regcouncils);\n fclose($colleges);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n $this->call(Tipo_DocumentoSeeder::class);\n\n $this->call(RolSeeder::class);\n\n $this->call(GeneroSeeder::class);\n\n $this->call(MaterialSeeder::class);\n\n $this->call(CategoriaSeeder::class);\n\n $this->call(ClasificacionSeeder::class);\n\n $this->call(UsuarioSeeder::class);\n\n $this->call(TallaSeeder::class);\n\n $this->call(ProductoSeeder::class);\n\n $this->call(ContactoSeeder::class);\n\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $data = [];\n for ($i = 0; $i < 100; $i++) {\n $data[] = [\n 'email' => $faker->email,\n 'password' => password_hash($faker->password, PASSWORD_DEFAULT),\n 'name' => $faker->name,\n 'is_verified' => $faker->boolean(),\n\n 'phone' => $faker->optional(0.9)->phoneNumber,\n 'photo_url' => $faker->imageUrl(),\n 'hobbies' => $faker->words(3, true),\n 'passion' => $faker->optional()->words(1, true),\n 'fav_quote' => $faker->optional()->sentence(6, true),\n 'fav_quote_author' => $faker->optional()->name,\n\n 'whatsapp' => $faker->optional(0.9)->phoneNumber,\n 'facebook' => $faker->optional(0.7)->userName,\n 'twitter' => $faker->optional(0.5)->userName,\n 'linkedin' => $faker->optional(0.3)->url,\n 'instagram' => $faker->optional(0.6)->userName,\n 'snapchat' => $faker->optional(0.5)->userName,\n 'website' => $faker->optional(0.4)->url,\n 'blog' => $faker->optional(0.4)->url,\n\n 'created_at' => $faker->dateTimeBetween(\"-2 years\", \"-1 year\")->format('Y-m-d H:i:s'),\n 'updated_at' => rand(0, 2) ? $faker->dateTimeThisYear->format('Y-m-d H:i:s') : null,\n ];\n }\n\n $this->insert('classmates', $data);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('zh_TW');\n\n foreach (range(1, 100) as $index) {\n $updatedAt = now()->subDays(rand(0, 500));\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'password' => Hash::make($faker->password),\n 'phone' => $faker->phoneNumber,\n 'description' => $faker->realText(rand(10, 100)),\n 'sex' => ($index % 2 == 0) ? '男' : '女',\n 'address' => $faker->address,\n 'birth' => now()->subDays(rand(5840, 36500)),\n 'created_at' => $updatedAt->subDays(rand(1, 3000)),\n 'updated_at' => $updatedAt,\n ]);\n }\n\n }", "public function run()\n {\n _Log::system(_Log::$INFO, 'seeding educations');\n $ed1 = new Education(['name'=>'TK']);$ed1->save();\n $ed2 = new Education(['name'=>'SD']);$ed2->save();\n $ed3 = new Education(['name'=>'SMP']);$ed3->save();\n $ed4 = new Education(['name'=>'SMU']);$ed4->save();\n $ed5 = new Education(['name'=>'Diploma']);$ed5->save();\n $ed6 = new Education(['name'=>'Sarjana']);$ed6->save();\n $ed7 = new Education(['name'=>'Magister']);$ed7->save();\n $ed8 = new Education(['name'=>'Doktor']);$ed8->save();\n $ed9 = new Education(['name'=>'Tidak Ada']);$ed9->save();\n _Log::system(_Log::$SUCCESS, 'seeding educations success');\n }", "public function run()\n {\n $faker = $this->fakerFactory->create();\n\n for ($i = 0; $i < 10; $i++) {\n $this->database->table(\"authors\")->insert([\n \"name\" => $faker->unique()->name,\n \"created_at\" => $faker->dateTimeThisYear,\n \"updated_at\" => $faker->dateTimeThisYear\n ]);\n }\n\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n // $faker = \\Faker\\Factory::create();\n // Assessment::create([\n // 'teacher_id' => rand(0, 10),\n // 'pupil_id' => rand(0, 10),\n // 'test_id' => rand(0, 10),\n // 'assessment_no' => rand(0, 120),\n // 'assessment_date' => $faker->date,\n // ]);\n factory(App\\Models\\Assessment::class, 10)->create();\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for($i = 0; $i < 1000; $i++) {\n App\\TestData::create([\n 'username' => $faker->userName,\n 'name' => $faker->name,\n \n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // Let's make sure everyone has the same password and\n // let's hash it before the loop, or else our seeder\n // will be too slow.\n $password = Hash::make('password');\n\n User::create([\n 'name' => 'Admin',\n 'email' => 'admin@test.com',\n 'password' => $password,\n ]);\n\n // And now let's generate a few dozen users for our app:\n for ($i = 0; $i < 10; $i++) {\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'password' => $password,\n 'country' => $faker->country,\n 'gender' => 'male',\n 'number' => $faker->phoneNumber,\n 'username' => $faker->userName,\n 'birth_date' => $faker->date($format = 'Y-m-d' , $max = 'now'),\n 'institution_type' => $faker->word,\n 'institution_name' => $faker->company,\n 'department' => $faker->domainword,\n 'faculty' => $faker->colorName,\n 'education_level' => $faker->numberBetween($min = 100 , $max = 700),\n\n ]);\n }\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\r\n {\r\n $this->seed('MnaraTableSeeder');\r\n\r\n }", "public function run()\n {\n\n $faker = Faker::create();\n foreach(range(1,100)as$index){\n\n \n DB::table('usuarios')->insert([\n 'nombre' => $faker->name(5),\n 'equipo' => $faker->state(4),\n 'nacionalidad'=> $faker->country(4)\n ]);}\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //$this->call(RolesAndPermissionsSeeder::class);\n //$this->call(CMSTableSeeder::class);\n //$this->call(IncidentTypesSeeder::class);\n //$this->call(RegistrarsSeeder::class);\n\n /*\n factory(App\\Incident::class, 50)->create();\n\n factory(\\App\\Inquiry::class, 10)\n ->create()\n ->each(function ($inq){\n $inq->incidents()->attach(\\App\\Incident::inRandomOrder()->take(random_int(1,5))->get());\n });\n */\n //$this->call(InquiryStatusSeeder::class);\n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1,100) as $index) {\n \\DB::table('modulos')->insert([\n 'descricao' => $faker->words(3,true),\n 'ativo' => $faker->boolean\n ]);\n }\n }", "public function run()\n {\n Site::factory(config('seeder.site_count'))\n ->has(Distribution::factory(2))\n ->has(SitedStock::factory(config('seeder.sitedstock_count')))\n ->create();\n \n DB::table('sites')->insert([\n 'radar_name'=>'DWSR-2501C',\n 'image'=>'027ce6f5bc035a08d207f0de97b23965.png',\n 'station_id'=>'Banjarmasin'\n ]);\n DB::table('sites')->insert([\n 'radar_name'=>'DWSR-3501C',\n 'image'=>'027ce6f5bc035a08d207f0de97b23965.png',\n 'station_id'=>'Cengkareng'\n ]);\n }", "public function run()\n {\n \t// php artisan db:seed --class=Chuckbe\\\\ChuckcmsTemplateFrankfurt\\\\seeds\\\\ChuckcmsTemplateFrankfurtTableSeeder\n $fonts = [];\n $fonts['raw'] = 'Roboto:100,300,400,400italic,700|Patua+One:100,300,400,400italic,700|Lato:400,400italic,700,700italic,900|Roboto:100,300,400,400italic,500,700,700italic|Montserrat:100,300,400,400italic,500,700,700italic';\n \n $css = [];\n $css['global']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/global.css';\n $css['global']['asset'] = 'true';\n\n $css['structure']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/structure.css';\n $css['structure']['asset'] = 'true';\n\n $css['frankfurt']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/frankfurt.css';\n $css['frankfurt']['asset'] = 'true';\n\n $css['custom']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/custom.css';\n $css['custom']['asset'] = 'true';\n \n $js = []; \n $js['jquery']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery-2.1.4.min.js';\n $js['jquery']['asset'] = 'true';\n\n $js['mfnmenu']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/mfn.menu.js';\n $js['mfnmenu']['asset'] = 'true';\n\n $js['jqueryplugins']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery.plugins.js';\n $js['jqueryplugins']['asset'] = 'true';\n\n $js['jqueryjplayer']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery.jplayer.min.js';\n $js['jqueryjplayer']['asset'] = 'true';\n\n $js['animations']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/animations/animations.js';\n $js['animations']['asset'] = 'true';\n\n $js['translate3d']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/translate3d.js';\n $js['translate3d']['asset'] = 'true';\n\n $js['scripts']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/scripts.js';\n $js['scripts']['asset'] = 'true';\n\n $js['email']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/email.js';\n $js['email']['asset'] = 'true';\n\n $json = [];\n\n // create template\n Template::updateOrCreate(\n ['slug' => 'chuckcms-template-frankfurt'],\n ['name' => 'ChuckCMS Template Frankfurt',\n 'hintpath' => 'chuckcms-template-frankfurt',\n 'path' => 'chuckbe/chuckcms-template-frankfurt',\n 'type' => 'default',\n 'version' => '0.1',\n 'author' => 'Karel Brijs (karel@chuck.be)',\n 'fonts' => $fonts,\n 'css' => $css,\n 'js' => $js,\n 'json' => $json,\n 'active' => 1]\n );\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n foreach (range(1,50) as $index) {\n $data = [\n 'id' => $faker->id,\n 'txt_protocolo' => $faker->unique()->txt_protocolo,\n ];\n Protocolo::create($data);\n }\n }", "public function run()\n {\n // *****Data Using Manually*********\n // $student = [\n // [\n // 'name'=>'Jogi',\n // 'lastname'=>'Singh',\n // ],\n // [\n // 'name'=>'Jonty',\n // 'lastname'=>'Singh',\n // ],\n // [\n // 'name'=>'Harsh',\n // 'lastname'=>'Srivastav',\n // ],\n \n // ];\n\n // foreach ($student as $key => $value) {\n // Student::create($value);\n // }\n // *******End Data Manually*************\n // *****************Data Dump Using Faker*******************\n $faker = Faker::create();\n foreach (range(1,100) as $key => $value) {\n Student::create(\n [\n 'name'=>$faker->name,\n 'lastname'=>$faker->lastname\n ]\n );\n }\n\n }", "public function run()\n\n {\n\n DB::table('user')->insert([\n 'name'=> 'Admin',\n 'phonenumber'=>'01694844753',\n 'password'=>hash('ripemd160','123456'),\n 'avatar'=>'/img/unknowavatar.png',\n ]);\n $faker = Faker\\Factory::create();\n\n for($i=0; $i<5; $i++){\n \n DB::table('user')->insert([\n 'name'=> $faker->name,\n 'phonenumber'=>$faker->phoneNumber,\n 'password'=> Str::random(10),\n 'avatar'=>$faker->image,\n ]);\n \n }\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n// $this->seedTestForms($faker);\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n \n //لازم المودل يكون عامل \n //has Facroty عشان اقدر استعملو \n //لتنفيذ الفاكتوري\n // Category::factory(19)->create();\n\n Product::factory(199)->create();\n //Tag::factory(15)->create();\n\n //هنا بستدعي السيدر عشان انفذو\n // $this->call(CategoriesTableSeeder::class);\n\n /*\n Category::factory(10)\n ->has(Category::factory(5)\n ->has(Product::factory(15),'products')\n ,'children')\n ->create();\n*/\n\n }", "public function run()\n {\n factory(\\App\\Models\\Discusse::class,config('other.seeder_count'))->create([\n 'is_better' => 0\n ]);\n factory(\\App\\Models\\Discusse::class,config('other.seeder_count'))->create([\n 'is_better' => 1\n ]);\n }", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1,50) as $index) {\n DB::table('empleado')->insert([\n 'dni' => $faker->numberBetween(20000000, 43000000),\n 'apellidonombre' => $faker->firstName(). \" \" . $faker->lastName(),\n 'idempleadocapataz' => rand(1, 50),\n 'especialidad' => $faker->jobTitle(),\n ]);\n }\n }", "public function run()\n {\n $count = Regency::count();\n if($count == 0) {\n return $this->command->alert(\n 'Seed Error !! Silahkan Seed Regency Terlebih Dahulu'\n );\n }\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n District::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n $data = array_map('str_getcsv', file(base_path().\"/storage/districts.csv\"));\n foreach ($data as $x) {\n $prov = new District();\n $prov->id = $x[0];\n $prov->regency_id = $x[1];\n $prov->name = $x[2];\n $prov->save();\n }\n }", "public function run()\n {\n $faker=Faker::create();\n foreach (range(1,20) as $i){\n DB::table('personas')->insert([\t \n 'nombre' => $faker->name(),\n 'apellido' => $faker->lastName(),\n 'correo' => $faker->email(),\n 'edad'=>$faker->randomNumber(2),\n ]);\n }\n // factory(personas::class, 99)->create();\n }", "public function run()\n {\n //\n $faker = Faker::create();\n\n for ($i = 0; $i < 100; $i++) {\n $data = [\n 'pelanggan' => $faker->name,\n 'alamat' => $faker->address,\n 'telp' => $faker->phoneNumber,\n ];\n\n Pelanggan::create($data);\n }\n }", "public function run()\n {\n DB::table('users')->delete();\n $json = File::get(\"database/seederfile/users.json\");\n $data = json_decode($json);\n foreach($data as $obj)\n { User::create(array(\n \t'id' => $obj -> id,\n \t'role_id' => $obj -> role_id,\n \t'username' => $obj -> username,\n \t'name' => $obj -> name,\n \t'email' => $obj -> email,\n #'password' => Hash::make('admin1')]);\n \t'password' => Hash::make($obj -> password),\n\t\t\t'remember_token' => $obj -> remember_token,\n \t'created_at' => $obj -> created_at,\n\t\t\t'updated_at' => $obj -> updated_at\n ));\n\t\t}\n }", "public function run()\n {\n //\n// factory(\\App\\Bill::class,10)->create();\n \\App\\Helpers\\FactoryHelper::force_seed(\\App\\Bill::class,4);\n }", "public function run()\n {\n\t\t// Let's truncate our existing records to start from scratch.\n File::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n File::create([\n 'name' => $faker->name,\n\t\t\t\t'user_id' => User::first()->id,\n ]);\n }\n }", "public function run()\n {\n // Create my personal user\n $email = env('ADMIN_USER_EMAIL', false);\n $password = env('ADMIN_USER_PASSWORD', false);\n if (!$email || !$password) {\n throw new \\Exception('You must set admin credentials in .env before seeding');\n }\n $jakob = factory(App\\User::class)->create([\n 'name' => 'Jakob Buis',\n 'email' => $email,\n 'password' => bcrypt($password),\n ]);\n\n // Create the frontend as password-grant client\n $client = (new \\Laravel\\Passport\\Client)->forceFill([\n 'user_id' => $jakob->id,\n 'name' => 'librorum-frontend',\n 'secret' => str_random(40),\n 'redirect' => env('APP_URL'),\n 'personal_access_client' => false,\n 'password_client' => true,\n 'revoked' => false,\n ]);\n $client->save();\n\n // Create the content\n $tags = factory(\\App\\Tag::class, 5)->create(['user_id' => $jakob->id]);\n\n // Create 5 notebooks, each with 3 pages\n // each linked to 2 randomly selected tags\n $notebooks = factory(\\App\\Notebook::class, 5)->create(['user_id' => $jakob->id]);\n $notebooks->each(function($notebook) use ($tags) {\n\n $pages = factory(\\App\\Page::class, 3)->create([\n 'notebook_id' => $notebook->id,\n ]);\n\n $pages->each(function($page) use ($tags) {\n $page->tags()->attach($tags->random(2));\n });\n });\n }", "public function run()\n {\n $faker = Faker\\Factory::create('en_US');\n\n foreach(range(1, 10) as $index) {\n Institute::create([\n 'inst_profile_guid' => $faker->uuid,\n 'user_id' => rand(1, 20),\n 'institute_code' => $faker->postcode,\n 'institute_name' => $faker->company,\n 'institute_description' => $faker->sentence,\n 'contact' => $faker->phoneNumber,\n 'address' => $faker->address,\n 'city' => $faker->city,\n 'postal_code' => $faker->postcode,\n 'country' => $faker->country\n ]);\n }\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('App\\Meet');\n\n for($i = 1; $i <= 20; $i ++){\n \tDB::table('meets')->insert([\n \t\t'user_id' => $faker->numberBetween($min = 1, $max = 20),\n \t\t'title' => $faker->sentence(),\n \t\t'meet_date' => $faker->dateTimeThisYear($max = 'now', $timezone = date_default_timezone_get()),\n \t\t'location' => $faker->streetName,\n \t\t'lat' => $faker->latitude($min = -90, $max = 90),\n \t\t'lng' => $faker->longitude($min = -180, $max = 180),\n \t\t'description' => implode($faker->paragraphs(5)),\n \t\t'deleted' => 0,\n \t\t'updated_at' => \\Carbon\\Carbon::now(),\n \t\t'created_at' => \\Carbon\\Carbon::now(),\n \t\t]);\n }\n\n\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(AttributesSeeder::class);\n\n File::factory()->count(10)->create();\n\n // Get all the attributes attaching up to 3 random attributes to each file\n $attributes = Attribute::all();\n\n // Populate the pivot table\n File::all()->each(function ($file) use ($attributes) {\n $file->attributes()->attach(\n $attributes->random(rand(1, 5))->pluck('id')->toArray(),\n [\n 'order' => rand(1, 5)\n ]\n );\n });\n\n Model::reguard();\n }", "public function run()\n {\n // DB::table('users')->truncate(); //elimina la bd cada vez que realizo el seed\n\n \n\n \n\n\n factory(App\\User::class,10)->create();\n\n factory(App\\User::class)->create([\n 'name' =>'Administrador',\n 'email' =>'admin@turismo.app',\n 'role' =>'admin',\n 'password'=>bcrypt('secret')\n\n ]);\n\n\n factory(App\\hotel::class,1)->create();\n \n \n\n }", "public function run()\n {\n //$this->call(SectionSeeder::class);\n $this->call(AdminSeeder::class);\n //$this->call(ClientSeeder::class);\n \n \n\n\n\n //DB::table('users')->insert([\n // 'name' => 'Harry Han',\n // 'email' => 'harry.test@hanix.com.au',\n // 'password' => bcrypt('password'),\n // 'contractorLastname' => 'Han',\n // 'contractorCompany' => 'test-company' ,\n // 'contractorContactNumber' => '0600000000',\n // 'contractorStatus' => 'active'\n //]);\n }", "public function run()\n {\n $seeds = [\n [\n 'id'=>1,\n 'user_id'=>'1',\n 'firstname'=>'Jonas',\n 'lastname'=>'Jonaitis',\n 'position'=>'Administratorius',\n 'email'=>'sbadmin@sbadmin.lt',\n 'phone'=>'Nėra',\n 'birthday'=>'2017-04-05',\n 'photo'=>'150x150.png',\n ],\n ];\n\n foreach ($seeds as $seed) {\n \\App\\Profile::create($seed);\n }\n }", "public function run()\n {\n \t$faker = Factory::create();\n \tfor ($i=0; $i <99 ; $i++) { \n \t\tKontak::create([\n \t\t\t'nama'=>$faker->name,\n \t\t\t'email'=>$faker->email,\n \t\t\t'foto'=>$faker->text\n \t\t]);\n \t}\n }", "public function run()\n\t{\n\n $faker = \\Faker\\Factory::create();\n\n // Let's make sure everyone has the same password and \n // let's hash it before the loop, or else our seeder \n // will be too slow.\n $password = Hash::make('aa2016aa');\n\n User::create([\n 'type' => '1',\n 'fname' => 'artiom',\n 'lname' => 'live',\n 'email' => 'artiom@live.com',\n 'password' => $password,\n ]);\n\n User::create([\n 'type' => '0',\n 'fname' => 'artiom',\n 'lname' => 'demo',\n 'email' => 'artiom@demo.com',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n // Admin Acount Seeding\n $add = new User;\n $add->name = 'karim';\n $add->email= 'karim@admin.com';\n $add->password = Hash::make(123456);\n $add->phone = '01126878406';\n $add->prefix = 'karim';\n $add->level = 'admin';\n $add->save();\n\n //Language Seeding\n $language = new Languages;\n $language->language = \"English\";\n $language->prefix = \"en\";\n $language->direction = \"ltr\";\n $language->save();\n\n //Setting Seeding\n $appSetting = new Setting;\n $appSetting->sitename = \"Cure2Us\";\n $appSetting->email = \"admin@cure2us.com\";\n $appSetting->save();\n }", "public function run()\n {\n //\n \t$fake = \\Faker\\Factory::create();\n \\DB::table('users')->insert([\n 'name' => 'Nguyễn Văn Hiệp',\n 'email' => 'supperadmin@gmail.com',\n 'is_admin' => '1',\n 'password'=> bcrypt('12345678')\n ]);\n for ($i=0; $i < 20; $i++) {\n \\DB::table('users')->insert([\n 'name' => $fake->name,\n 'email' => $fake->email,\n 'password'=> bcrypt('12345678')\n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++)\n {\n $gender = array_rand(['Men', 'Women'], 1);\n\n User::create([\n 'id' => ($i + 1),\n 'first_name' => $faker->firstName($gender == 0 ? 'male' : 'female'),\n 'last_name' => $faker->lastName,\n 'sex' => ($gender == 0 ? 'Men' : 'Women'),\n 'birthday' => $faker->date('Y-m-d', 'now'),\n 'email' => $faker->email,\n 'address' => $faker->address,\n 'telephone' => rand(1111111111,9999999999)\n ]);\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create('fr_FR');\n\n for($i=0; $i<5; $i++){\n\n $data = [\n [\n 'pseudo' => $faker->userName,\n 'email' => $faker->unique()->email,\n 'firstname' => $faker->firstName,\n 'lastname' => $faker->lastName,\n 'password' => $faker->password,\n 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'nbateam_id' => 1,\n ]\n ];\n User::insert($data);\n\n }\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n foreach (range(1, 20) as $value) {\n User::create([\n 'name' => $faker->text('20'),\n 'email' => $faker->email,\n 'dob'=> $faker->date(),\n 'password' => bcrypt('anhvit12'),\n ]);\n\n }\n }", "public function run()\n {\n if (!File::exists(public_path('uploads/faker/heritage'))) {\n File::makeDirectory(public_path('uploads/faker/heritage'), 777, true);\n }\n $faker = Faker\\Factory::create();\n for ($i = 0; $i < 16; $i++) {\n $data = [\n 'title' => $faker->sentence(),\n 'description' => theExcerpt($faker->paragraph, 255),\n 'content' => $faker->text(2000),\n 'thumbnail' => 'uploads/faker/heritage/' . $faker->image(public_path('uploads/faker/heritage'), 420, 236, null, false),\n 'cover' => 'uploads/faker/heritage/' . $faker->image(public_path('uploads/faker/heritage'), 1170, 150, null, false),\n 'province_id' => rand(1, 63),\n 'area_id' => rand(63, 70),\n 'user_id' => rand(1, 10),\n 'lang' => 'en',\n 'parent_id' => 0,\n 'status' => STATUS_ACTIVATED\n ];\n \\App\\IZee\\Heritages\\Heritage::create($data);\n }\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n $gender = $faker->randomElement(['L', 'P']);\n $religion = $faker->randomElement(['Kristen', 'Islam', 'Budha']);\n\n for ($i=0; $i < 20; $i++) { \n DB::table('siswa')->insert([\n 'nama_depan' => $faker->firstName,\n 'nama_belakang' => $faker->lastName,\n 'jenis_kelamin' => $gender,\n 'agama' => $religion,\n 'alamat' => $faker->address\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n\n foreach(range(1, 10) as $index)\n {\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'username' => $faker->userName,\n 'password' => $faker->password,\n 'location' => $faker->text,\n 'profile_picture' => $faker->imageUrl($width = 550, $height = 550)\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $samples_temp = [];\n\n for($i = 0; $i < 100; $i++)\n {\n $samples_temp[] = [\n 'nombre' => $faker->name,\n 'email'=> $faker->email\n\n ];\n }\n Correo::insert($samples_temp);\n\n\n }", "public function run()\n {\n $faker = $faker = Faker\\Factory::create();\n foreach (range(1,250) as $index) {\n DB::table('employee')->insert([\n 'employee_first_name' => $faker->name,\n 'employee_last_name' => $faker->name,\n 'employee_ref_number' => 00000,\n 'employee_phone_number' => rand(0,5),\n 'employee_address' => $faker->name,\n 'employee_address_two' => $faker->name,\n 'employee_country' => $faker->name,\n 'employee_state' => $faker->state,\n 'employee_city' => $faker->city,\n 'employee_email' => $faker->email,\n 'employee_pin_code' => rand(0,5),\n 'employee_reference' => $faker->name,\n 'employee_unique_identy' => $faker->name,\n ]);\n }\n }", "public function run()\n {\n $facker = app(Faker\\Generator::class);\n\n $avatars = [\n 'https://avatars3.githubusercontent.com/u/41312704?s=460&v=4',\n 'https://cdn.learnku.com/uploads/avatars/24327_1530087651.jpeg!/both/200x200',\n ];\n\n $users = factory(User::class)\n ->times(10)\n ->make()\n ->each(function ($user, $index) use ($facker, $avatars) {\n $user->avatar = $facker->randomElement($avatars);\n });\n $user_array = $users->makeVisible(['password', 'remember_token'])->toArray();\n User::insert($user_array);\n\n $user = User::find(1);\n $user->name = '十步';\n $user->email = '1085530400@qq.com';\n $user->avatar = 'https://avatars3.githubusercontent.com/u/41312704?s=460&v=4';\n $user->save();\n\n // 初始化用户角色,将1号用户设置为站长\n $user->assignRole('Founder');\n $user = User::find(2);\n $user->assignRole('Maintainer');\n }", "public function run()\n {\n User::create ( [\n 'username' => 'anh.tuan',\n 'first_name' => 'Tuan',\n 'last_name' => 'Nguyen',\n 'email' => 'anh.tuan@mulodo.com',\n 'is_admin' => 1,\n 'password' => bcrypt('123456')\n ]);\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Faker::create();\n User::create ( [\n 'username' => $faker->userName,\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName ,\n 'email' => $faker->email,\n 'is_admin' => 0,\n 'password' => bcrypt('123456')\n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for($i =0; $i<20; $i++){\n \\App\\Organisation::create([\n 'name' => $faker->company,\n 'business_type_id' => $faker->numberBetween(1, 3),\n 'logo'=>$faker->imageUrl($width = 200, $height = 200, 'abstract',true),\n 'address' => $faker->address,\n 'email' => $faker->companyEmail,\n 'mobile' => $faker->numberBetween(263772000000,263779999999),\n 'telephone'=>$faker->numberBetween(240291,29999)\n ]);\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => 'correo@correo.com',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => 'correo2@correo.com',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => 'correo@correo.com',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }", "public function run()\n {\n $faker = Faker::create();\n\n for($i = 0; $i < 50; $i++){\n $uid = DB::table('users')->select('id')->inRandomOrder()->first();\n $student = new Student([\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName,\n 'teacher_id' => $uid->id,\n 'code' => $faker->bothify('**********')\n ]);\n\n $student->save();\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $preUach = PreUach::all();\n $samples_temp = [];\n\n foreach ($preUach as $item)\n {\n\n\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'persona_matricula'=> $faker->lastName.' '. $faker->firstName,\n 'fecha_matricula'=>$faker->dateTimeBetween($startDate = '-5 months', $endDate = 'now')\n ]; \t\n }\n\n Declaracion::insert($samples_temp);\n \n }" ]
[ "0.741271", "0.72163844", "0.71867263", "0.7150963", "0.7011614", "0.6992453", "0.6889081", "0.6877449", "0.68096465", "0.679051", "0.67819595", "0.6763185", "0.6725394", "0.67226577", "0.67199546", "0.67100257", "0.6709864", "0.67040205", "0.6703833", "0.66986066", "0.66848785", "0.66676813", "0.6664289", "0.66619146", "0.6658433", "0.6657409", "0.66464853", "0.66320693", "0.6631319", "0.66305304", "0.66290253", "0.66284007", "0.6624839", "0.6623553", "0.6619334", "0.6618539", "0.6608564", "0.65820485", "0.65815806", "0.65786946", "0.65776837", "0.65724593", "0.65712655", "0.6568998", "0.6564165", "0.65635526", "0.65632516", "0.6561539", "0.65603864", "0.6557867", "0.6557867", "0.6557841", "0.6557841", "0.6557841", "0.6557841", "0.6557841", "0.6556947", "0.6555183", "0.6549153", "0.65489244", "0.654778", "0.6542256", "0.6541639", "0.6536023", "0.65329695", "0.6532951", "0.6532415", "0.65314263", "0.65287995", "0.6528459", "0.65275294", "0.6521118", "0.6521097", "0.6520966", "0.6520696", "0.65203667", "0.6519488", "0.6513222", "0.651225", "0.6512065", "0.6511974", "0.6510938", "0.6509229", "0.6507844", "0.65072274", "0.6500883", "0.65005153", "0.64961535", "0.6495031", "0.6491838", "0.6490735", "0.6488336", "0.64861405", "0.6485924", "0.6479967", "0.6479224", "0.6478154", "0.6477599", "0.6476717", "0.64762294", "0.64754003" ]
0.0
-1
Set up the api details
public function GetPlayerAchievements($appId) { $this->method = __FUNCTION__; $this->version = 'v0001'; // Set up the arguments $arguments = [ 'steamid' => $this->steamId, 'appid' => $appId, 'l' => 'english', ]; // Get the client $client = $this->setUpClient($arguments)->playerstats; // Clean up the games $achievements = $this->convertToObjects($client->achievements); return $achievements; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setup_api() {\n\t\trequire_once 'includes/class-themeisle-ob-rest-server.php';\n\t\tif ( ! class_exists( 'Themeisle_OB_Rest_Server' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$api = new Themeisle_OB_Rest_Server();\n\t\t$api->init();\n\t\trequire_once 'includes/importers/helpers/trait-themeisle-ob.php';\n\t}", "public function set_up() {\n\n\t\t$this::base_set_up();\n\t\tdo_action( 'rest_api_init' );\n\t\t$this->server = rest_get_server();\n\n\t}", "protected function setUp()\n {\n $this->api_key = getenv('API_KEY');\n $this->api = new Api($this->api_key);\n }", "protected function init_api() {\n\t\tinclude_once dirname( __FILE__ ) . '/includes/class-coinbase-api-handler.php';\n\n\t\tCoinbase_API_Handler::$log = get_class( $this ) . '::log';\n\t\tCoinbase_API_Handler::$api_key = $this->get_option( 'api_key' );\n\t}", "function rest_api_init()\n {\n }", "protected function _initApi() {\n\t$this->bootstrap('Zend');\n\t$this->bootstrap('ApiRoutes');\n }", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->api_id = self::API_ID;\r\n\t\t\t$this->api_secret = self::API_SECRET;\r\n\t\t}", "protected function setUp() {\n $this->object = new KactoosAPI;\n $this->object->apikey('8f14e45fceea167a5a36dedd4bea2543')\n ->country('br')\n ->module('products')\n ->appname('jaydson')\n ->format('xml');\n }", "public function __construct()\r\n {\r\n $this->constructApiUrl();\r\n }", "private function init() {\n $apiParts = $this->request->getApiParts();\n $this->requestedId = array_shift($apiParts);\n $this->apiParts = $apiParts;\n \n $this->siteDriver = Datastore::getSiteDriver();\n }", "protected function setUp()\n {\n $config = array(\n \"accessToken\" => \"accessToken\",\n \"sk_url\" => \"sk_url\",\n \"redirect_url\" => \"redirect_url\",\n \"app_id\" => \"app_id\",\n \"app_secret\" => \"app_secret\"\n );\n\n $this->object = new API($config);\n }", "private function settings_api_init() {\r\n\t\tif ( ! isset( $this->hook_suffix ) )\r\n\t\t\treturn;\r\n\r\n\t\t// Infusion API settings\r\n\t\t$section = 'infusion-api';\r\n\t\tadd_settings_section(\r\n\t\t\t$section,\r\n\t\t\t__( 'Infusion API Settings', 'inf-member' ),\r\n\t\t\tarray( &$this, 'section_header' ),\r\n\t\t\t$this->hook_suffix\r\n\t\t);\r\n\r\n\t\tadd_settings_field(\r\n\t\t\t'inf_url',\r\n\t\t\t_x( 'Infusion API Service URL', 'inf-member' ),\r\n\t\t\tarray( &$this, 'display_inf_url' ),\r\n\t\t\t$this->hook_suffix,\r\n\t\t\t$section,\r\n\t\t\tarray( 'label_for' => 'inf_url' )\r\n\t\t);\r\n\t\tadd_settings_field(\r\n\t\t\t'inf_key',\r\n\t\t\t_x( 'Infusion API key', 'inf-member' ),\r\n\t\t\tarray( &$this, 'display_api_key' ),\r\n\t\t\t$this->hook_suffix,\r\n\t\t\t$section,\r\n\t\t\tarray( 'label_for' => 'inf_key' )\r\n\t\t);\r\n\r\n /*if(Inf_Member::app_credentials_exist())\r\n $this->db_install();*/\r\n\t}", "public static function init() {\n\t\tstatic::$apis = [\n\t\t\t'content' => new Content_API(),\n\t\t\t'contributors' => new Contributors_API(),\n\t\t\t'dashboards' => new Dashboards_API(),\n\t\t\t'options' => new Options_API(),\n\t\t\t'post_types' => new Post_Types_API(),\n\t\t\t'quick_cards' => new Quick_Cards_API(),\n\t\t];\n\n\t\tadd_action( 'rest_api_init', [__CLASS__, 'register_rest_routes'] );\n\n\t}", "final private function constructApiUrl()\r\n {\r\n\t\trequire_once 'bset.php';\r\n $this->apiUrl = 'https://api.telegram.org/bot' . BOT_TOKEN;\r\n }", "public function processApi()\n\t\t{\n\t\t\t$this->createEntry();\n\t\t}", "function permly_api($api_key=''){\n\t\t$this->api_key = $api_key;\n\t\t$this->url = $this->api_server_protocol.\"://\".$this->api_server.\"/?remote_service=rs_external_api&key=1&interface=eai_permly&version=\".$this->api_version;\n\t}", "public function setApikey()\n {\n $this->apiKey = Config::get('leanpub.API_KEY');\n }", "public function setUp()\n {\n // Setting endpoint URL\n $this->endpoint = 'http://chez-syl.fr/yaapi/api/';\n }", "public function __construct()\n {\n $this->client = new Client();\n $this->apiKey = Api::platform('TikApi')->first()->api_key;\n }", "public function __construct() {\n global $apiConfig;\n if (! empty($apiConfig['developer_key'])) {\n $this->developerKey = $apiConfig['developer_key'];\n }\n if (! empty($apiConfig['oauth2_client_id'])) {\n $this->clientId = $apiConfig['oauth2_client_id'];\n }\n if (! empty($apiConfig['oauth2_client_secret'])) {\n $this->clientSecret = $apiConfig['oauth2_client_secret'];\n }\n if (! empty($apiConfig['oauth2_redirect_uri'])) {\n $this->redirectUri = $apiConfig['oauth2_redirect_uri'];\n }\n if (! empty($apiConfig['oauth2_access_type'])) {\n $this->accessType = $apiConfig['oauth2_access_type'];\n }\n if (! empty($apiConfig['oauth2_approval_prompt'])) {\n $this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];\n }\n }", "public function __construct() {\n $dotenv = new Dotenv();\n $dotenv->load(dirname(__DIR__).'/.env');\n\n $this->api = new Api($_ENV['CLODUI_API']);\n\n $client_id = $_ENV['CLODUI_CLIENT_ID'];\n $user_pool_id = $_ENV['CLODUI_USER_POOL_ID'];\n $identity_pool_id = $_ENV['CLODUI_IDENTITY_POOL_ID'];\n\n Logger::debug('Config Client ID '. $client_id. ', User pool id '. $user_pool_id. ', Identity pool id '. $identity_pool_id);\n $this->auth = new Auth($client_id, $user_pool_id, $identity_pool_id);\n }", "public function setUp(): void {\n // Set API details in config.\n set_config('turnitinapiurl', 'http://www.example.com', 'plagiarism_turnitinsim');\n set_config('turnitinapikey', 1234, 'plagiarism_turnitinsim');\n set_config('turnitinenablelogging', 0, 'plagiarism_turnitinsim');\n }", "private function _initApiCommons()\n {\n // Disable debug information - Required to generate valid XML output\n //Configure::write('debug', 0);\n\n // Avoids render() call\n $this->disableLayout();\n $this->_helper->viewRenderer->setNoRender();\n\n // Instanciate Upload Module\n $this->uploadApi = new KwUploadAPI($this->apiSetup);\n }", "public function __construct()\n {\n parent::__construct();\n $this->client = new APIClient();\n }", "public function setUp() {\n $this -> CI = &get_instance();\n $this -> flights = $this -> CI -> data['all_flights'];\n $this -> albatros = WackyAPI::getAlbatros();\n }", "public function __construct()\n {\n $this->api_id = Config::get('biddingos.ym.api_id');\n $this->api_token = md5(Config::get('biddingos.ym.api_token'));\n $this->refresh_time = Config::get('biddingos.ym.refresh_time');\n parent::__construct();\n }", "public function __construct() {\n # returns the base portal URL as defined in conf file\n $configServ = new config();\n $this->baseUrl = $configServ->getServerBaseUrl() . \"/gocdbpi\";\n $this->docsURL = $configServ->getWriteApiDocsUrl();\n\n #Define some generic exception messages (remaining ones will be generated once entity type and value are known)\n $this->genericExceptionMessages[\"URLFormat\"] =\n \"API requests should take the form $this->baseUrl\" .\n \"/APIVERSION/ENTITYTYPE/ENTITYID/ENTITYPROPERTY/[ENTITYPROPERTYKEY]. \" .\n \"For more details see: $this->docsURL\";\n }", "public function __construct()\n {\n global $API_AUTHORIZATIONS;\n\n //Construct generic API handler\n parent::__construct();\n\n //Define authorizations for current API module\n $this->AUTH = $API_AUTHORIZATIONS[self::MODULE];\n }", "public function __construct()\n\t{\t\t\n\t\terror_reporting(E_ALL);\n\t\t$this->api = new ApiDirect('data');\n\t}", "public function __construct()\n {\n $this->setApiKey();\n $this->setRequestOptions();\n }", "public static function init() {\n if (self::$apiClient === null)\n self::$apiClient = new ApiClient();\n }", "public function __construct(){\n\n\t\t//Store json_decode array in api1\n\t\t$api1 = ConfigURL::getURL(ApiList::$name);\n\t\t\n\t\t//Check if products are received, if true, store them in $_products, else get the error received from ConfigURL class\n\t\tif (isset($api1['products'])) {\n\t\t\t$this->_products = $api1['products'];\n\t\t}\n\t\telse{\n\t\t\t$this->_errors = ConfigURL::errors();\n\t\t}\n\t}", "public function setUp()\r\n {\r\n $this->config += [\r\n 'http_errors' => false,\r\n 'timeout' => 10.0,\r\n 'base_uri' => $this->description->getBaseUri(),\r\n 'apiKey' => 'XXX',\r\n 'projectId' => 000,\r\n ];\r\n }", "public function __construct() {\t\t\n\t\t$this->apikey='uYXMOYkzh1bJwKLk8SFb00EiYydmLDvoqskEOtqlk4hSE9NAM9RRV08C';\n\t\t$this->apisec='9FsUJswhQX13nGdahA6YDgkfZdYd05/SPObJKD12GAP5LKq1smT0FAVuMc26PH0fvuYPVlPVECBYXvu8Aqy92Q==';\n\t\t$this->url = 'https://api.kraken.com';\n }", "public function getApi();", "public function getApi();", "public function getApi();", "public function __construct()\n {\n //setup connection\n $this->api = new Connector();\n $this->api->setAuth(config('swimtimes.username'), config('swimtimes.password'));\n\n //setup style json file for fast calculation styles\n $this->createStylesJsonCache();\n }", "public function __construct() {\n if (!$this->api) {\n $this->api = new Wrapper();\n }\n }", "public function setup() {}", "public function __construct()\n {\n $CSO = new Api_Resources_CSO();\n $CSO->authenticate('timojong', 'FG4d%!k3hU');\n $this->addResource('CSO', $CSO);\n\n $OpenOnderwijs = new Api_Resources_OpenOnderwijs();\n $this->addResource('OpenOnderwijs', $OpenOnderwijs);\n }", "public function init()\n {\n $this->curl = (new Curl())->setOption(\n CURLOPT_HTTPHEADER, [\n 'Authorization: Basic ' . $this->apiKey,\n 'Content-Type: application/json'\n ]\n );\n }", "protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }", "protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }", "abstract protected function setup_info();", "public function __construct()\n {\n include(ANAX_INSTALL_PATH . '/config/vars.php');\n $this->apikey = $apiKeyIp;\n $this->baseUrl = \"http://api.ipstack.com/\";\n $this->baseUrlMap = \"https://www.openstreetmap.org/\";\n $this->curl = new Curl();\n }", "public function __construct()\n {\n $this->dev = config('novaposhta.dev');\n $this->getApi();\n $this->url = config('novaposhta.base_uri').config('novaposhta.point');\n\n $this->return = [\n 'success' => false,\n 'result' => null,\n 'info' => [],\n ];\n }", "public function __construct($api_key, $api_url='https://newsapi.org/v2/'){\n $this->api_key = 'apiKey=' . $api_key;\n $this->api_url = $api_url;\n }", "public function __construct()\n {\n $this->apiKey = Config::i()->getSXApiKey();\n }", "protected function setUp() {\n\t\tif (file_exists('../config.php')) {\n\t\t\tinclude ('../config.php');\n\t\t} else {\n\t\t\tinclude ('config.php');\n\t\t}\n\t\t\n\t\t$transport = getTransport($config);\t\n\t\t$mapper = new XmlMapper();\n\t\t$connector = new ApiConnector($config['clientname'], $transport, $mapper);\n\t\t$this->object = $connector->getService('InvoiceProfile');\n\t}", "public function setUp()\n {\n $config = [\n 'host' => 'http://dev01.blogic.crcpress.local/',\n 'app_login' => 'www.crcpress.com',\n 'app_pass' => 'overlord',\n 'extra_config' => [\n 'user_agent' => 'CRC PHP Soap client 2.0',\n 'connection_timeout' => 6,\n 'cache_wsdl' => \\WSDL_CACHE_MEMORY,\n 'trace' => true,\n 'soap_version' => \\SOAP_1_1,\n 'encoding' => 'UTF-8'\n ],\n ];\n $ecommerceApi = new EcommerceAPI($config);\n $this->shopperService = $ecommerceApi->getService('Shopper');\n $this->invoiceService = $ecommerceApi->getService('InvoiceManager');\n }", "public function setup() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'manually_load_api' ), 100 );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );\n\t\tadd_filter( 'plugin_row_meta', array( $this, 'filter_plugin_row_meta' ), 10, 4 );\n\t\tadd_action( 'admin_notices', array( $this, 'permalink_warning' ) );\n\t\tadd_action( 'admin_init', array( $this, 'flush_rewrites' ), 10000 );\n\t}", "public static function setUpBeforeClass(): void\n {\n self::$av = new Alfaview();\n self::$av->setHost(getenv('API_HOST'));\n self::$credentials = new AuthenticationAuthorizationCodeCredentials();\n self::$credentials->setClientId(getenv('API_CLIENT_ID'));\n self::$credentials->setCode(getenv('API_CODE'));\n self::$credentials->setCompanyId(getenv('API_COMPANY_ID'));\n }", "public function __construct(Api $api)\n {\n $this->api = $api;\n }", "public function __construct(Api $api)\n {\n $this->api = $api;\n }", "public function __construct(Api $api)\n {\n $this->api = $api;\n }", "function __construct($_PARAMS)\n\t\t{\n\t\t\tparent::__construct($_PARAMS);\n\t\t\t$this->load_api();\n\t\t\t\n\t\t}", "public function __construct()\n {\n $this->API_TOKEN = env('API_TOKEN');\n// $this->API_TOKEN = '9876543210'; //TODO REMOVE THIS LINE AND REMOVE ABOVE COMMENT\n }", "public function __construct()\n\t{\n\t\t$this->request = ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t\t? $_POST\n\t\t\t: $_GET;\n\n\t\t// Load the API configuration file\n\t\tKohana::config_load('api');\n\n\t\t// Get the IP Address of the client submitting the API request\n\n\t\t// Check if the IP is from a shared internet connection\n\t\tif ( ! empty($_SERVER['HTTP_CLIENT_IP']))\n\t\t{\n\t\t\t$this->request_ip_address = $_SERVER['HTTP_CLIENT_IP'];\n\t\t}\n\t\t// Check if the IP address is passed from a proxy server such as Nginx\n\t\telseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t{\n\t\t\t$this->request_ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->request_ip_address = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\t// Unpack the URL parameters\n\t\t$this->api_parameters = serialize(array_keys($this->request));\n\n\t\t// Instantiate the database\n\t\t$this->db = new Database();\n\t}", "private function init()\n {\n $this->apiLive = false;\n\n $this->returnUrl = \"\";\n $this->cancelUrl =\"\";\n \n //Whether we are in sandbox or in live environment\n if ((bool)$this->apiLive === true) {\n //live\n $this->X_SYCA_MERCHANDID = 'C_57359E9C95103';\n $this->X_SYCA_APIKEY='pk_syca_753413334715da0c50e0a6adaf4d12abd9be1aa3';\n $this->sycapayUrlInit = \"https://secure.sycapay.com/login\";\n $this->sycapayUrl = 'https://secure.sycapay.com/checkresponsive';\n } else {\n //test\n $this->X_SYCA_MERCHANDID = 'C_56713FBF3E6A4';\n $this->X_SYCA_APIKEY='pk_syca_d49497468317152423d42aaff0d1166fc1b9522d';\n $this->sycapayUrlInit = \"https://secure.sycapay.net/login\";\n $this->sycapayUrl = \"https://secure.sycapay.net/checkresponsive\";\n }\n }", "public function __construct($config){\n $this->api = new LeadBIAPI($config);\n }", "public function __construct($config){\n $this->api = new LeadBIAPI($config);\n }", "function setUp() {\n\t\tparent::setUp();\n\t\twp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );\n\t\t$this->api = Astoundify_Envato_Market_API::instance();\n\t}", "public function __construct()\n {\n $this->apiKey = '66122f8ad1adb1c075c75aba3bd503a4a559fc7f';\n }", "public function extractApi();", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "function apiai()\n {\n $this->name = \"apiai\";\n $this->title = \"API.AI\";\n $this->module_category = \"<#LANG_SECTION_OBJECTS#>\";\n $this->api_endpoint = \"https://api.dialogflow.com/v1/\";\n $this->api_version = \"20170712\";\n $this->checkInstalled();\n }", "public function configure ()\n {\n $this->setMethod('GET');\n $this->setFunctionPath('/Api/monitorGetEventGroupDetails');\n $this->setParser(new \\ZendService\\ZendServerAPI\\Adapter\\EventsGroupDetails());\n }", "public function __construct()\r\n {\r\n $this->PROXY_HOST = '127.0.0.1';\r\n $this->PROXY_PORT = '808';\r\n $this->Env = \"sandbox\";\r\n $this->API_UserName = \"music2_1298365294_biz_api1.yahoo.com\";\r\n $this->API_Password = \"1298365304\";\r\n $this->API_Signature = \"AGvofgFr5KfTPLmgHXGvSxdUjiipALiplxLdQuq.GsgTLEvE0yswKLFb\";\r\n $this->API_AppID = \"APP-80W284485P519543T\";\r\n $this->API_Endpoint = \"\";\r\n $this->USE_PROXY = false;\r\n $this->preapprovalKey = \"\";\r\n }", "public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }", "public function setUp() {\n\t\t$this->client = new ElggApiClient(elgg_get_site_url(), $this->apikey->public);\n\t\t$result = $this->client->obtainAuthToken($this->user->username, 'pass123');\n\t\tif (!$result) {\n\t\t echo \"Error in getting auth token!\\n\";\n\t\t}\n\t}", "public function setup();", "public function setup();", "public function run()\n {\n DLocalConfig::create([\n 'name' => 'api.andeanwide.com',\n 'url' => 'https://dpayout.andeanwide.com/',\n 'grant_type' => 'client_credentials'\n ]);\n }", "public function __construct()\n {\n $this->api_key = env('RAJAONGKIR_API_KEY');\n }", "public function __construct()\n {\n\n // For Authenticating with Login Credentials\n\n //$this->username = config('whmcs.username');\n //$this->password = config('whmcs.password');\n\n // For Authenticating with API Credentials\n\n $this->api_identifier = config('whmcs.api_identifier');\n $this->api_secret = config('whmcs.api_secret');\n\n $this->api_access_key = config('whmcs.api_access_key');\n\n $this->response_type = strtolower(config('whmcs.response_type'));\n\n $this->client = new Client([\n 'base_uri' => config('whmcs.url'),\n 'timeout' => config('whmcs.timeout'),\n 'headers' => ['Accept' => 'application/json']\n ]);\n }", "public function api()\n {\n $apiCodePath = $this->basePath . '/src/Modules/xapi/Core/AppApi.php';\n if (!file_exists($apiCodePath)) {\n die(json_encode(['error' => 'Please, install xapi module']));\n }\n include $apiCodePath;\n $api = new AppApi([\n 'basePath' => $this->basePath,\n 'router' => $this->router,\n 'database' => $this->database,\n 'configData' => $this->configData,\n 'request' => $this->request,\n 'response' => $this->response,\n 'log' => $this->log,\n 'regionalInfo' => $this->regionalInfo,\n ]);\n $api->run();\n die($api->render());\n }", "public function setup()\n {\n \t// rtConfig::set('your-key', $your_value);\n }", "public function setUp()\n {\n parent::setUp();\n\n $config = [\n \"use_ssl\" => false,\n \"protocol\" => \"http\",\n \"host\" => \"bigalice2.nem.ninja\", // testing uses online NIS\n \"port\" => 7890,\n \"endpoint\" => \"/\",\n ];\n\n // each test should have its own API configured\n $this->client = new API();\n $this->client->setOptions($config);\n\n // each test should have its own SDK instance\n $this->sdk = new SDK([], $this->client);\n }", "public function processApi();", "protected function __construct()\n {\n // Instantiate new Api\n static::$api = new WpApi('bebop:api');\n static::$api->setBaseUrl('_bebop/api/');\n\n // Set post meta projection\n $postmeta_projection = new SqlProjection();\n $postmeta_projection->addColumn('meta_id', '__id')\n ->addColumn('post_id', '__post_id')\n ->addColumn('meta_key', '__key')\n ->addColumn('meta_value', 'value')\n ->setClass('Ponticlaro\\Bebop\\Resources\\Models\\ObjectMeta');\n\n self::$postmeta_projection = $postmeta_projection;\n\n // Set default routes ONLY after registering custom post types \n add_action('init', array($this, 'setDefaultRoutes'), 2);\n }", "public function __construct()\n {\n $prep = require ANAX_INSTALL_PATH . \"/config/keys.php\";\n // if the file dosent exist set it to an empty string.\n $this->apiKey = $prep[\"ip\"] ?? \"\";\n }", "public function __construct()\n {\n $param = func_get_args();\n switch (count($param)) {\n case 0:\n $this->setupApiConfigFromEnv();\n $this->setupApiConfigFromFile();\n break;\n case 1:\n $this->setupApiConfigFromFile($param[0]);\n break;\n case 2:\n $this->api_key = $param[0];\n $this->api_secret = $param[1];\n break;\n default:\n throw new ApiConstructorException('Invalid constructor parameters.');\n }\n $this->client = new Client(['base_uri' => self::BASE_URI, 'timeout' => self::TIMEOUT]);\n }", "public function __construct() {\n $storage = Config::get('steam::config.storage', storage_path('steam'));\n $key = Config::get('steam::config.api.key', self::KEY);\n $appid = Config::get('steam::config.api.appid', self::APPID);\n $lang = Config::get('steam::config.api.lang', self::LANG);\n $version = Config::get('steam::config.api.version', self::VERSION);\n $base_url = Config::get('steam::config.api.base_url', self::BASE_URL);\n\n $this->setBaseUrl($base_url);\n $this->setStorage($storage);\n $this->setKey($key);\n $this->setAppid($appid); \n $this->setLanguage($lang); \n $this->setVersion($version);\n }", "public function setApi() {\n\t\tif(sienna_mikado_twitter_feed_installed()) {\n\t\t\t$this->api = \\MikadofTwitterApi::getInstance();\n\t\t}\n\t}", "public function init()\n\t{\n\t\tYii::import('application.vendors.Mailchimp.*'); //Required to set our include path so the required_once's everywhere work\n\t\trequire_once('MCAPI.class.php');\n\n\n\t\t$this->objModule = Modules::LoadByName(get_class($this)); //Load our module entry so we can access settings\n\t\t$this->api = new MCAPI($this->objModule->getConfig('api_key'));\n\n\t}", "public function usage()\n {\n $array[\"api\"] = $this->config()->get(\"app_name\").\" RESTful API\";\n $array[\"version\"] = $this->config()->get(\"version\");\n $array[\"url\"] = $this->config()->get(\"base_url\").\"api/\";\n $array[\"timestamp\"] = date(\"D M d H:i:s O Y\");\n\n $array[\"controllers\"] = array();\n foreach ($this->_getApiControllers($this->app()) as $controller_name) {\n $array[\"controllers\"][] = $controller_name;\n }\n\n $this->response()->body($array);\n }", "protected function setUp() {\n $this->object = new OnlineLookupApiService();\n }", "protected function setUp() {\n\n $this->client = new Client(['base_uri' => getenv('API_ADDR')]);\n $this->locIDs = $this->insertTestLocations();\n reuse_generateXML();\n }", "public function __construct()\n\t\t{\n\t\t\t$this->_username = \"lenykoskey\";\n\t\t\t$this->_apiKey = \"abbfa09e621a6ece272a254e3fcd910657ff46e88f82db205499603d06dda908\";\n\n\t\t}", "public function setup()\n {\n CRUD::setModel('App\\Models\\Request');\n CRUD::setRoute(config('backpack.base.route_prefix').'/request');\n CRUD::setEntityNameStrings('demande', 'demandes');\n if (! $this->crud->getRequest()->has('order')) {\n CRUD::orderBy('created_at', 'DESC');\n }\n $this->crud->enableDetailsRow();\n }", "public function rest_api_init() {\n register_rest_route('h5p/v1', '/post/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_post'),\n 'args' => array(\n 'id' => array(\n 'validate_callback' => function ($param, $request, $key) {\n return $param == intval($param);\n }\n ),\n ),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n\n register_rest_route('h5p/v1', 'all', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_all'),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n }", "protected function setUp()\n {\n $this->client = new HttpClient($this->api_key, $this->api_signature, $this->hostname);\n }", "protected function init()\n { \n // get remote config\n $this->_remoteConfig = Mage::helper('shoptimally_core/remoteConfig');\n \n // calculate enabled status\n $this->_isEnabled = ($this->getGeneralSetting('ShoptimallyEnabled')) &&\n (strlen($this->getApiKey()) > 0) &&\n $this->_remoteConfig->get(\"enabled\");\n \n // init shoptimally domain\n $this->_shoptimallyDomain = $this->_remoteConfig->get('shoptimally_domain');\n if (is_null($this->_shoptimallyDomain) || \n strlen($this->_shoptimallyDomain) == 0)\n {\n $this->_shoptimallyDomain = \"api1.shoptimally.com\"; \n }\n }", "public function setUp()\n {\n $this->instance = new CellsApi(getenv(\"CellsCloudClientId\"),getenv(\"CellsCloudClientSecret\"),\"v3.0\",getenv(\"CellsCloudApiBaseUrl\"));\n }", "public function setUp()\n {\n $this->instance = new CellsApi(getenv(\"CellsCloudClientId\"),getenv(\"CellsCloudClientSecret\"),\"v3.0\",getenv(\"CellsCloudApiBaseUrl\"));\n }", "protected function setup()\r\n {\r\n if (!defined('APNS_SSL_CERTIFICATE_FILE_PATH')\r\n || !file_exists(APNS_SSL_CERTIFICATE_FILE_PATH)\r\n ) {\r\n $this->markTestSuiteSkipped('Credentials missing in config.php');\r\n }\r\n \r\n $this->clientHandler = new Services_Apns_Client_Feedback();\r\n $this->clientHandler->setSslCertificateFilePath(APNS_SSL_CERTIFICATE_FILE_PATH);\r\n \r\n if (defined('APNS_CERTIFICATE_PASSWORD_PHRASE')) {\r\n $this->clientHandler->setPasswordPhrase(APNS_CERTIFICATE_PASSWORD_PHRASE);\r\n }\r\n \r\n if (defined('APNS_ENV')) {\r\n $this->clientHandler->setDefaultEnvironment(APNS_ENV);\r\n }\r\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->api = new PaymentSecupayCreditcardsApi();\n }", "function _init()\n {\n $this->_props['AppId'] = EBAY_NOTHING;\n $this->_props['DevId'] = EBAY_NOTHING;\n $this->_props['CertId'] = EBAY_NOTHING;\n $this->_props['RequestPassword'] = EBAY_NOTHING;\n $this->_props['RequestUser'] = EBAY_NOTHING;\n $this->_props['TimeOffset'] = EBAY_NOTHING;\n $this->_props['LogLevel'] = EBAY_NOTHING;\n $this->_props['LogFilename'] = EBAY_NOTHING;\n $this->_props['LogMode'] = 0;\n $this->_props['ApiMode'] = EBAY_NOTHING;\n $this->_props['SiteId'] = EBAY_NOTHING;\n $this->_props['CompatibilityLevel'] = EBAY_NOTHING;\n $this->_props['ErrorLevel'] = EBAY_NOTHING;\n $this->_props['ErrorLanguage'] = 0;\n $this->_props['RequestTimeout'] = EBAY_NOTHING;\n $this->_props['TokenMode'] = false;\n $this->_props['TokenPickupFile'] = EBAY_NOTHING;\n $this->_props['TokenUsePickupFile'] = false;\n $this->_props['ApiUrl'] = EBAY_NOTHING;\n $this->_props['AppMode'] = EBAY_NOTHING;\n $this->_props['PageSize'] = 200;\n $this->_props['ProxyServer'] = EBAY_NOTHING;\n $this->_props['ProxyUidPwd'] = EBAY_NOTHING;\n $this->_props['ProxyServerType'] = EBAY_NOTHING;\n $this->_props['UseHttpCompression'] = false;\n $this->_props['SerializeFolder'] = null;\n $this->_props['XmlEncoding'] = 0;\n $this->_props['DoXmlUtf8Decoding'] = false;\n $this->_props['DoXmlUtf8Encoding'] = false;\n $this->_props['RawLogMode'] = false;\n $this->_props['RawLogPath'] = EBAY_NOTHING;\n $this->_props['RawLogSeq'] = 1;\n $this->_props['RawLogName'] = EBAY_NOTHING;\n }", "private function prepareAPIRequest()\n {\n $api_key = $this->getAPIKey();\n\n $api_key_parts = \"\";\n if (count($api_key_parts = explode(\"-\", $api_key)) != 2) {\n throw new Exception(\"Invalid API Key\");\n }\n\n $this->setAPIEndpoint(\"https://$api_key_parts[1].api.mailchimp.com/\" . $this->api_version);\n }", "private function setup()\r\n\t{ }" ]
[ "0.7635061", "0.7577207", "0.70671535", "0.7012305", "0.6894087", "0.6864582", "0.68262255", "0.68111575", "0.67919296", "0.67330855", "0.6714633", "0.67093694", "0.65706164", "0.65415496", "0.65232307", "0.6521941", "0.64942336", "0.646863", "0.64587915", "0.6450961", "0.6412303", "0.63884616", "0.6357164", "0.63552004", "0.6352097", "0.63450426", "0.6338515", "0.632674", "0.63226163", "0.63198644", "0.63158196", "0.6307576", "0.6305611", "0.6292195", "0.6269041", "0.6269041", "0.6269041", "0.6266639", "0.62538284", "0.6224514", "0.6220946", "0.62174886", "0.62038225", "0.62038225", "0.6203311", "0.61884284", "0.61808693", "0.6169138", "0.6167676", "0.6167333", "0.6162046", "0.6159575", "0.6159328", "0.61580527", "0.61580527", "0.61580527", "0.6152382", "0.6137271", "0.61318856", "0.6126963", "0.6121936", "0.6121936", "0.6118081", "0.61171144", "0.6113454", "0.61102265", "0.6107621", "0.6096038", "0.6091222", "0.6089508", "0.60886836", "0.6070043", "0.6070043", "0.6067331", "0.60610044", "0.60608953", "0.60586387", "0.60578823", "0.60555375", "0.6054297", "0.6044866", "0.60295063", "0.6028924", "0.602441", "0.6021325", "0.60188985", "0.6002557", "0.5991014", "0.59900963", "0.59873724", "0.5985759", "0.5979664", "0.5975339", "0.59737575", "0.59675926", "0.59675926", "0.59625196", "0.5961809", "0.595528", "0.5951707", "0.59441143" ]
0.0
-1